SDD: specification -> DoR -> conformance as an engineering operating contract

Spec-Driven Development connects business, product, and engineering through a specification, Definition of Ready, and automated implementation conformance checks.

Context

“We use AI code generation” = “we write code faster.”

“We use AI code generation responsibly” = “we write code faster, and it matches what we wanted to get.”

The difference is in three artifacts:

  1. Specification - a formal description of behavior, contracts, invariants.
  2. DoR - task readiness criteria, including the presence of a spec.
  3. Conformance - an automated check that implementation matches the spec.

Signals that you need SDD

  • AI generates code that “seems to work,” but fails edge cases in production.
  • Code review turns into a discussion of “what were we trying to build at all.”
  • Juniors and AI agents write code in different styles, without a shared understanding of the contract.
  • Postmortems regularly contain the phrase “the requirement was ambiguous.”
  • There are 3-4 round trips between scope clarification and development start.

Three levels of SDD

Level 1: Specification

A spec is not a “40-page technical assignment.” It is:

  • Scenarios in given/when/then form for main flows.
  • API contract with types, errors, idempotency.
  • Invariants - what must remain true before and after the operation.
  • Non-goals - what we explicitly do not do.

The spec is written before code. If it cannot be written, the task is not ready.

Level 2: Definition of Ready

DoR is a checklist that says “this task is ready to enter the sprint.” Minimum:

  • The spec is written and released in Notion or the repo.
  • Acceptance tests are derived from the spec 1:1.
  • Dependencies: other teams, external APIs, migrations - identified.
  • The business/product owner confirmed scope.
  • Non-goals are captured.

Without completed DoR, the task does not enter work. This removes 80% of “what were we doing at all.”

Level 3: Conformance

Conformance is automated alignment checking:

  • Property-based tests for invariants.
  • Contract tests for APIs against the spec, for example through OpenAPI + Schemathesis.
  • Snapshot tests for key scenarios.
  • AI reviewer attached to the spec through agents.md or steering files.

Conformance runs on every PR. If it does not pass, it does not merge.

What breaks at scale without SDD

SizeWithout SDDWith SDD
3-5 engineersYou can live on verbal agreements, but edge cases leak to productionModerate benefit: capture a spec for disputed cases and external APIs
5-10 engineersRequirements in Slack, rework on every second taskDoR cuts about 70% of rework without bureaucracy
10-15 engineersHalf of PRs are scope debatesSpec + DoR close 80% of disputes
10-15 engineers + AI agentsAgents hallucinate scopeAgents are constrained by the spec and produce conformant code
50+ engineersRefactorings break implicit contractsProperty-based + contract tests keep the surface stable

How to start using this

  1. Choose one new feature. Write its spec: 1-2 pages, given/when/then + contract.
  2. Create a DoR checklist. Apply it to this one feature.
  3. Generate acceptance tests from the spec. Run them in CI.
  4. After release, compare this feature’s postmortem metrics with the average.
  5. If the difference is tangible, scale to the next team.

Metrics

  • Percentage of tasks that pass DoR on the first iteration. Target: 70%+.
  • Average number of “product -> engineering” round trips before work starts. Target: 1.
  • Percentage of bugs caught by conformance tests before production. Target: grows over time.
  • Time-to-PR for AI agents with access to the spec. Target: falls.

FAQ

SDD slows down the start of work. How do we sell it to the team?

SDD moves work left: time goes into the spec before code instead of iterations of "wrote it -> rewrote it -> fixed it." After 2-3 sprints, total feature time falls.

Can we use AI to generate the spec?

Yes, but carefully. AI is good at turning a draft into formal given/when/then. AI is poor at guessing which invariants matter in your domain. Use AI as a secretary, not as the author.

What do we do with old code without specs?

Do not do it retrospectively. Specs are written for new code and for areas that are actively changing. Covering legacy with specs means spending a quarter documenting what already works.

How does conformance combine with fast experiments?

Conformance applies to features in production. Experiments live in a feature-flag branch with relaxed requirements: a basic contract without property tests.

Keep reading

AI-ready SDLC 8 min

The Loop Engineering Wall: What Cannot Be Looped in Software Development

Loop engineering automates execution, not authorship: a loop pursues a supplied goal but cannot choose that goal or decide when it should change.

Compare the operating contract with the limits of loop automation.

AI-ready SDLC 17 min

AI evals for CTOs: a 3-step recipe for AI features in product and AI tooling in delivery

Three eval loops for AI features, AI tooling, and agentic/MCP workflows: capture layer, golden set, grader in CI, and vendor-drift detection.

Continue from requirements to evaluating AI feature outcomes.