Insights / Worked example / Spec-driven delivery

What spec-driven development looks like with agents

A worked example of how we turn a vague request into shipped software when AI agents do much of the drafting. The pattern is simple: write down what "done" means first, let agents propose small changes against it, and make every change answer to the spec in review.

Scenario
Adding approval routing to an existing internal operations app
Format
Worked example, not a named client
Approach
Spec first · small changes · tests as the contract
Team
VentureChex engineers with AI agents

The starting point

The request arrived the way most requests do: one line in a ticket. "Orders over a certain value should need a manager's sign-off." Everyone in the room nodded, and everyone in the room imagined something slightly different.

With agents on the team, that gap gets expensive faster. An agent will happily turn an ambiguous sentence into a lot of confident code in a few minutes. The speed is real, which is exactly why the ambiguity has to be settled before the typing starts.

The problem

The ticket is not the requirement

One sentence hid a dozen decisions: what counts as "value", who the manager is when someone is away, what happens to an order while it waits.

Big diffs nobody can review

Left alone, an agent will produce one large change touching many files. It may be right, but no reviewer can honestly confirm that.

Intent drifts between steps

By the time the code exists, the original reasoning is scattered across chat threads, and the tests only check what the code already does.

"Done" is a feeling

Without written acceptance criteria, finishing means the demo looked fine, and the edge cases surface in production.

The goal

Every change traces back to a written requirement, is small enough to review in minutes, and is checked by tests that were written from the spec and not from the code.

How we did it

01

Interrogate the request

Before any code, an agent reads the existing app and the ticket, then lists the questions the ticket does not answer. Engineers answer them with the person who asked. The answers are the raw material for the spec.

02

Write the spec

A short, plain document: the behaviour in examples ("an order of X by this role goes to that approver"), the edge cases, what is explicitly out of scope, and how we will know it works. It lives in the repository next to the code.

03

Turn the spec into tests

Acceptance criteria become failing tests before the feature exists. This is the contract. Agents write the test scaffolding; engineers read it against the spec to make sure it checks the right thing.

04

Plan in small steps

The agent proposes a sequence of small changes, each one independently reviewable and each one moving a named test from red to green. Engineers reorder or reject steps before any are built.

05

Build and review one step at a time

Each step is drafted by an agent, run against the tests, and reviewed by an engineer with the spec open beside the diff. Anything the code does that the spec does not mention is a question, not a bonus.

06

Close the loop

When behaviour has to change, the spec changes first and the tests follow. The spec stays true, so the next person, or the next agent, starts from facts and not folklore.

The loop, end to end

RequestONE-LINE TICKETSpecEXAMPLES · EDGESTestsFAIL FIRSTSmall stepsONE NAMED TESTReviewSPEC BESIDE DIFFWHEN BEHAVIOUR CHANGES: THE SPEC CHANGES FIRST, THEN THE TESTS

Agents and engineers

Agents did
  • Surfaced the unanswered questions hiding inside the ticket
  • Drafted the first version of the spec from the answers
  • Wrote test scaffolding from the acceptance criteria
  • Proposed the sequence of small changes and drafted each one
  • Flagged places where code behaviour and spec had drifted apart
Engineers decided
  • Which questions mattered and what the business actually wants
  • What is in scope and what is deliberately left out
  • Whether each test really checks the requirement it claims to
  • The order of changes and where to stop and ship
  • Approval of every step before it was merged

The outcome

Reviews that mean something

Small changes tied to a named requirement can be read, understood and approved in a sitting, not skimmed.

Fewer surprises late

Most of the ambiguity surfaces in conversation on day one, when it is cheap, and not in testing, when it is not.

A record of why

The spec explains what was intended and why. New people and new agents have something true to read.

Speed you can trust

Agents still do the bulk of the typing. The difference is that the speed is pointed at something written down and agreed.

What we would tell the next team

  1. 01

    Spend the first hour on questions, not code.

    The cheapest bug to fix is a misunderstanding caught in a conversation.

  2. 02

    Write tests from the spec, not from the code.

    Tests derived from the implementation only prove that the code does what the code does.

  3. 03

    Keep each change small enough to hold in your head.

    If a reviewer cannot explain a change back, it is too big to approve.

  4. 04

    Treat the spec as a living file.

    When the requirement moves, change the spec first. A stale spec is worse than none.

Have a requirement that keeps changing shape on the way to code?