원클릭으로
cron-jobs-writer
安全写入 OpenClaw cron jobs.json。在写入前强制执行格式校验,确保 payload 与 sessionTarget 匹配,避免 JSON 解析失败导致 Gateway 无法启动。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
安全写入 OpenClaw cron jobs.json。在写入前强制执行格式校验,确保 payload 与 sessionTarget 匹配,避免 JSON 解析失败导致 Gateway 无法启动。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Self-contained browser automation. Navigates websites, fills forms, takes screenshots, extracts data. Runtime auto-installs on first use — no npm, Node.js, or Chrome required on the host.
专业 Word 文档(.docx)创建、编辑和排版。覆盖报告、公文、合同、备忘录、学术论文等场景。当用户要求生成、编辑、修改任何 Word 文档时使用此技能。即使用户没有明确说 docx,只要任务暗示需要可打印的正式文档,就应使用此技能。
Generate, edit, and read PowerPoint presentations. Create from scratch with PptxGenJS (cover, TOC, content, section divider, summary slides), edit existing PPTX via XML unpack/pack workflows, or extract text with markitdown. Includes 18 color palettes, 4 style recipes, 5 slide types, and full design system. Triggers: PPT, PPTX, PowerPoint, presentation, slide, deck, slides, 演示文稿, 幻灯片.
专业 Excel 文件(.xlsx)创建、读取、编辑、公式验证和格式化。覆盖数据表、财务模型、报表、统计分析等场景。当用户要求创建、编辑、分析任何 Excel 表格时使用此技能。
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
| name | cron-jobs-writer |
| description | 安全写入 OpenClaw cron jobs.json。在写入前强制执行格式校验,确保 payload 与 sessionTarget 匹配,避免 JSON 解析失败导致 Gateway 无法启动。 |
| slug | cron-jobs-writer |
| version | 1.0.1 |
| displayName | 定时任务工具(Cron Jobs Writer) |
| summary | 安全写入 ~/.openclaw/cron/jobs.json,写入前强制校验,避免 Gateway 解析失败。支持 main/isolated 两种会话类型。 |
| tags | cron, openclaw, gateway, jobs, schedule |
以下任一情况触发本技能:
Failed to parse cron store)写入或排查 ~/.openclaw/cron/jobs.json 前必须按本技能流程执行,否则可能导致 Gateway 解析失败、KeepAlive 反复重启。
唯一正确路径:~/.openclaw/cron/jobs.json
workspace/cron/jobs.json 或任何 workspace/ 下的 cron 文件~/.openclaw/cron/jobs.json,写错路径等于没修修改后必须重启:修改 jobs.json 后,必须执行 {{SKILL_DIR}}/scripts/restart-gateway.sh(pkill 彻底结束 Gateway 后 start,避免双实例),cron 模块才会重新加载配置。否则修改不生效。
flowchart TD
A[用户请求创建/修改 cron] --> B[读取当前 jobs.json]
B --> C[校验 JSON 可解析]
C --> D{格式正确?}
D -->|否| E[报告错误详情]
E --> F1{询问用户: 是否修复?}
F1 -->|是| G1[尝试修复 常见错误]
G1 --> H1[再次校验]
H1 --> D
F1 -->|否| G2[中止 不写入]
D -->|是| I[构造新 job 对象]
I --> J[校验 payload 规则]
J --> K{sessionTarget+payload 匹配?}
K -->|否| L[修正或报错]
K -->|是| M[合并到 jobs 数组]
M --> N[再次校验完整 JSON]
N --> O[写入文件]
O --> P[执行 restart-gateway.sh]
当用户反馈 cron 相关问题时,不要直接重启 Gateway。先执行:
bash {{SKILL_DIR}}/scripts/validate-jobs-json.sh ~/.openclaw/cron/jobs.json
all 给 cron.list、Gateway 未启动等),可排查 Gateway 日志或建议用户重启在任何写入 jobs.json 的操作之前,先执行:
bash {{SKILL_DIR}}/scripts/validate-jobs-json.sh ~/.openclaw/cron/jobs.json
当用户同意修复时,按以下优先级尝试:
| 错误类型 | 修复方式 |
|---|---|
| JSON 解析失败(如漏逗号) | 用 json.load + json.dump 重新序列化,或手动补逗号 |
sessionTarget: "isolated" 但 payload.kind: "message" | 改为 kind: "agentTurn",text 改为 message |
sessionTarget: "main" 但 payload.kind: "message" | 改为 kind: "systemEvent",保持 text |
| 缺必填字段 | 按 schema 补全或标记为需用户确认 |
修复后必须再次运行校验脚本,通过后再继续。修复完成并校验通过后,执行 {{SKILL_DIR}}/scripts/restart-gateway.sh,否则 cron 不会加载新配置。
| sessionTarget | payload.kind | 提示内容字段 |
|---|---|---|
main | systemEvent | text |
isolated | agentTurn | message |
常见错误:
isolated 用 payload.kind: "message" → 会报 isolated job requires payload.kind=agentTurnagentTurn 用 text 而非 message → 必须用 message向 jobs 数组追加新 job 时:
}, 后接 {,不能是 } 后直接 {json.load + json.dump 读写,避免手写 JSON 漏逗号{{SKILL_DIR}}/scripts/restart-gateway.shworkspace/cron/jobs.json,cron 配置只在 ~/.openclaw/cron/jobs.jsonall 给 cron.list(Gateway 不支持该参数)cron.runs 的 limit 超过 200{{SKILL_DIR}}/references/schema.md