When should you use it?
- A bug in your code could corrupt customer data
- You care more about correctness than throughput
- You can afford slower agent runs
Not for: Quick prototypes; Teams that will not maintain the pipeline's own skills
What do you need, and what do you get?
You need
- A mirrored repo to trial the pipeline
- Issue tracker labels for each stage
- Skill and prompt files per role
You get
- Child tickets ordered by what depends on what
- Small reviewable pull requests
- Structured escalation notes for humans
How does it work, step by step?
- Trial on a mirrorBuild the pipeline in a copy of the repository before touching the real one.
- Decompose big asksLet a planner split large issues into dependent children, and split again if a child is still too big.
- Review repeatedlySend work back until reviewers are satisfied; Db2 needed fifty-five send-backs.
- Never flailA stuck agent stops, writes a structured handoff borrowed from clinical practice and escalates.
- Turn on human approvalAfter the first week they required a person to look at every merge.
The prompt
Our own prompt, inspired by Adam Storm and written to work in Claude Code and Custom agent. Values in lime are placeholders.
You are the planner for issue [number]. If it is too large for one small pull request, break it into child tickets, state which depend on which, and acceptance tests, and stop. If you are a worker and you are stuck after [N] attempts, do not keep trying: write a handoff with severity, summary, actions tried, current situation and your best hypothesis, then label the issue for human attention.
Inspired by Adam Storm: Five months treating bugs like patients and coding agents like a medical team. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.
What can go wrong?
- Skill files rot like code; an audit found 23% of 100,000 words removable.
- Long instruction files cost tokens on every run before any work starts.
Our take
This is among the most rigorous public accounts of agent coding, and its framing is the lesson: measure how many pull requests you would be embarrassed to merge, not how many ship. Reviewers sending work back dozens of times is a feature, not a failure, if the alternative is merging weak code. The rule that stuck agents write a structured handoff instead of trying harder is worth copying anywhere, because endless retries burn money and rarely fix a wrong approach. So is a periodic prompt audit; schedule one quarterly to catch instructions that drift. Smaller teams can start with just the decompose, review and escalate stages without copying the full hospital metaphor. Keep a human owner for interface design and for anything that touches production data. Track token spend per epic so surprises like a multi-thousand-dollar burst are visible. Trial the process on a mirror of a hard problem before pointing it at the real migration.
Where the time goes back: Slow, gated agent work replaces months of engineering on features where mistakes are expensive.
FAQ
What has it cost overall?
Did humans write any Db2 code?
Source and credit
Inspired by Adam Storm. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.
- Inspired by
- Five months treating bugs like patients and coding agents like a medical team
- Creator
- Adam Storm
- Published on
- cockroachlabs.com
- Original date
- Oct 9, 2026
- License
- Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
- Originally for
- Claude Code
- AI dry run
- Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails. - Verified
- Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.
Are you the creator? Claim or correct this page.