Doctrine

CronCreate inline prompts must delegate to an editable protocol file on disk

fleet-opscron-discipline

CronCreate inline prompts must delegate to an editable protocol file on disk

The rule

CronCreate inline prompts MUST be minimal scaffolding that reads and executes a protocol file from disk — never inline the full logic. The protocol file is the living artifact; the cron prompt is a stable pointer to it.

Scope

  • Applies to: all Claude Code sessions using CronCreate, all fleet seats, all lanes
  • Does NOT apply to: one-shot scheduled commands with no evolving logic (e.g., git pull && echo done)

Rationale

Cron prompts are frozen at creation time. When a cron's behavior needs to evolve — new checks, amended thresholds, added steps — the only option is CronDelete + CronCreate, which loses the schedule, risks typos, and creates churn. By keeping the cron prompt as a thin pointer ("Read ~/Desktop/fleet/protocols/overnight-mesh.md and execute it"), the protocol file becomes the single source of truth for what each fire does. The protocol file is version-controlled, diffable, and editable by any seat mid-flight — including by the cron itself. A cron that improves its own protocol after learning from a fire is a cron that compounds capability without operator intervention.

Pattern

CronCreate prompt (stable, rarely changes):

Read the protocol at ~/Desktop/fleet/protocols/<name>.md.
Execute each step. If a step fails, follow the failure protocol in the file.
Do not improvise beyond what the protocol specifies.

Protocol file (living artifact, freely edited):

# <Name> Protocol v<N>

## Pre-flight
- [ ] Check ...

## Steps
1. ...
2. ...

## On failure
- ...

## Changelog
- v2: added step 3 after ORA-2026-XXXX
- v1: initial

Self-update pattern: A cron fire MAY append to or amend its own protocol file when it discovers a gap, provided the edit is committed with a changelog entry. This is the mechanism by which crons evolve without CronDelete/Create churn.

Anti-patterns

  • Inlining 50+ lines of logic in the CronCreate prompt — frozen, uncheckpointed, undiffable
  • Editing the cron prompt to evolve behavior (requires delete + recreate)
  • Protocol file without a changelog (silent drift, no audit trail)

Evidence trail

  • ORA-2026-0013 (DOC) — long-running shepherd cron pattern established the precedent for structured cron protocols
  • ORA-2026-0010 (DOC) — pre-arm git-state verification showed crons need checkable, auditable logic
  • Chad directive 2026-04-18 — explicit authorization for self-updating cron pattern across all Claude agents

Enforcement hook

  • Memory: feedback_self_updating_cron_pattern.md — loaded at boot for all Claude sessions
  • CLAUDE.md canonical bundle: to be added at next v1.13 stamp
  • Agent prompt: all Claude Code CLI sessions via memory system

Known exceptions

  • Trivial one-liner crons (e.g., git pull) don't need a protocol file — the overhead exceeds the benefit.
  • Emergency crons created during incident response may inline logic initially; refactor to protocol-file pattern within 24h.

Review cadence

  • Next review: 2026-07-18
  • Review trigger: if >3 crons are running with inline logic, the pattern isn't being adopted