Methodology · Spec-Driven

Spec-Driven Development

Make the specification, not the code, the source of truth so an AI agent implements against a settled, reviewable description.

Description

Write the spec first and treat it as the source of truth; the code is what the agent generates from it. Start with a short constitution of standing principles, then specify what to build, plan how to build it, break the plan into agent-sized tasks, and only then let the agent implement. When requirements change you change the spec, not the code, and regenerate.

When to apply

Use this when an AI coding agent does the bulk of the implementation and you want control over what it builds. It fits greenfield features and well-scoped changes where the requirements can be pinned down up front. Don't apply it to pure exploration where you do not yet know what you want.

What it involves

  • Write the constitution
  • Specify the feature
  • Plan the technical approach
  • Break into agent-sized tasks
  • Let the agent implement
  • Re-spec on change

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related