← 返回 Skills 市场
42
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cn-time-parser
功能描述
智能识别中文时间关键词并转换为具体日期和时间戳;使用lunisolar模块处理农历计算,chinese-workday模块处理节日和工作日判断;支持解析复杂农历日期和判断节假日;当用户需要解析自然语言中的时间信息、计算特定日期、处理农历节日转换时使用
使用说明 (SKILL.md)
时间解析器
任务目标
- 本Skill用于:解析中文自然语言中的时间关键词,转换为具体的日期和时间戳
- 能力包含:识别常见中文时间关键词(今天、昨天、明天、前天、今年、去年等)、处理传统农历节日、解析具体农历日期(如农历二月二十五)、判断工作日和节假日、计算特定日期的时间戳
- 触发条件:用户提问中包含时间相关关键词,需要获取具体日期或时间戳
前置准备
- 依赖说明:需要安装Node.js环境,以及dayjs、lunisolar和chinese-workday模块
- 准备命令:在使用前执行
cd /workspace/projects/cn-time-parser && npm install
操作步骤
- 标准流程:
- 分析用户提问,提取时间关键词
- 调用脚本处理时间关键词:
- 脚本调用示例:
node scripts/parse-time.js --query "今天的天气怎么样"
- 脚本调用示例:
- 根据返回的具体日期进行后续操作
- 可选分支:
- 当检测到农历节日关键词时:使用lunisolar模块进行农历转换
- 当需要判断节假日时:使用chinese-workday模块获取节日信息和工作日判断
- 当需要时间戳时:自动生成Unix时间戳
使用示例
- 示例1:
- 场景/输入:用户问"明天是什么日子"
- 预期产出:解析出明天的具体日期(如2023-10-05)
- 关键要点:根据当前系统时间计算明天
- 示例2:
- 场景/输入:用户问"去年过年是哪一天"
- 预期产出:解析出去年春节的具体日期
- 关键要点:使用农历转换功能
- 示例3:
- 场景/输入:用户问"黄龙的生日是农历二月二十五,明年他的生日是公历的哪一天?"
- 预期产出:解析出明年农历二月二十五对应的公历日期
- 关键要点:支持解析具体农历日期并进行年份调整
- 示例4:
- 场景/输入:用户问"今年五一是不是工作日?"
- 预期产出:解析出五一的日期,并提供isWorkday和isHoliday字段
- 关键要点:使用chinese-workday模块判断节假日
资源索引
- 脚本:见 scripts/parse-time.js(用途与参数:解析时间关键词,支持--query参数传入用户提问)
- 参考:见 references/time-keywords.md(何时读取:需要了解所有支持的时间关键词时)
注意事项
- 脚本会根据当前系统时间进行计算,确保系统时间准确
- 农历转换基于lunisolar库,支持常见传统节日
- 节假日和工作日判断基于chinese-workday库
- 时间戳为毫秒级Unix时间戳
安全使用建议
This skill looks safe for its stated purpose. Before installing, be aware that it requires Node.js and npm dependencies; review the package files if you are cautious, and only provide query text that is relevant to the date or time calculation.
功能分析
Type: OpenClaw Skill
Name: cn-time-parser
Version: 1.0.0
The skill bundle is a legitimate utility designed to parse Chinese natural language time expressions into structured date and timestamp data. It utilizes well-known, relevant libraries (dayjs, lunisolar, and chinese-workday) and the logic in scripts/parse-time.js is strictly limited to string processing and date calculation without any network access, file system manipulation, or sensitive data access. No evidence of malicious intent or prompt injection was found.
能力评估
Purpose & Capability
The stated purpose, documentation, and visible code align around parsing Chinese natural-language dates, lunar dates, holidays, and timestamps.
Instruction Scope
The skill is user-invocable and scoped to time-related queries; no artifact shows prompt override, forced tool use, or instructions unrelated to date parsing.
Install Mechanism
SKILL.md asks the user to run npm install and then execute a Node.js script, while the registry requirements do not declare required binaries or an install spec. This is purpose-aligned but worth noticing.
Credentials
The skill uses local system time and date libraries, with no declared credentials, environment variables, network services, broad file access, or privileged OS requirements.
Persistence & Privilege
No artifact shows background persistence, account access, credential handling, self-modification, or privileged behavior beyond installing local npm dependencies.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cn-time-parser - 安装完成后,直接呼叫该 Skill 的名称或使用
/cn-time-parser触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Parses Chinese natural language time expressions, supports lunar calendar and holiday/workday judgments.
- Automatically extracts and parses Chinese time phrases (e.g., 今天, 去年, 农历日期).
- Converts lunar dates and traditional festivals using lunisolar module.
- Checks holidays and workdays using chinese-workday module.
- Outputs precise Gregorian dates and millisecond Unix timestamps.
- Includes command-line script for flexible integration with user queries.
元数据
常见问题
cn-time-parser 是什么?
智能识别中文时间关键词并转换为具体日期和时间戳;使用lunisolar模块处理农历计算,chinese-workday模块处理节日和工作日判断;支持解析复杂农历日期和判断节假日;当用户需要解析自然语言中的时间信息、计算特定日期、处理农历节日转换时使用. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 42 次。
如何安装 cn-time-parser?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cn-time-parser」即可一键安装,无需额外配置。
cn-time-parser 是免费的吗?
是的,cn-time-parser 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
cn-time-parser 支持哪些平台?
cn-time-parser 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 cn-time-parser?
由 黄龙(@as3long)开发并维护,当前版本 v1.0.0。
推荐 Skills