← Back to Skills Marketplace
jhc888007

Cron Creator 定时任务创建器

by jhc888007 · GitHub ↗ · v1.0.13 · MIT-0
cross-platform ✓ Security Clean
212
Downloads
2
Stars
1
Active Installs
14
Versions
Install in OpenClaw
/install cron-creator-feishu
Description
【针对飞书优化】定时任务创建指引,专门针对飞书、尤其是多 Agent 场景进行优化,解决定时任务不稳定问题。
README (SKILL.md)

🤖 定时任务创建专家

声明:本工具依赖 openclaw CLI 执行任务。在执行命令前,你可能需要通过上下文或 read 工具获取 user_id/chat_id 以及 openclaw.json 中的多 Agent 配置 (channels.feishu.accounts)。这些信息是配置飞书定时任务中的必要参数,否则任务不能触发。如果你发现自己当前没有权限读取这些信息,或者上下文中缺失这些信息,请务必先向用户询问补全,绝不可自行编造。

🎯 应用场景与触发条件

当用户表达出需要在未来某个时间点或按照特定周期进行提醒、执行任务时触发。

  • 典型触发语:“5分钟后提醒我做xxx”、“每天8点提醒我xxx”、“工作日每两个小时提醒我喝水”等。

🛑 核心铁律

  1. 唯一创建方式:必须使用 CLI 指令 openclaw cron add 创建任务。
  2. 禁止直接手写:创建时严禁直接修改 cron/jobs.json(仅在修改/更新已有任务时允许)。
  3. 禁用系统功能严禁使用系统默认 crontab严禁使用延时脚本 (sleep 等) 触发任务。

⚙️ 执行逻辑与参数拆解

在生成命令前,必须严格按照以下四个步骤收集并处理参数:

步骤 1:信息内容拆解

  • 提取诉求 {message}:整理用户的具体需求。
    • 如果任务很简单,则提取一句话作为 message。
    • 如果用户的诉求比较明确且清晰,就直接将用户的指令作为 message,换行符用 \ 代替。
    • 如果任务较为复杂,需将其拆分为多个步骤(1、2、3...),然后合并为一段话,换行符必须使用 \ 代替。
  • 生成名称 {cron_name}:提取简短、有代表性的纯英文/拼音名称。

步骤 2:时间规则拆解

判断任务是“一次性任务”还是“周期性任务”,默认用户所指时间均为 东八区 (Asia/Shanghai)

  • A. 一次性任务

    • 必须计算出目标执行的精确时间,并将其转换为 UTC 标准时间
    • 格式必须为 YYYY-MM-DDThh:mm:ssZ(例如北京时间 2026-02-02 00:00:00,应转换为 2026-02-01T16:00:00Z)。
    • 使用参数:--at "\x3CUTC时间>"--delete-after-run(执行后即删除)。
  • B. 周期性任务

    • 需根据需求生成标准的 5 位 Cron 表达式 {cron_expression}
      • Cron 规则参考:* * * * * (分 时 日 月 星期)。例如:每天早上8点为 0 8 * * *,工作日每两小时为 0 */2 * * 1-5
    • 必须指定时区参数,如果用户没有指定时区则为东八区:--tz "Asia/Shanghai"
    • 必须 添加防并发打散参数:--stagger(随机设置 30s5m 之间的值,如 30s, 1m, 2m 等)。
    • 使用参数:--cron "\x3CCron表达式>"

步骤 3:发送目标与渠道拆解

分析指令的来源环境,确定消息发送的渠道参数:

  • 一、判断来源: 分析指令的触发环境,必须完整明确以下三个维度的信息
    1. 渠道归属:来自后台 Terminal 还是飞书等 IM 渠道?
    2. 对话类型(若为飞书):当前是 私聊 还是 群聊
    3. 部署模式(若为飞书):当前系统是 单 Agent 还是 多 Agent 配置?
  • 二、如果指令来源于飞书,必须完成以下两项数据提取:
    1. 获取目标 ID
      • 私聊场景 -> 提取当前对话中用户的 user_id(必须以 ou_ 开头)。
      • 群聊场景 -> 提取当前群聊对应的 chat_id(必须以 oc_ 开头)。
    2. 判定 Agent 模式
      • 读取 openclaw.json 文件。
      • 检查 channels.feishu 下是否存在 accounts 字段:则为多 Agent,则为单 Agent。
  • 三、如果为后台触发或者非飞书 IM 渠道按其对应默认规则处理。

