Fire In Belly

Spec Driven Development for Internal Tools and AI Workflows: How Much Spec Each Change Needs, and Who Writes It

15 min read

A person drafting on a large sheet of paper with a scale ruler and a rolled plan on a wooden desk

Most internal tools are now at least partly written by AI coding agents. Someone in operations asks for a change to the approvals tool, an engineer or a vendor describes it to Claude Code, Copilot, Cursor, or Kiro, and working code comes back within the hour. Spec-driven development is the practice of writing down what the change should do before the agent starts, so that the agent and the people reviewing it work from the same contract.

The idea is sound, but teams tend to apply it badly. They either skip the spec and discover a week later that the agent guessed wrong about a business rule, or they adopt a full spec workflow for every change and drown in generated markdown nobody reads. This guide is for the operations lead, engineering lead, or AI program owner at a 50 to 1,000 person company who has to decide how much spec each change gets, who writes which part, and what happens to the spec after the change ships.

The short answer

  • Not every change needs a spec. Size it by how hard the change is to undo and what it touches.
  • Split every spec into two parts. The business owner writes the outcome, the non-goals, and worked examples. The engineer owns the plan and the tasks.
  • Turn the worked examples into failing tests before the agent writes code.
  • Decide on day one whether specs are disposable or maintained. If they are maintained, keep one current description of how the tool behaves, not a growing pile of feature specs.
  • If the tool calls a model, the spec also needs evaluation cases, because a passing test suite does not tell you the model's answers are still right.

What spec-driven development is, and why it showed up now

GitHub put the idea plainly when it released Spec Kit: you start with a spec that acts as a contract for how the code should behave, then a plan, then small tasks, and you verify at each step rather than reviewing a thousand-line dump at the end (GitHub Blog on Spec Kit).

Amazon's Kiro builds the same shape into its editor. Every spec produces a requirements file (or a bugfix file that records current, expected, and unchanged behaviour), a design file, and a task list, and there is a Quick Spec mode that generates all three in one pass without approval gates for well-understood features (Kiro specs documentation). IBM describes a spectrum: a spec written once to start the work and then left to go stale, a spec kept up to date as the system changes, and a spec that is the only thing humans edit while code is regenerated from it (IBM on spec-driven development). Birgitta Böckeler of Thoughtworks calls these spec-first, spec-anchored, and spec-as-source, and notes that every tool she looked at is spec-first, while what happens to the spec afterwards is often left vague (Böckeler on martinfowler.com).

It showed up now because a coding agent fills every gap in a request with a plausible guess. A person who sat in the meeting filled those gaps with your company's answer. An agent fills them with the likely answer, which often isn't yours.

Where it goes wrong in practice

Böckeler asked Kiro to fix a small bug and got 4 user stories with 16 acceptance criteria. Working with Spec Kit she found many repetitive markdown files and wrote that she would rather review code than all of them. She also saw agents ignore instructions that were in the spec, and warned that the files can give a false sense of control (Böckeler on martinfowler.com).

