ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

cron-worker-guardrails

Use when hardening OpenClaw cron workers (especially isolated agentTurn jobs) against quoting failures, brittle shell patterns, SIGPIPE false failures, and cwd/env drift. Output: a scripts-first hardening checklist + portable patterns.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/phenomenoner/cron-worker-guardrails
Or

Cron Worker Guardrails

A reliability-first checklist for OpenClaw cron workers (especially sessionTarget="isolated" + payload.kind="agentTurn") and any automation that runs unattended.

Why this skill exists

Cron failures are rarely “logic bugs.” They’re usually:

  • brittle shell quoting (bash -lc '...' nested quotes)
  • command substitution surprises ($(...))
  • cwd/env drift (“works locally, fails in cron”)
  • pipelines that fail for the wrong reason (pipefail + head / SIGPIPE)

The fix is boring but effective: scripts-first + deterministic execution + silent-on-success.

Quick Start

If your cron payload is getting long or fragile:

  1. Move logic into a script (recommended location: tools/ in the target repo)
  2. Cron runs one short command
  3. Script prints NO_REPLY on success

If you want a portable “contract” to standardize your cron workers, use the file included with this skill:

  • references/cron-agent-contract.md

Also see:

  • references/pitfalls.md

Portability rule (important)

Do not hardcode deployment-specific absolute paths tied to one machine.

People install OpenClaw on different OSes and directory layouts (Linux/macOS/Windows; different home dirs; containers). Prefer:

  • repo-relative paths
  • environment variables you document
  • minimal wrappers that cd into the repo

Default stance (reliability-first)

  • Prefer scripts-first over multi-line bash -lc '...'.
  • Prefer one command per cron job.
  • Prefer explicit interpreters (python3, node, etc.) rather than ambiguous shims.
  • Keep success output silent: NO_REPLY.

Common failure patterns → fixes

1) unexpected EOF while looking for matching ')'

Likely causes:

  • unclosed $(...) from command substitution
  • broken nested quotes in bash -lc ' ... '

Fix pattern:

  • Replace the whole multi-line shell block with a small script.
  • Cron calls exactly one short command, e.g.:
    • python3 tools/<job>.py

2) False failure from pipefail + head (SIGPIPE)

Symptom:

  • command exits non-zero even though the output you wanted is fine

Fix pattern:

  • avoid pipefail when piping into head
  • or better: do the filtering in a script (read only what you need)

3) “Works locally, fails in cron”

Common causes:

  • wrong working directory
  • missing env vars
  • different PATH

Fix pattern:

  • cd into the repo (or have the script do it)
  • keep dependencies explicit and documented

Copy/paste hardening header (portable)

Use this near the top of a cron prompt (2 lines, low-noise):

  • Hardening (MUST): follow references/cron-agent-contract.md (scripts-first, deterministic cwd, silent-on-success).
  • Also apply cron-worker-guardrails (this skill). If parsing/multi-step logic is needed, write/run a small tools/*.py script.

Metadata

Stars1217
Views1
Updated2026-02-20
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-phenomenoner-cron-worker-guardrails": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.

Related Skills

openclaw-agent-optimize

Use when: you want to optimize an OpenClaw setup (cost/quality tradeoffs, model routing, context discipline, delegation, reliability) and you’re okay with a structured audit → options → recommended plan. Don’t use when: you want immediate config mutations without review, or the question is unrelated to OpenClaw operations. Output: a prioritized plan + exact change proposals (with rollback) if approved.

phenomenoner 1217

context-scope-tags

Use when: you need strict context boundaries in chat (Telegram/Discord/Slack/etc.) and want to prevent topic bleed using explicit tags like [ISO], [SCOPE], [GLOBAL], [NOMEM], [REM]. Don’t use when: you want normal free-form conversation with automatic carry-over. Output: a copy/paste tag cheat sheet + routing rules.

phenomenoner 1217

openclaw-agent-token-optimizer

DEPRECATED — duplicate listing. Please use the canonical "openclaw-agent-optimize" skill instead.

phenomenoner 1217

context-clean-up

Use when: you suspect OpenClaw prompt context is bloating (slow replies, high cost, repeated transcript noise) and you want a ranked offender list + a reversible clean-up plan. Don’t use when: you want the assistant to apply fixes automatically, or you’re asking for unrelated troubleshooting. Output: an audit summary + 3–8 concrete fix steps + rollback notes (no automatic changes).

phenomenoner 1217

openclaw-agent-optimize-skill

DEPRECATED — duplicate listing. Please use the canonical "openclaw-agent-optimize" skill instead.

phenomenoner 1217