一键导入
cron-healthcheck
Detect broken Hermes cron jobs and escalate to a remediation sub-agent. Triage cheap, fix expensive.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Detect broken Hermes cron jobs and escalate to a remediation sub-agent. Triage cheap, fix expensive.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | cron-healthcheck |
| description | Detect broken Hermes cron jobs and escalate to a remediation sub-agent. Triage cheap, fix expensive. |
| version | 0.1.0 |
| license | MIT |
| metadata | {"hermes":{"tags":["cron","monitoring","self-healing","fleet","observability"],"related_skills":["fleet-management","kanban-orchestrator"]}} |
A two-tier monitor for Hermes cron jobs. The triage layer runs hourly on a cheap model, notices when a job has been failing repeatedly, and delegates remediation to an expensive sub-agent that can actually diagnose and fix.
When everything is healthy, output is silent — no notifications, no chat noise.
cron-healthcheck (or similar)cron toolset is enabled (hermes tools enable cron)delegation toolset)CRON_HEALTH_ADMIN_TARGET env var to a
send_message target like telegram:<chat_id> — defaults to the home channel if
unset)Every cycle is the same three-step loop:
cronjob(action="list") to enumerate every job, including disabledconsecutive_errors >= 3HEARTBEAT_OK and stop (silent success)The triage layer does not diagnose, not remediate, not post status updates.
In a cron-run session, the cronjob toolset is not auto-loaded (cron jobs run with
a restricted toolset to keep the runtime cheap). Try the tool first; fall back to
reading ~/.hermes/cron/jobs.json directly if it's unavailable:
try:
jobs = cronjob(action="list")["jobs"]
except (NameError, AttributeError):
import json, pathlib
jobs = json.loads(pathlib.Path("~/.hermes/cron/jobs.json").expanduser().read_text())
# jobs.json shape: list of {id, name, enabled, last_status, last_error,
# consecutive_errors (older builds), schedule, ...}
broken = [j for j in jobs
if j.get("enabled", True)
and j.get("consecutive_errors", 0) >= 3]
If consecutive_errors is missing entirely (newer Hermes versions track failure runs
differently), inspect each job's recent runs under ~/.hermes/cron/output/<job_id>/ and
count how many of the last 3 are FAILED.
If broken is empty, return exactly:
HEARTBEAT_OK
This produces zero output to messaging channels.
When broken is non-empty, delegate via delegate_task:
delegate_task(
goal="Diagnose and remediate failing Hermes cron jobs",
context=f"""
The following cron jobs have consecutive_errors >= 3:
{render_broken_jobs(broken)}
For each failing job, follow this playbook:
1. DIAGNOSE — Inspect the last run output via cronjob(action="list") and any
referenced scripts. Common causes:
- Timeout: job exceeds its `timeout_seconds`
- Crash: the prompt/skill has a bug or hits a tool limit
- API failure: upstream service is down (rate-limit, 5xx, auth)
- Config drift: a referenced file moved or a credential expired
2. REMEDIATE — Based on diagnosis:
- Timeout → cronjob(action="update", schedule=..., timeout=min(current*2, 3600))
- Config drift → fix the referenced file or skill
- API failure → record for the report, no auto-fix
- Crash → record for human escalation, do not guess at code changes
3. VERIFY — cronjob(action="run", job_id=...) to force a test run. Wait for
completion. Confirm consecutive_errors resets to 0.
4. REPORT — Send a single summary message to the admin channel (env var
CRON_HEALTH_ADMIN_TARGET, default home channel) covering:
- Each broken job + root cause
- Remediation taken (or skipped, with reason)
- Test-run outcome
- Jobs that need human investigation
If a remediation attempt fails (test still errors after fix), send an explicit
"needs human" message — include job id, error, and what was tried.
""",
toolsets=["cron", "terminal", "file", "delegation"]
)
consecutive_errors >= 3 is the bright lineThis skill is stateless. The sub-agent may write a markdown log under
~/.hermes/cron/runs/cron-healthcheck/YYYY-MM-DD.md with the remediation history;
delete files older than 30 days on each run.
Suggested install:
hermes cron add \
--name "cron-healthcheck" \
--schedule "5 * * * *" \
--tz "<your-timezone>" \
--skill cron-healthcheck \
--model "<cheap-triage-model>" \
--timeout 120
Hourly at :05 — offset from :00 so it doesn't collide with jobs that fire on the
hour. Use the cheapest model that can reliably follow the detection logic (Gemini Flash,
Haiku, etc.); the expensive model only runs when something is actually broken.
| Path | Turns | Model |
|---|---|---|
| Healthy (heartbeat) | 2-3 | cheap |
| Broken → spawn | 3-5 | cheap |
| Sub-agent remediation | 10-20 / job | expensive |
consecutive_errors — field name varies between Hermes versions; check
with cronjob(action="list") first. Fall back to inspecting recent run records if the
field is absent.local. Make sure the cron job is created
with deliver="local" (or omit deliver entirely so it doesn't broadcast).This was an OpenClaw workflows/cron-healthcheck/AGENT.md recipe ported to a Hermes
skill. The original folder-based workflow pattern (one directory per workflow with
sibling state files) doesn't map cleanly to Hermes — skills are the right home for agent
procedures, cron jobs are the right home for scheduling, and ~/.hermes/cron/ is the
right home for run state.
Use when you have a HARD, open-ended, high-stakes problem worth throwing multiple AI models at and pulling the best solution out — architecture decisions, strategy design, thorny debugging, research synthesis, "what am I missing", tool/system design. This is the SOLVE counterpart to multi-review (which critiques an existing artifact). It fans the problem out to a role-differentiated panel of model families (proposer layer), then the caller acts as aggregator and builds a NEW best-of-breed answer via a component ledger — not an average, not a cut-and-paste splice. Also encodes WHEN NOT to use a panel (most problems), routing to a single strong model or the commodity openrouter/fusion instead. Accumulates a persistent model-task-fit knowledge base so future runs pick the right models for the right roles.
Use to govern your own autonomy, deciding when to act on your own versus ask for approval, and earning more freedom over time the way a new employee earns trust through training and repetition. Group your capabilities into skill buckets, classify every action as a reversible (two-way) or irreversible (one-way) door, hold a trust level per bucket (L1 supervised, L2 guardrailed, L3 autonomous), and keep an honest markdown ledger of your decisions that you read back to promote or demote yourself. Load when setting up your autonomy rules or when a consequential act-vs-ask decision comes up.
On-demand real-time web and X (Twitter) search via xAI's Grok. Reach for this when the user explicitly wants Grok to search, or asks for real-time / breaking / X-Twitter-native results that a general web search misses. Not the default web search — a named tool you invoke deliberately.
Use when a Hermes MEMORY.md or USER.md file is too large, bloated, stale, or over the recommended cap and you need to reduce prompt footprint without losing important facts. Applies a lossless memory diet: compress, relocate to SOUL.md/USER.md/AGENTS.md/context files, offload long-tail facts to the memory provider, convert reusable procedures into skills, then drop only stale or duplicate material. Includes dry-run, diff, and review gates before any write.
Use when creating, importing, formatting, editing, exporting, or quality-checking Google Docs from agent-generated markdown or local files.
Use when creating, populating, formatting, importing, exporting, or quality-checking Google Sheets from CSV, JSON arrays, or computed tabular data.