Coding agents can write code fast, but they tend to guess, drift and break what's already working
In this book, we learn to put a short, testable spec at the centre of every change, so Claude Code, GitHub Spec Kit, Kiro and OpenSpec build what you actually meant. Across each chapter with its own working example, the book will help you write specs that agents can follow, using acceptance criteria, EARS syntax, non-goals and clarification markers. The full specify, plan, tasks and implement loop will run in each tool.
As you go along, you'll be specifying architecture, data models, OpenAPI contracts, screens, accessibility, time zones and security before any code exists. Then, you'll show the code matches the spec using traceability matrices, Cucumber scenarios, property tests, mutation testing and merge gates. You'll be responsible for carrying specs into production as Kubernetes manifests, SLOs, alerts, runbooks and release notes. Finally, you'll be able to recover specs from an untested legacy module, lock its behaviour with golden tests and change it safely with delta specs, parity tests and the strangler fig pattern.
Key Learnings
Write acceptance criteria in EARS syntax that both agents and tests can check.
Run the specify, plan, tasks and implement loop with Spec Kit and Claude Code.
Choose requirements-first or design-first specs in Kiro, backed by steering files and hooks.
Specify architecture decisions, data invariants and OpenAPI contracts before coding.
Turn user journeys, screen states and accessibility rules into tests a real browser runs.
Model threats with STRIDE and capture roles, abuse cases and data retention in specs.
Trace requirements to tests using Cucumber scenarios, property tests and mutation testing.
Derive Kubernetes manifests, SLOs, alerts and runbooks from a single operations spec.
Recover specs from legacy code with subagents, characterization tests and expert review.
Change legacy code safely using OpenSpec delta specs, golden-file diffs and parity testing.