Skip to content

Vol. X · Field Operations · X.8

Spec-Driven Development

Write the contract before the agent writes the code: a spec, an interface, a failing test, a rubric. The agent fills a shape you can verify. 'Build me X' with no shape is a wish, not a task.

6 min read

Doctrine

  • A task for a coding agent names the files, the tests, and the done condition.
  • MetaGPT's PRD → design → patch → QA is spec-driven with extra job titles. Steal the pipeline, skip the headcount.
  • If you cannot score it, you cannot loop it. The spec is the score.

The spec is the plan you can test

Plan mode should emit a spec, not a pep talk. The spec becomes todos, tests, and a reviewer rubric. Coding harnesses already want this; most users skip it and then blame the model. Factor 8: you own the shape of legal work.

Anti-patterns

  • A one-line wish into a 40-file refactor.
  • Generating a spec after the code to 'document' a wander.

Related