Make the root rules file a router
Keep topology, canonical commands, universal constraints, and “done” criteria in root AGENTS.md/CLAUDE.md. Put local rules beside the code they govern. Anthropic recommends under 200 lines; OpenAI reports roughly 100.13
TEST → ask the agent to list active instruction files
Turn procedures into narrow skills
One skill, one job. Put what + when in its description; move references and scripts out of SKILL.md. Invoke mandatory skills explicitly. Keep 10–20 positive, negative, and edge prompts; grade traces and artifacts—not vibes.24
SHIP → verify-change + its eval set together
Move hard rules out of natural language
Block destructive commands pre-tool, format/lint post-write, and run acceptance checks at stop. Unit-test command policy with match/not_match cases. Tool allow-lists and annotations are routing hints—not a security boundary.136
RULE → prose advises; code enforces
Keep truth append-only; derive the prompt view
Persist actions, observations, failures, state deltas, and condensation events; derive the smaller prompt view from that log. Checkpoint run_id, status, attempt, last event, artifact URIs, and prompt/tool/serializer versions. Externalize bulk logs with reloadable pointers.7
RECOVER → restart from disk, not transcript memory
Make long-run handoffs data, not summaries
Initialize {category, description, steps, passes:false}, a short progress file, and Git history. Each fresh session smoke-tests, completes one unfinished unit, verifies end-to-end, flips only its pass state, records failures, and commits cleanly.5
GUARD → nothing passes without observable behavior
Design tool feedback for the model
Bound searches; return file windows with paths, line numbers, totals, and omitted ranges. Include exit status and explicit empty-success. Make edits transactional: apply, syntax-check, roll back invalid mutations, show the changed region. Add tools only for repeated trace failures.8
BASELINE → simple loop first; ablate every new tool
Separate generation from acceptance
Use a fresh worktree or sandbox and an independent evaluator. The reproduction must fail before the patch, pass after, and regressions stay green. Record base commit, image digest, harness version, commands, outputs, and artifacts. Self-review is never the final oracle.159
DONE → executable evidence + clean state + durable handoff