AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Cron Regex Buddy

skill-yuaicode-ai-skills-cron-regex-buddy · by YuAICode

用中文解释或生成 cron 表达式与正则表达式,逐字段/逐组讲清含义并给出匹配示例。触发词:'/cron-regex-buddy'、'解释这个 cron'、'帮我写个正则'、'这个正则什么意思'、'生成一个 cron'。Use when the user wants to explain or generate cron expressions or regular expressions in Chinese.

No reviews yet
0 installs
35 views
0.0% view→install

Install

$ agentstack add skill-yuaicode-ai-skills-cron-regex-buddy

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-yuaicode-ai-skills-cron-regex-buddy)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Cron Regex Buddy? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

cron-regex-buddy — cron 与正则中文向导

把看不懂的 cron 表达式或正则表达式讲清楚,或者把中文需求翻译成正确的 cron / 正则,并自检合法性。

何时触发

用户说:

  • /cron-regex-buddy
  • "解释这个 cron:0 9 * * 1-5"
  • "这个正则什么意思:^\d{3}-\d{4}$"
  • "帮我写个匹配手机号的正则"
  • "我想每天早上 9 点跑一次,cron 怎么写"
  • "生成一个 cron 表达式" / "cron 怎么填"
  • "这个表达式对吗"

两种工作模式

模式 A:解释模式

用户给出一个 cron 或正则 → 逐段拆解,中文讲清每部分含义,并给出具体匹配示例。

流程:

  1. 判断输入是 cron 还是正则(或两者都有)。
  2. 先用 bin/validate.sh 自检:

``bash bash /bin/validate.sh cron "" bash /bin/validate.sh regex "" `` 若 exit 2,把错误原因中文报给用户,不继续解释。

  1. 解释 cron 时按字段顺序逐一说明:

| 字段 | 位置 | 含义 | |------|------|------| | 分钟 | 1 | 0–59 | | 小时 | 2 | 0–23 | | 日 | 3 | 1–31 | | 月 | 4 | 1–12 | | 星期 | 5 | 0–7(0 和 7 均为周日) | | 秒(可选) | 6 | 0–59,仅部分调度器支持 |

常用符号说明:* 任意值、, 多值列举、- 范围、/ 步进、? 日/星期互斥占位(Quartz 风格)、L 最后一天、# 第 N 个星期 X。

  1. 解释正则时按从左到右逐组/逐字符说明,并给出 2–3 个匹配示例与 1–2 个不匹配示例。
  2. 时区提醒:解释 cron 时指出"cron 以服务器本地时区为准,未指定时区时请确认系统时区设置。"

输出格式(cron 示例):

表达式:0 9 * * 1-5

逐字段解释:
- 分钟:0          → 整点(第 0 分)
- 小时:9          → 早上 9 点
- 日:  *          → 每天
- 月:  *          → 每月
- 星期:1-5        → 周一到周五

含义:每个工作日(周一至周五)早上 9:00 执行。

匹配时刻示例:2026-06-08 09:00(周一)、2026-06-09 09:00(周二)
不触发时刻:2026-06-06 09:00(周六)、2026-06-08 09:30(非整点)

⚠️ 时区:cron 以服务器本地时区为准。如需北京时间请确认 TZ=Asia/Shanghai。

输出格式(正则示例):

表达式:^\d{3}-\d{4}$

逐组解释:
- ^         → 字符串开头锚点
- \d{3}     → 恰好 3 位数字(0–9)
- -         → 字面连字符
- \d{4}     → 恰好 4 位数字
- $         → 字符串结尾锚点

匹配示例:123-4567、000-9999
不匹配示例:12-4567(首段只有 2 位)、123-456a(含字母)

引擎说明:\d 在 PCRE/Python/JS 中等同 [0-9];在 POSIX ERE(grep -E)中无效,须改用 [0-9]{3}-[0-9]{4}。

模式 B:生成模式

用户用中文描述需求 → 产出 cron 或正则 + 解释 + 注意事项。

流程:

  1. 明确需求:时间规律(cron)还是文本匹配规则(正则)?二义时先问清楚。
  2. 生成表达式。
  3. 立刻用 bin/validate.sh 自检,若失败说明原因并修正后再给出。
  4. 按模式 A 的格式完整解释生成结果。
  5. 输出注意事项:

cron 注意事项清单(按需挑选相关项):

  • 时区:明确指出基于哪个时区,如需特定时区给出设置方式(如 TZ=Asia/Shanghai)。
  • 星期 0/7 差异:不同调度器(Linux crontab / Quartz / AWS EventBridge)对 0=周日或 7=周日的处理可能不同,需确认。
  • 6 段 vs 5 段:Quartz/Spring 支持 6 段(含秒),标准 POSIX crontab 只有 5 段。
  • 月底陷阱:30 日在 2 月不存在,L 才表示"月末最后一天"。
  • 分钟与小时顺序:新手常把分钟和小时写反。

正则注意事项清单(按需挑选相关项):

  • 引擎差异:PCRE / Python re / JavaScript / POSIX ERE 对 \d \w \s 等支持不同。
  • 贪婪 vs 非贪婪:.* 默认贪婪,.*? 才是非贪婪。
  • 转义:在某些语言中正则字符串本身需要双重转义(如 Java \\d)。
  • 锚点:没有 ^ $ 的模式是"包含匹配"而非"完整匹配"。
  • Unicode:\d 在部分引擎中匹配全角数字,如需限制请用 [0-9]

输出格式(生成模式):

需求:每周一凌晨 2:30 执行

生成结果:
  cron:30 2 * * 1

逐字段解释:(同模式 A)

注意事项:
- 星期字段 1 = 周一(Linux crontab 约定;Quartz 中 1 = 周日,请按调度器文档确认)。
- 时区以服务器本地时区为准。

硬规则

  1. 先 validate,后解释/给出:生成或解释任何表达式前,必须先跑 bin/validate.sh 自检。exit 2 则停下报错,不继续输出。
  2. 不确定语义必须说明:如 cron 星期 0/7 差异、正则引擎差异等,不能悄悄选一个当成通用。
  3. 只输出已确认合法的表达式:validate 通过后再输出,同时附完整解释。
  4. 不臆造:没把握的引擎特性/平台行为,明确说"请查阅 XX 文档确认"。
  5. 全程中文:解释/注意事项用简体中文;cron 表达式/正则本身保持原样;命令行示例保持英文。

bin 脚本

# 校验 cron(5 或 6 段,粗校验字符)
bash /bin/validate.sh cron "0 9 * * 1-5"

# 校验正则(用 grep -E 干跑)
bash /bin/validate.sh regex "^\d{3}-\d{4}$"

exit 0 = 合法;exit 2 = 非法,附中文错误信息;exit 1 = 用法错误。

边界

  • cron 校验是粗校验(字段数 + 字符白名单),不做语义校验(如"分钟最大 59")。语义层面的合理性由 Claude 判断并在解释中说明。
  • 正则校验基于 POSIX ERE(grep -E)。若用户目标引擎是 PCRE/Python/JS,校验通过不代表在那些引擎中完全合法,需额外提示。
  • 不执行用户给出的正则以匹配真实数据,只做合法性干跑。

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.