i-mw

Cron Mastery

开发编程v1.0.3
作者:i-mw更新于 2026-05-17共 4 个版本 · 最新版本发布于 2026-02-16cron-mastery@clawhub_i-mw/cron-mastery
脚本工具#Cron

据 AlphaMoat 统计,截至 2026-10,Cron Mastery 累计下载 24,807 次、获 38 个星标,按累计下载量在本次参与排名的 10,914 个 AI 技能中排名第 1,149 位,在「开发编程」分类(1,069 个)中排名第 73 位。

列表默认按累计下载量排序,也可按星标排序;详情页排名按累计下载量计算。

累计下载
2.5万
星标
38
全站下载量排名
#1,149
全站前 11% · 「开发编程」前 7%
平台累计下载星标评论
ClawHub ↗2.0万383
SkillHub ↗2.5万38—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

说明什么时候用定时任务、什么时候用心跳,如何写提醒载荷、怎么做周期性维护,以及推送型提醒与静默日志各自该选哪种事件类型。明确长于一分种的等待不要用内置等待或循环。执行精度受网关心跳间隔影响,到点后会等到下一次跳拍才触发。 生成的建议仅作起点;按项目环境和可靠来源核实版本细节与事实,不要把示例当作实测结果。

资料发布于 2026-10-27

可以用来做什么

  • 给一条定时提醒选对载荷类型
  • 把周期性清理任务建成定时作业

什么时候用

  • 要写可靠提醒时
  • 定时任务触发时间不准要排查时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

半小时后提醒我开会,该怎么配
每日清理任务用定时还是心跳

月度数据趋势

累计下载2.5万
1.7万2.1万2.5万2026-05 · 累计下载 1.8万2026-06 · 累计下载 1.8万2026-07 · 累计下载 1.9万2026-08 · 累计下载 1.9万2026-09 · 累计下载 2.0万2026-10 · 累计下载 2.5万26-0526-0926-10
星标38
3537382026-05 · 星标 352026-06 · 星标 372026-07 · 星标 382026-08 · 星标 382026-09 · 星标 382026-10 · 星标 3826-0526-0926-10

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。 该技能有同名的其他版本,调整前的数据归属当前下载量最大的这一个。

月份累计下载环比星标
2026-102.5万—38
2026-092.0万—38
2026-081.9万+1.8%38
2026-071.9万+3.3%38
2026-061.8万+2.5%37
2026-051.8万—35

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

5.9 KB · ClawHub v1.0.3
---
name: cron-mastery
description: Master OpenClaw's timing systems. Use for scheduling reliable reminders, setting up periodic maintenance (janitor jobs), and understanding when to use Cron vs Heartbeat for time-sensitive tasks.
---

# Cron Mastery

**Rule #1: Heartbeats drift. Cron is precise.**

This skill provides the definitive guide for managing time in OpenClaw 2026.2.15+. It solves the "I missed my reminder" problem by enforcing a strict separation between casual checks (heartbeat) and hard schedules (cron).
展开全部(共 115 行)

## The Core Principle

| System | Behavior | Best For | Risk |
| :--- | :--- | :--- | :--- |
| **Heartbeat** | "I'll check in when I can" (e.g., every 30-60m) | Email checks, casual news summaries, low-priority polling. | **Drift:** A "remind me in 10m" task will fail if the heartbeat is 30m. |
| **Cron** | "I will run at exactly X time" | Reminders ("in 5 mins"), daily reports, system maintenance. | **Clutter:** Creates one-off jobs that need cleanup. |

## 1. Setting Reliable Reminders (2026.2.15+ Standard)

**Rule:** Never use `act:wait` or internal loops for long delays (>1 min). Use `cron:add` with a one-shot `at` schedule.

### Precision & The "Scheduler Tick"
While Cron is precise, execution depends on the **Gateway Heartbeat** (typically every 10-60s). A job set for `:00` seconds will fire on the first "tick" after that time. Expect up to ~30s of variance depending on your gateway config.

### Modern One-Shot Reminder Pattern
Use this payload structure for "remind me in X minutes" tasks. 

**Key Features (v2026.2.15+):**
- **Payload Choice:** Use **AgentTurn** with **Strict Instructions** for push notifications (reminders that ping your phone). Use **systemEvent** only for silent logs or background state updates.
- **Reliability:** `nextRunAtMs` corruption and "Add-then-Update" deadlocks are resolved.
- **Auto-Cleanup:** One-shot jobs auto-delete after success (`deleteAfterRun: true`).

