Part IV, chapters 21–22
Tutorials
Build something end to end with an agent: the prompts to give it, the tests that decide the result, and a script you can run.
Part IV is two worked tutorials on one theme: getting real work out of a coding agent without losing control of the code. They are method walkthroughs and say so. No agent ran while they were written; what ran was Python 3.13.12 on Windows, the finished code and its tests, and every output block shown is real. The prompts are the ones we would send, in the order we would send them, and they are labelled that way.
Start with building a CLI tool from a one-paragraph spec: the spec, the prompts in order, nine acceptance tests and the checks that say the tool is done. Refactoring with characterization tests takes an untested legacy script: first a read-only survey, seams and characterization tests that pin down what it does today, bug included, then the same tests run against the old and the new code, one refactor per turn, and any fix in its own commit.
Both apply habits from Workflows, spec first and tests first above all, so the reasoning behind a step is there when you want it. No further tutorial is in our queue at the moment.
- 21
A one-paragraph spec for a coding agent: building a small CSV CLI
A method walkthrough for building a small CSV CLI with a coding agent: the spec, the prompts in order, the acceptance tests, and the checks that say it is done.
- 22
A refactor plan for a coding agent: pin the behaviour with tests first
Tests first, then structure: pin a legacy script's behaviour with characterization tests, run them against old and new code, one refactor per turn.