← 返回 Skills 市场
yuzhiyongcn-coder

Cron Limited

作者 yuzhiyongcn-coder · GitHub ↗ · v1.2.0 · MIT-0
cross-platform ⚠ suspicious
90
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install cron-limited
功能描述
创建支持有限次数重复的定时任务,自动在第N次执行后清理自身。支持农历生日提醒,农历日期自动转阳历后每年自动重复。当用户需要「每X分钟执行一次,执行N次后自动停止」或「农历生日每年提醒,提前N天提醒」时使用。
使用说明 (SKILL.md)

cron-limited: 有限次数重复任务 + 农历生日提醒

重要:处理每日自动检查

当收到消息「CRON-LIMITED-DAILY-CHECK」时(由每日cron任务触发),必须执行以下步骤:

  1. 读取 ~/.openclaw/cron-limited/birthdays.json 配置
  2. 获取今天日期(上海时区)
  3. 对比配置中每个生日的提醒日期(生日日期 - 提前天数)
  4. 如果今天匹配任何提醒日期,使用以下命令发送提醒:
openclaw agent --message "\x3C提醒消息>" --deliver --channel \x3Cchannel> --to \x3Cto>

JSON配置格式:

[
  {
    "lunar_month": 8,
    "lunar_day": 15,
    "message": "生日快乐!",
    "time": "10:00",
    "days_before": 3,
    "channel": "openclaw-weixin",
    "to": "[email protected]"
  }
]

提醒消息格式:

  • 提前N天:📅 提醒:农历{月}月{日}日是 {生日阳历日期},还有 {N} 天!\ {自定义消息}
  • 当天:🎂 今天是农历{月}月{日}日!\ {自定义消息}

模式1: 有限次数重复任务

openclaw cron-limited add \
  --every \x3Cduration> \
  --repeat \x3Ccount> \
  --message "\x3Ctext>" \
  [--channel \x3Cchannel>] \
  [--to \x3Cdestination>]

参数说明:

参数 必须 说明
--every 重复间隔,如 5m1h30s
--repeat 重复次数,执行N次后自动删除
--message 发送的消息内容
--channel 渠道,默认 openclaw-weixin
--to 投递目标,默认使用当前会话的目标

示例:

# 每5分钟提醒喝水,共3次
openclaw cron-limited add --every 5m --repeat 3 --message "记得喝水! 💧" \
  --channel openclaw-weixin --to "[email protected]"

模式2: 农历生日提醒

openclaw cron-limited add-lunar \
  --lunar \x3C月份-日期> \
  --message "\x3Ctext>" \
  [--time \x3CHH:MM>] \
  [--days-before \x3CN>] \
  [--yearly] \
  [--channel \x3Cchannel>] \
  [--to \x3Cdestination>]

参数说明:

参数 必须 说明
--lunar 农历月-日,如 8-15 表示农历8月15
--message 发送的消息内容
--time 提醒时间,默认 08:00
--days-before 提前N天提醒,默认 0(当天)
--yearly 是否每年重复,默认 false
--channel 渠道,默认 openclaw-weixin
--to 投递目标,默认使用当前会话的目标

示例:

# 农历8月15生日提醒(当天早上10点)
openclaw cron-limited add-lunar --lunar 8-15 \
  --message "🎂 生日快乐!" \
  --time 10:00 \
  --channel openclaw-weixin --to "[email protected]"

# 农历8月15,提前3天提醒
openclaw cron-limited add-lunar --lunar 8-15 \
  --message "🎂 记得准备好庆祝!" \
  --time 09:00 \
  --days-before 3 \
  --yearly \
  --channel openclaw-weixin --to "[email protected]"

# 春节提醒(农历正月初一)
openclaw cron-limited add-lunar --lunar 1-1 \
  --message "🧧 春节快乐!新的一年开始了!" \
  --time 08:00 \
  --yearly \
  --channel openclaw-weixin --to "[email protected]"

工作原理

有限次数重复

  1. 创建主任务(循环任务)
  2. 根据 --every--repeat 计算第N次的执行时间
  3. 在第N次执行时间 + 1分钟 创建「删除主任务」的一次性任务
  4. 主任务执行第N次后,下一分钟自动被删除

农历生日提醒(每年模式)

  1. 将农历日期转换为当年对应的阳历日期
  2. 保存配置到 ~/.openclaw/cron-limited/birthdays.json
  3. 创建每日检查cron任务(早上7点)
  4. 每日检查任务触发时,agent读取配置并发送当日所有提醒

依赖

  • Python 3 + lunarcalendar 库
  • openclaw CLI
  • jq