**CRITICAL: Push Notifications vs. Silent Logs**

- **systemEvent (Silent):** Injects text into the chat history. Great for background logs, but **WILL NOT** ping the user's phone on Telegram/WhatsApp.
- **AgentTurn (Proactive):** Wakes an agent to deliver the message. **REQUIRED** for push notifications. Use the "Strict" prompt to avoid AI chatter.

**For push-notification reminders (Reliable):**
```json
{
  "name": "Remind: Water",
  "schedule": { "kind": "at", "at": "2026-02-06T01:30:00Z" },
  "payload": {
    "kind": "agentTurn",
    "message": "DELIVER THIS EXACT MESSAGE TO THE USER WITHOUT MODIFICATION OR COMMENTARY:\n\n💧 Drink water, Momo!"
  },
  "sessionTarget": "isolated",
  "delivery": { "mode": "announce", "channel": "telegram", "to": "1027899060" }
}
```

**For background logs (Silent):**
```json
{
  "name": "Log: System Pulse",
  "schedule": { "kind": "every", "everyMs": 3600000 },
  "payload": {
    "kind": "systemEvent",
    "text": "[PULSE] System healthy."
  },
  "sessionTarget": "main"
}
```

### Cron Concurrency Rule (Stabilized)
Pre-2026.2.15, the "Add-then-Update" pattern caused deadlocks. While this is now stabilized, it is still **best practice** to pass all parameters (including `wakeMode: "now"`) directly in the initial `cron.add` call for maximum efficiency.

## 2. The Janitor (Auto-Cleanup) - LEGACY

**Note:** As of v2026.2.14, OpenClaw includes **maintenance recompute semantics**. The gateway now automatically cleans up stuck jobs and repairs corrupted schedules. 

**Manual cleanup is only needed for:**
- One-shot jobs created with `deleteAfterRun: false`.
- Stale recurring jobs you no longer want.

### Why use `sessionTarget: "main"`? (CRITICAL)
Sub-agents (`isolated`) often have restricted tool policies and cannot call `gateway` or delete other `cron` jobs. For system maintenance like the Janitor, **always** target the `main` session via `systemEvent` so the primary agent (with full tool access) performs the cleanup.

## 3. Reference: Timezone Lock

For cron to work, the agent **must** know its time.
*   **Action:** Add the user's timezone to `MEMORY.md`.
*   **Example:** `Timezone: Cairo (GMT+2)`
*   **Validation:** If a user says "remind me at 9 PM," confirm: "9 PM Cairo time?" before scheduling.

## 4. The Self-Wake Rule (Behavioral)

**Problem:** If you say "I'll wait 30 seconds" and end your turn, you go to sleep. You cannot wake up without an event.
**Solution:** If you need to "wait" across turns, you **MUST** schedule a Cron job.

*   **Wait < 1 minute (interactive):** Only allowed if you keep the tool loop open (using `act:wait`).
*   **Wait > 1 minute (async):** Use Cron with `wakeMode: "now"`.

## 5. Legacy Migration Guide

If you have old cron jobs using these patterns, update them:

| Legacy (Pre-2026.2.3) | Modern (2026.2.15+) |
| :--- | :--- |
| `"schedule": {"kind": "at", "atMs": 1234567890}` | `"schedule": {"kind": "at", "at": "2026-02-06T01:30:00Z"}` |
| `"deliver": true` in payload | Not needed - `announce` mode handles delivery |
| `"sessionTarget": "main"` | `"sessionTarget": "isolated"` (default behavior) |
| Manual ghost cleanup required | One-shots auto-delete (`deleteAfterRun: true`) |
| `cron.update` after `cron.add` | Single-step `cron.add` with all properties |

## Troubleshooting

*   **"My reminder didn't fire":** Check `cron:list`. Verify the `at` timestamp is in the future (ISO 8601 format). Ensure `wakeMode: "now"` is set.
*   **"Gateway Timeout (10000ms)":** This happens if the `cron` tool takes too long (huge job list or file lock). 
    - **Fix 1:** Manually delete `~/.openclaw/state/cron/jobs.json` and restart the gateway if it's corrupted.
    - **Fix 2:** Run a manual sweep to reduce the job count.
*   **"Job ran but I didn't get the message":** Ensure you are using the **Strict Instruction Pattern** with `agentTurn` + `announce` mode for proactive pings.
*   **"The reminder message has extra commentary":** The subagent is being conversational. Use the strict prompt pattern: `"DELIVER THIS EXACT MESSAGE TO THE USER WITHOUT MODIFICATION OR COMMENTARY:\n\n💧 Your message here"`