根据上述判断,生成对应的目标参数集:

  • 情形 A:后台触发
    • 参数:--announce
  • 情形 B:飞书单 Agent 私聊
    • 参数:--announce --channel feishu --to "{user_id}"
  • 情形 C:飞书单 Agent 群聊
    • 参数:--announce --channel feishu --to "{chat_id}"
  • 情形 D:飞书多 Agent 私聊
    • 参数:--announce --channel feishu --to "user:{user_id}" --account "{account}" (注意:此处的 to 参数必须加上 user: 前缀)
  • 情形 E:飞书多 Agent 群聊
    • 参数:--announce --channel feishu --to "chat:{chat_id}" --account "{account}" (注意:此处的 to 参数必须加上 chat: 前缀)

步骤 4:基础运行时配置

所有任务必须附带以下基础运行参数:

  • --session isolated绝对不能选择 main)
  • --wake now

🛠️ 指令合成与示例

综合以上 4 个步骤,最终生成的指令结构如下(请根据实际情况组合参数):

示例 1:一次性任务(飞书多 Agent 环境群聊)

场景:用户在飞书(多Agent环境,account为assistant)要求“明早8点提醒我开早会”。

openclaw cron add \
  --name "morning_meeting_reminder" \
  --at "2026-03-01T00:00:00Z" \
  --session isolated \
  --message "记得参加早会哦!" \
  --wake now \
  --delete-after-run \
  --announce \
  --channel feishu \
  --to "chat:oc_1a2b3c4d5e6f" \
  --account "assistant"

示例 2:周期性任务(飞书单 Agent 环境私聊)

场景:用户在飞书要求“每天晚上10点提醒我写日报”。

openclaw cron add \
  --name "daily_report" \
  --cron "0 22 * * *" \
  --stagger 2m \
  --tz "Asia/Shanghai" \
  --session isolated \
  --message "该写日报啦!\
1. 总结今日进度\
2. 规划明日目标\
3. 归纳并调用 message 工具发送给用户" \
  --wake now \
  --announce \
  --channel feishu \
  --to "ou_9z8y7x6w5v4u"

示例 3:周期性任务(后台触发)

场景:系统管理员在后台要求“每 2 个小时检查一次系统日志”。

openclaw cron add \
  --name "check_system_logs" \
  --cron "0 */2 * * *" \
  --stagger 30s \
  --tz "Asia/Shanghai" \
  --session isolated \
  --message "请执行系统日志常规检查。" \
  --wake now \
  --announce