Colin Eberhardt at Scott Logic rebuilt a feature of a hobby app with Spec Kit and logged the cost. Across the first feature the run took 33 and a half minutes of agent time, produced 2,577 lines of markdown for 689 lines of code, and needed about 3.5 hours of review. His usual loop of small prompts and immediate review did the same work in about 8 minutes of agent time and 15 minutes of code review, and he estimated he was around ten times faster without the spec workflow (Scott Logic's Spec Kit experiment). That is one person on one app, not a general rate, but it shows where the time goes.

The Thoughtworks Technology Radar placed spec-driven development in its Assess ring in November 2025 and warned that the workflows are elaborate and opinionated and produce spec files that are hard to review (Thoughtworks Radar). Practitioners keep making the same comparison: feeding a perfect spec into an automated software factory looks a lot like waterfall again (rockwotj on X).

The quieter problem is drift. In a long-running Spec Kit issue, users describe per-feature specs going stale as later features change earlier behaviour. One contributor reported that a later spec silently invalidated a safety control promised by an earlier one, and that the gap survived three rounds of review. Another consolidated 17 feature specs from a real project and found 70 user stories collapsed to 45 once duplicates and rewrites were removed, concluding that per-feature specs work like a change log, not a description of the system (spec-kit issue 620). These are author reports.

The idea still works when the ceremony matches the change, the spec is written by someone who knows the answer, and someone decides what the spec is for after release.

Size the spec to the risk of the change

The most common mistake is to apply one workflow to every change. The fix is a sizing rule your team agrees on before the next request comes in. Size the spec to how hard the change is to undo and how much it touches, not to how big it looks, so a one-line change to an approval rule gets more spec than a new report screen.

This is our recommendation rather than an external finding. The sources above all report that full workflows are too heavy for small changes, and IBM's test is that a spec has gone too far when refining it costs more than fixing the misunderstanding it prevents (IBM on spec-driven development). In an internal tool, the size of the code change is a poor guide to that cost. A new dashboard tile is a lot of code and easy to remove. Changing who can approve a refund is one line and can cost real money before anyone notices.

Kind of changeExamplesSpec levelWho signs off
Cosmetic or easily reversedLabel text, column order, a new read-only reportNone. A clear request and normal code reviewEngineer
Behaviour change inside one toolNew field, new filter, changed validation messageShort spec: outcome, non-goals, three to five examplesBusiness owner and engineer
Rules, money, permissions, or data leaving the toolApproval thresholds, payment steps, access roles, a new integrationFull spec with design notes and a review gate before implementationBusiness owner, engineer, and whoever owns the risk
Changes to a step that calls a modelNew prompt, new model, new tool the agent can callShort or full spec plus evaluation casesBusiness owner and the workflow owner

Bug fixes deserve a note of their own. Kiro's bugfix spec asks for current behaviour, expected behaviour, and behaviour that must not change (Kiro specs documentation). Most bug fixes in internal tools need no spec, but the ones that touch rules or permissions should at least name what must stay the same, because an agent will not protect behaviour nobody told it to keep.

If you are unsure which row a change belongs in, put it in the higher one.

Split the spec: the business owns the what, engineering owns the how

Generated specs are long because the agent writes them, expanding a two-line request into stories and assumptions nobody in the business reads. Eberhardt noticed the agent inventing plausible background reasoning that had no real basis (Scott Logic's Spec Kit experiment), and Böckeler asked who the generated user stories were actually for (Böckeler on martinfowler.com).

For an internal tool, the person who knows whether the behaviour is right is the operations owner: the finance lead, the head of support, the person who runs the process. They are rarely the person reading the plan. So split the spec. Have the business owner write and sign off the outcome, the non-goals, and a handful of worked examples, then turn those examples into failing tests before the agent writes code, and leave the plan and tasks to the engineer.

The business part should fit on one page:

  • Outcome. What should be true after the change, in the words the team uses.
  • Non-goals. What this change must not do or touch. IBM's example spec has an explicit out-of-scope list for the same reason (IBM on spec-driven development).
  • Worked examples. Three to five concrete cases with inputs and the expected result, including at least one awkward case.
  • Approval and checks. Who checks the result, when a human must approve, and how you will notice if behaviour drifts later. One practitioner argued that a spec at scale should spell out exactly this (RussBartels on X).

The engineer then owns the plan, the tasks, and the choice of tool. GitHub's own description of Spec Kit separates the stable "what" from the flexible "how" in the same way (GitHub Blog on Spec Kit).

The worked examples are the part of the spec that can become tests. Before the agent implements anything, the engineer turns each example into a failing test, and the agent's job is to make them pass without editing them. One practitioner describes exactly this loop: every acceptance criterion becomes a failing test, the tests are locked, and the agent iterates against them (ArgileNoland on X). It also answers the problem Böckeler saw of agents ignoring parts of the spec. An agent can skip a sentence in a markdown file, but a failing test shows up in the build.

Keep those tests after the change ships and rerun them on every later change, as described in our guide to AI workflow regression testing.

Decide whether specs are kept before you write the first one

The second decision most teams skip is what happens to a spec after the change ships. Decide before the first spec whether specs are thrown away after the change ships or folded into one maintained description of current behaviour, because per-feature specs pile up like a change log and later ones quietly override earlier promises.

Either choice works. The trouble comes from never making one. IBM describes the options and the hybrids teams actually use, such as treating specs as dated decision records or keeping the issue tracker as the source of truth (IBM on spec-driven development). Böckeler found that most tools leave the maintenance strategy open (Böckeler on martinfowler.com). The Spec Kit issue thread shows the cost of drifting into a third option by accident: a folder of feature specs that each describe a moment in time, read by an agent as if all of them were still true (spec-kit issue 620).

A workable rule for most internal tools:

  1. Disposable by default. Short specs for behaviour changes live in the ticket or pull request and are not kept as instructions for future agents. The tests they produced are kept.
  2. One maintained behaviour document per tool. For tools that handle rules, money, or permissions, keep a single file that describes how the tool behaves today: who can do what, which rules apply, and what it must never do. A named owner updates it as part of any change in the top two rows of the sizing table.
  3. Agents read the behaviour document, not the history. When an agent works on the tool, it gets the current behaviour document and the relevant tests. Old feature specs are history, not instructions.

This guards against the failure in the issue thread, where an earlier safety promise disappeared. If the promise is in the behaviour document and covered by a test, a later change cannot remove it without someone editing that document or that test on purpose.

A short spec template for an internal tool

Here is a template for a change that involves money and permissions. It is deliberately short. If a spec like this grows past a page, split the change into smaller ones.

## Change: Refund approval threshold for support leads

Owner (business): Head of Support
Owner (engineering): Platform engineer on the tools team
Spec level: Full (money and permissions)

Outcome
Support leads can approve refunds up to 500 EUR without finance.
Above 500 EUR the refund goes to the finance queue as today.

Non-goals
- No change to who can create a refund request.
- No change to refunds already in the finance queue.

Worked examples
1. Lead approves 499 EUR refund: approved, no finance step.
2. Lead approves 500 EUR refund: approved, no finance step.
3. Lead approves 501 EUR refund: routed to finance queue.
4. Agent (not lead) tries to approve 100 EUR: rejected, as today.
5. Lead approves two 300 EUR refunds for the same order: second one
   routed to finance (order total over 500 EUR).

Must stay the same
- Audit log entry for every approval, with approver and amount.

Checks
- Examples 1 to 5 are failing tests before implementation.
- Head of Support reviews the first week of approvals in the audit log.

Example 5 is a case the business owner would think of and an agent probably would not, which is why the business owner writes the examples.

When the tool itself calls a model

Many internal tools now include a step that calls a model: summarising a ticket, classifying an invoice, drafting a reply. A spec for that step needs something a normal spec does not, which is a set of evaluation cases. A test that checks the code ran is not enough when the output is generated text that can change with a new prompt or model version.

For these steps, add to the worked examples a small labelled set of real inputs with the answer the business owner accepts, and rerun it whenever the prompt, the model, or the tools change. Our guides to AI workflow regression testing and the AI production readiness checklist cover how to build and gate on that set. Put the evaluation cases in the spec from the start, written by the same business owner, rather than adding them after the first complaint.

When a vendor or consultant builds it

The same rules apply when someone outside the company is driving the coding agent. Ask for the sizing rule in writing before work starts, keep the business part of each spec on your side, and require the failing tests to be delivered with the code. If the vendor maintains the behaviour document, agree that it is yours at handover. Our guide to build versus buy for custom AI software covers the wider decision.

A worked example

A 300 person logistics company has an internal tool for carrier claims, built and extended with a coding agent by a two-person tools team. In one month the operations lead asks for four changes: rename a status, add a filter for claims over 30 days old, let regional managers close claims under 200 EUR without head office, and use a model to draft the first reply to a carrier.

Under the sizing rule, the rename gets no spec. The filter gets a short spec with three examples, written by the operations lead in ten minutes. The closing rule is a permission change involving money, so it gets the full template, a review gate, and an update to the tool's behaviour document. The drafted reply calls a model, so it gets a short spec plus twenty real past claims with replies the operations lead marks as acceptable, rerun every time the prompt changes.

Almost all of the spec time goes to the two changes that could hurt.

How to tell if it is working

Check these after a month:

  • You can sort the last ten changes into the sizing table and the spec each one got matches its row.
  • Every spec in the top two rows names a business owner who wrote the examples and approved the outcome.
  • Every worked example exists as a test, and the tests were committed before the code that made them pass.
  • Each tool that handles rules, money, or permissions has one current behaviour document with a named owner and a recent update date.
  • Steps that call a model have evaluation cases in their spec and a record of the last run.
  • Review time per change has gone down for small changes, not up.

If the last check fails, the ceremony is too heavy for the change. Move more work into the lower rows.

What to do next

Take the last ten change requests for one internal tool and sort them into the sizing table. For the two riskiest, have the business owner write the outcome, non-goals, and worked examples on one page, and have the engineer turn the examples into failing tests before the agent starts. Then decide, in writing, whether that tool's specs are disposable or maintained. If you want help setting this up for the tools your team is building, our internal tools and AI workflow automation work starts there, and an AI audit can review how your current changes are specified and tested.


About Fire In Belly: Independent senior engineering from Tallinn, Estonia. We design and build internal tools, AI workflow automation, and custom AI agents with the right-sized specs, worked examples turned into tests, and maintained behaviour documents described above, at published fixed prices. Schedule a call to discuss your next project.