「开发编程」分类下的热门技能

编程大神.Skill开发编程

【全栈能力】编程大神.Skill:面向复杂真实项目的高阶全栈编程助手。不止生成代码,而是从一句目标接手陌生代码库,拆解需求、补齐实现、追到根因、完成重构、联调前后端,并把结果推进到能运行、能验证、能交付。覆盖 Web、后端、脚本、iOS、安卓、鸿蒙 ArkUI、微信小程序及其他技术栈,支持中英文工程、疑难 Bug、跨模块任务和长任务续做;用构建、日志、真实入口、设备或接口证据说明结果。仅问概念时直接回答,要求落地时持续推进到验收或明确阻塞。

↓ 1125.9万★ 82u_42bbb65f
编程专家Pro.Skill开发编程

编程专家 Pro:融合编程专家 2.0.3 工程专题与编程大神的鸿蒙 ArkTS/ArkUI、微信小程序和小游戏开发资料。用于项目实现、根因调试、审查、重构、测试、架构性能分析及多端开发验证。支持自然语言和 @专题标识,按任务读取包内知识;只问概念时直接回答。

↓ 626.9万★ 32user_47d655f0
编程专家.Skill开发编程

编程专家.Skill P8级编程助手,25年实战经验技能Skill,全栈:Java/Php网站/软件项目、API设计、Bug诊断、代码生成、代码审查、重构、测试用例、性能基准、技术选型、文档生成、任务拆解、Spec驱动、Karpathy规范、CMS二次开发、前端设计、MySQL/Mariadb、项目知识图谱,以及工程纪律层(根因调试硬闭环、阶段导航、事故复盘/SLO、威胁建模/供应链安全、生产就绪/渐进式发布、AI编码治理、面向Agent代码可读性、LLM应用安全)。支持 @标识 显式调用跳过路由。

↓ 600.7万★ 378user_741dc82b
dev-expert开发编程

编程专家.Skill P8级编程助手,25年实战经验技能Skill,全栈:Java/Php网站/软件项目、API设计、Bug诊断、代码生成、代码审查、重构、测试用例、性能基准、技术选型、文档生成、任务拆解、Spec驱动、Karpathy规范、CMS二次开发、前端设计、MySQL/Mariadb、项目知识图谱,以及工程纪律层(根因调试硬闭环、阶段导航、事故复盘/SLO、威胁建模/供应链安全、生产就绪/渐进式发布、AI编码治理、面向Agent代码可读性、LLM应用安全)。支持 @标识 显式调用跳过路由。

↓ 528.1万★ 32user_814dbe54
dev-expert-pro开发编程

编程专家 Pro:融合编程专家 2.0.3 工程专题与编程大神的鸿蒙 ArkTS/ArkUI、微信小程序和小游戏开发资料。用于项目实现、根因调试、审查、重构、测试、架构性能分析及多端开发验证。支持自然语言和 @专题标识,按任务读取包内知识;只问概念时直接回答。

↓ 104.7万★ -user_814dbe54
编程专家 Pro开发编程

编程专家 Pro:融合编程专家 2.0.3 工程专题与编程大神的鸿蒙 ArkTS/ArkUI、微信小程序和小游戏开发资料。用于项目实现、根因调试、审查、重构、测试、架构性能分析及多端开发验证。支持自然语言和 @专题标识,按任务读取包内知识;只问概念时直接回答。

↓ 98.2万★ 1user_28275a78
编程专家.Skill开发编程

编程专家.Skill P8级编程助手,25年实战经验技能Skill,全栈:Java/Php网站/软件项目、API设计、Bug诊断、代码生成、代码审查、重构、测试用例、性能基准、技术选型、文档生成、任务拆解、Spec驱动、Karpathy规范、CMS二次开发、前端设计、MySQL/Mariadb、项目知识图谱,以及工程纪律层(根因调试硬闭环、阶段导航、事故复盘/SLO、威胁建模/供应链安全、生产就绪/渐进式发布、AI编码治理、面向Agent代码可读性、LLM应用安全)。支持 @标识 显式调用跳过路由。

↓ 70.1万★ 6user_613b33ea
Github开发编程

用 gh 命令行工具查看 GitHub 上的 PR 检查、工作流运行与 API 查询的技能。

↓ 48.0万★ 714Peter Steinberger

数据月份:2026-10 · 下载/星标数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。