Usage Guidance
This skill appears coherent and focused on composing openclaw cron commands for Feishu. Before installing: (1) confirm openclaw.json does not contain sensitive secrets (API keys) or restrict access to it if it does; (2) ensure the agent is only allowed to read the declared context files and that it will ask you (not fabricate) any missing user_id/chat_id; (3) test with a non-sensitive dummy cron to verify generated commands and then inspect the created task list; (4) confirm you are comfortable the agent can run openclaw CLI commands in your environment. If openclaw.json contains secrets, avoid granting this skill access or sanitize the file first.
Capability Analysis
Type: OpenClaw Skill Name: cron-creator-feishu Version: 1.0.13 The skill bundle provides structured instructions for an AI agent to manage scheduled tasks via the OpenClaw CLI, specifically optimized for Feishu (Lark) environments. It includes detailed logic for time zone conversion, session isolation, and multi-agent account handling. While it requires the agent to read configuration files like openclaw.json and chat contexts to retrieve necessary IDs (user_id/chat_id), these actions are strictly aligned with the stated purpose of creating functional cron jobs and do not exhibit signs of data exfiltration or unauthorized execution.
Capability Assessment
Purpose & Capability
Name/description, required_files (openclaw.json, current_chat_context), and required_tools (openclaw CLI, read) match the stated goal of composing/adding cron tasks for Feishu and multi-agent setups. No unrelated environment variables, binaries, or installs are requested.
Instruction Scope
SKILL.md instructs the agent to read only the declared files (openclaw.json and current_chat_context) and to build/emit openclaw cron commands. It explicitly forbids fabricating missing data and restricts actions (must use openclaw cron add, not crontab or sleep). The scope stays within creating cron jobs.
Install Mechanism
No install spec or external downloads — instruction-only content with no code files. This is low risk because nothing is written or executed by the skill itself beyond generating CLI commands.
Credentials
The skill reads openclaw.json and chat context to extract account IDs and target IDs; this is necessary for Feishu multi-agent routing. However, openclaw.json may contain sensitive configuration (account identifiers or secrets) depending on local setup — the README/SKILL.md do not explicitly warn about secrets in that file. The skill requests no environment credentials, which is proportionate.
Persistence & Privilege
always:false and normal model invocation; the skill does not request persistent elevated privileges or modify other skills' configs. It only prescribes how to run openclaw CLI commands.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cron-creator-feishu
  3. After installation, invoke the skill by name or use /cron-creator-feishu
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.13
- No code or documentation changes detected in this release. - Version updated without modifications to the SKILL.md or any other files.
v1.0.12
- No code or documentation changes detected in this version. - Functionality and usage instructions remain unchanged from the previous version.
v1.0.11
- No changes detected in this release; version bumped for maintenance purposes. - All usage instructions and examples for 飞书(Feishu)定时任务 remain unchanged. - No updates to required tools, files, or logic.
v1.0.10
- Clarified the importance of acquiring required user/chat/account info before creating tasks; tasks cannot be triggered without this information. - Improved accuracy in the pre-task checklist and parameter requirement descriptions for Feishu/多 Agent scenarios. - No code or file changes. Documentation wording refined for reliability and correctness.
v1.0.9
cron-creator-feishu 1.0.9 - 明确分解了“发送目标与渠道”拆解逻辑,要求必须判断渠道归属、对话类型和部署模式,并补充了相关步骤描述。 - 对飞书 IM 场景下的 user_id/chat_id 提取和多/单 Agent 判断要求做了进一步严格化。 - 渲染和条理上略有调整,提升了使用指引的全面性和操作准确性。 - 无功能或命令变动,仅文档梳理和操作规范细化。
v1.0.8
- No user-visible changes in this version; documentation and code remain unchanged.
v1.0.7
- No user-facing or code changes; documentation content remains the same as the previous version. - Version update only.
v1.0.6
1. 增加 required_tools 和 required_files 字段,明确依赖 openclaw CLI、read 工具及 openclaw.json 和当前聊天上下文信息。 2. 强调需使用上下文或 read 工具获取 user_id/chat_id 及 openclaw.json 配置,确保关键参数获取方式准确。 3. 文档中相关描述优化,更精确反映多 Agent 场景下的信息读取流程和依赖要求。
v1.0.5
Version 1.0.5 - 修订了关于敏感信息(user_id/chat_id与多 Agent 配置)的获取顺序和指引表达,强调先补全而非编造。 - 优化开头声明部分表述,使流程要求更清晰。 - 其余定时任务创建逻辑、参数说明与示例无实质更动。
v1.0.4
cron-creator-feishu 1.0.4 - 加强了对 user_id、chat_id 及 openclaw.json 中多 Agent 配置的获取规范,要求缺失时务必先补全,不允许编造。 - 明确强调如无法获得必要身份/配置信息时需向用户主动补问。 - 调整声明部分:删除了关于 openclaw CLI 可能访问 openclaw.json 的模糊表述,明确依赖、获取信息的流程与限制。 - 其余指令合成和用法示例保持不变。
v1.0.3
**Changelog for cron-creator-feishu 1.0.3** - 添加声明,明确本工具会访问 openclaw.json 和获取 user_id/chat_id,并提醒不要将这些信息透漏给用户。 - 其余内容未发生变更,仅增加了信息使用说明。
v1.0.2
Version 1.0.2 - 明确说明工具会读取 openclaw.json,并在需要时获取当前对话 user_id/chat_id。 - 强调如果不读取 id 或 openclaw.json,将无法正确触发定时任务。 - 进一步解释需要访问当前会话的标识信息,提升对多 Agent 场景的适配度。 - 其它指引内容、创建流程与参数规范未变。
v1.0.1
- 增加提示:明确指出如不获取 id 或不读取 openclaw.json,无法正确触发定时任务。 - 其余定时任务创建规则、指令格式与范例未变,功能保持一致。
v1.0.0
cron-creator v1.0.0 - Initial release focused on reliable and standardized cron task creation for Feishu, especially multi-Agent scenarios. - Enforces strict rule: tasks must be created via `openclaw cron add` CLI, not by editing config files or using system crontab/scripts. - Detailed breakdown for parameter collection: task message, timing (single/recurring), target channel/user/account, and runtime config. - Examples included for typical usage in Feishu private chat, group chat (single/multi Agent), and backend. - Ensures time zone correctness, anti-concurrency (`--stagger`), session isolation, and mandatory wake parameters for all tasks.
Metadata
Slug cron-creator-feishu
Version 1.0.13
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 14
Frequently Asked Questions

What is Cron Creator 定时任务创建器?

【针对飞书优化】定时任务创建指引,专门针对飞书、尤其是多 Agent 场景进行优化,解决定时任务不稳定问题。 It is an AI Agent Skill for Claude Code / OpenClaw, with 212 downloads so far.

How do I install Cron Creator 定时任务创建器?

Run "/install cron-creator-feishu" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Cron Creator 定时任务创建器 free?

Yes, Cron Creator 定时任务创建器 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Cron Creator 定时任务创建器 support?

Cron Creator 定时任务创建器 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Cron Creator 定时任务创建器?

It is built and maintained by jhc888007 (@jhc888007); the current version is v1.0.13.

💬 Comments