← 返回
未分类 中文

openclaw-cron-standard

Standardize OpenClaw cron wrappers, prompt contracts, and delivery-mode expectations. Use when auditing or fixing cron jobs that rely on ClankerHive claims,...
标准化 OpenClaw cron 包装器、prompt 合约及投递模式要求。在审计或修复依赖 ClankerHive 声明的 cron 任务时使用。
pfrederiksen
未分类 clawhub v0.2.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 440
下载
💾 0
安装
1
版本
#latest

概述

openclaw-cron-standard

Use this skill when cleaning up or designing OpenClaw cron jobs.

Standard contract

For cron wrappers:

  1. Clear the old result artifact before a new run.
  2. Claim through one shared helper.
  3. If the claim reports ALREADY_CLAIMED, print that sentinel, exit 0, and do not write a result artifact.
  4. Only write a result JSON for a real execution or a real failure.
  5. Keep result artifacts as the source of truth for real runs, not duplicate-run guards.

For cron prompts:

  1. Run the wrapper first.
  2. If it prints ALREADY_CLAIMED, reply only with NO_REPLY.
  3. Only then read the result JSON.
  4. Never read a stale artifact after a duplicate-claim guard path.
  5. Match the prompt's delivery contract to the cron job's delivery.mode.

Delivery-mode contract

This is the easy place to break a healthy cron job.

Use delivery.mode: announce when:

  • the job returns user-visible text as its final assistant reply
  • the prompt says things like return summary_text exactly, return the alert text, or return the formatted message
  • the job explicitly says Do not use the message tool

Use delivery.mode: none when:

  • the job is intentionally silent on success
  • the job sends alerts explicitly via the message tool
  • the job is maintenance-only and should never rely on reply-text fallback delivery

Common failure mode

If you set delivery.mode: none on a cron that still relies on reply-text delivery, the job can:

  • run successfully
  • generate valid summary text
  • update freshness facts
  • still never notify the user

That is not a wrapper failure. It is a delivery-contract mismatch.

Why this matters

The fragile failure mode is usually contract drift across three places:

  • wrapper behavior
  • prompt behavior
  • claim string expectations such as already claimed vs already-claimed

That drift can turn a healthy duplicate-run guard into a fake failure or a silent not-delivered run. Delivery-mode drift can do the same thing even when the wrapper itself is fine.

Preferred implementation shape

Use a small shared helper module for:

  • prepare_result_path(...)
  • claim_or_exit(...)
  • run(...)

Keep wrapper-specific business logic outside the shared helper.

Audit checklist

  • no result artifact written on ALREADY_CLAIMED
  • stale result file is removed before each run
  • prompts check the sentinel before reading the artifact
  • delivery.mode matches the actual delivery contract (announce for reply delivery, none for explicit message-tool or silent jobs)
  • validator passes after edits
  • dead scratch wrappers and tmp scripts are removed if unreferenced

Good migration order

  1. Patch the wrapper contract first.
  2. Patch the live cron prompt second.
  3. Patch delivery.mode to match the prompt's real delivery behavior.
  4. Validate with the cron validator and any runtime snapshot tools.
  5. Remove dead one-off scripts after reference checks.

Scope guidance

This skill is for cron wrapper standardization, not for changing the business logic of a cron job unless that logic is required to fit the contract.

版本历史

共 1 个版本

  • v0.2.0 当前
    2026-05-03 07:09 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Openclaw Cost Tracker

pfrederiksen
从本地会话数据中追踪 OpenClaw token 使用量和 API 成本。推荐使用 openclaw-cost-diff 进行当前成本分析以及跨窗口对比分析。
★ 1 📥 1,172
data-analysis

GHIN Golf Tracker

pfrederiksen
分析本地GHIN高尔夫JSON数据,无需外部连接,即可报告差点趋势、得分模式、球场统计和年度表现。
★ 1 📥 958
productivity

Shipment Tracker

pfrederiksen
跨多家承运商(USPS、UPS、FedEx、DHL、Amazon、OnTrac、LaserShip)追踪包裹。适用场景:用户询问包裹状态、添加运单号或想了解……
★ 1 📥 1,145