安全使用建议
This skill appears to implement the advertised features, but there are practical and security issues you should address before installing: - Verify prerequisites: ensure Python3, lunarcalendar, jq, and the openclaw CLI are installed and trusted. The skill does not declare these in its metadata, which is an omission. - The script calls /tmp/lunar-venv/bin/python3 but does not create or validate that venv. Either create a controlled venv at that path yourself or modify the script to use a known Python interpreter to avoid running an attacker-provided binary in /tmp. - Understand how your OpenClaw runtime treats cron job messages: are they delivered as text only, or can they be interpreted/executed by the agent? The script sets a deletion job message to "openclaw cron rm <id>" — if messages get executed as commands, that could allow arbitrary command execution via crafted job messages. Confirm behavior and restrict who can create cron jobs. - Inspect and control ~/.openclaw/cron-limited/birthdays.json and the recipients (channel/to). The agent will send messages on your behalf to those destinations — ensure they are correct and limited to trusted recipients. - Consider editing the script to use a configurable python path and to explicitly create/activate its venv (or rely on system python), and to avoid embedding executable commands inside job message text unless you are certain the platform treats messages only as content. If you cannot verify the above, treat this skill as risky. If you proceed, run it in a controlled environment first and inspect created cron jobs and the config files it writes.
功能分析
Type: OpenClaw Skill Name: cron-limited Version: 1.2.0 The skill bundle contains a critical command injection vulnerability in `scripts/cron-limited.sh` where the `$message` shell variable is unsafely injected into a Python heredoc, potentially allowing arbitrary code execution. It also relies on a hardcoded, insecure path in `/tmp/lunar-venv/` for its Python environment, which is a significant security risk. While the logic appears to fulfill the stated purpose of managing cron jobs and lunar reminders, these architectural flaws and the inclusion of a specific hardcoded WeChat ID ([email protected]) in the documentation make the bundle high-risk.
能力评估
Purpose & Capability
The skill claims no required binaries/env but the script and SKILL.md clearly require: openclaw CLI, Python3 with the lunarcalendar library, and jq. It also reads/writes ~/.openclaw/cron-limited, which is consistent with storing reminders but was not reflected in declared requirements. The functionality (limited-repeat cron + lunar birthday reminders) is coherent, but the metadata omission of obvious runtime dependencies is a mismatch.
Instruction Scope
SKILL.md instructs the agent to process a special message 'CRON-LIMITED-DAILY-CHECK' by reading ~/.openclaw/cron-limited/birthdays.json, computing dates (Shanghai TZ), and sending messages via openclaw agent CLI. That is within the stated purpose. Two things to watch: (1) the script creates a 'delete' cron whose message is the literal string 'openclaw cron rm <id>' — if the platform treats cron job messages as executable commands, that could cause arbitrary command execution; the docs do not clarify whether messages are executed or only delivered as text. (2) The script reads and writes user files in the home directory and expects the agent to send messages on behalf of the user—this is expected for a notifier but is sensitive behavior (it can send messages to external recipients).
Install Mechanism
No install spec is provided, yet the script calls /tmp/lunar-venv/bin/python3 and expects the lunarcalendar library. There is no step that creates or validates this virtualenv. The hard-coded /tmp/lunar-venv path is brittle and could be abused if an attacker can place a malicious python binary there. No remote downloads appear in the skill, which reduces install-time risk, but the absent setup instructions are a practical and security concern.
Credentials
The skill requests no environment variables or credentials — which is proportionate to a local reminder/cron helper. However, it implicitly requires the openclaw CLI to be able to deliver messages (and jq for JSON parsing), and those requirements were not reflected in the declared metadata. The script writes to and reads from $HOME/.openclaw/cron-limited; that's expected for configuration storage but gives the skill access to that directory.
Persistence & Privilege
The skill does not request always:true and does not modify other skills. It creates cron jobs via the openclaw cron API and writes its own config under ~/.openclaw/cron-limited, which is appropriate for its purpose. This level of persistence is expected for a scheduling skill.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cron-limited
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cron-limited 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
v1.2.0: 农历生日支持每年自动重复(--yearly)、自定义提醒时间(--time)、提前N天提醒(--days-before)
v1.1.0
v1.1.0: 新增农历生日提醒功能(--lunar 参数),支持农历月-日自动转阳历后定时投递
v1.0.0
首次发布:支持有限次数重复的定时任务,自动在第N次执行后清理
元数据
Slug cron-limited
版本 1.2.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

Cron Limited 是什么?

创建支持有限次数重复的定时任务,自动在第N次执行后清理自身。支持农历生日提醒,农历日期自动转阳历后每年自动重复。当用户需要「每X分钟执行一次,执行N次后自动停止」或「农历生日每年提醒,提前N天提醒」时使用。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 90 次。

如何安装 Cron Limited?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cron-limited」即可一键安装,无需额外配置。

Cron Limited 是免费的吗?

是的,Cron Limited 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Cron Limited 支持哪些平台?

Cron Limited 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Cron Limited?

由 yuzhiyongcn-coder(@yuzhiyongcn-coder)开发并维护,当前版本 v1.2.0。

💬 留言讨论