Guide

Spec-Driven AI Development: Make Your Agents Accountable

Before an agent writes a line of code, it needs a written plan. Specs turn chaotic AI output into bounded, reviewable engineering, and in AIDEN, approving one is an enforced gate.

By Kylian Migot · Updated July 2026 · 6 min read

Quick answer

A spec is a written, bounded plan, scope, files, acceptance criteria, exclusions, that an agent implements against. In AIDEN, the AI drafts the spec from your story card and you approve it before any code is written, a gate enforced since v1.5.21.
A spec contains
Scope, files to touch, acceptance criteria, what must not change
Who writes it
AIDEN's AI drafts it from your story card; you edit and approve
Enforced gate
No agent codes without an approved spec (since v1.5.21)
After approval
Agent implements on its own branch; PR is one click away
01

What Is Spec-Driven Development?

Spec-driven development means every task starts with a written specification, a precise, bounded description of what will change, why, and how success is measured, before implementation begins. The spec is the contract between whoever defines the work and whoever executes it. In spec-driven AI development, the executor is a coding agent, and the spec doubles as its prompt.

Without a spec, the agent must infer everything from one message: scope, constraints, affected files, definition of done. That inference is where agentic coding goes wrong, the full argument lives in our guide to engineering with AI agents.

02

Why Agents Need Specs, Not Just Prompts

Hand a bare prompt to a coding agent, in any agentic IDE, and three failure modes appear reliably:

Hallucinated scope

The agent decides which files to touch and how deep to go. “Add user authentication” could mean 3 files or 30, depending on what the model finds reasonable. You find out after the fact.

Collateral damage

Without explicit boundaries, a refactor leaks into the payment module or a UI change reorganizes an API route. The diff becomes unreadable.

Unreviewable PRs

With no written intention to compare against, review means re-reading the whole diff cold. Most people skim and merge, which is when bugs ship.

A spec fixes all three: it names the files in scope, states the acceptance test, and lists what must not change. It also enables parallelism, agents running simultaneously need bounded, non-overlapping scopes, and leaves an audit trail. Six months later, the spec attached to a merged PR tells you exactly what was decided and why. A chat log rarely can.

Ship your first agent today

Download AIDEN free and point it at your existing Claude Code or Codex setup. No credit card, running in minutes.

Download AIDEN free

Free to start · macOS 12+ · No credit card required

03

How AIDEN's Spec Flow Works

AIDEN runs spec-driven development as a board workflow: cards move through Stories → Spec Review → In Progress → Review → Done. Four steps take a plain-English idea to a reviewable pull request:

  1. 1

    Write a story card

    One or two sentences on the board. For example: “Add email/password authentication. Users can sign up, log in, and log out. Use JWT tokens in httpOnly cookies.”
  2. 2

    AI drafts the spec

    AIDEN reads your story and its analysis of the codebase, then drafts a full spec: exact files to create or modify (src/lib/auth.ts, src/app/api/auth/login/route.ts), acceptance criteria (valid login returns 200 with a set-cookie header; invalid credentials return 401), an exclusion list (the User schema, the /api/payments routes), and example request/response shapes.
  3. 3

    You approve: the enforced gate

    The card sits in Spec Review until you act. Edit anything that is too broad or missing a constraint, then approve. Since v1.5.21 this gate is enforced: no agent starts coding without an approved spec.
  4. 4

    The spec becomes the agent's prompt

    AIDEN opens a git worktree on a new branch and launches your Claude Code or Codex CLI with the approved spec as its working prompt. The agent can run your tests and iterate, a best-effort convention explained in the AI agent harness, and when it is done, the PR is one click away, spec attached as the description.

AIDEN is not alone in this bet: AWS's Kiro is also built around specs as the unit of work, see how the two compare in AIDEN vs Kiro.

04

Writing Good Specs for AI Agents

Whether AIDEN drafts the spec or you write it yourself, five rules determine whether the agent produces useful output or a mess:

  1. 1

    Be specific about scope

    “Add authentication” is not a spec. “Add email/password sign-up and login to the existing Express server in src/server.ts, using bcrypt for hashing and JWT for session tokens” is. Vague scope produces vague code.
  2. 2

    Name the files and functions involved

    List the files the agent should create, modify, or read. If a specific function needs to change, name it. This kills the hallucinated-scope failure mode, the agent cannot touch what is not on the list.
  3. 3

    Define the acceptance test

    Write a concrete, verifiable success condition: “/api/auth/login returns 200 and a set-cookie header with an httpOnly JWT for valid credentials, and 401 with an error message for invalid ones.” A testable assertion gives the agent something to verify its work against before you ever see the diff.
  4. 4

    Say what NOT to change

    Explicitly list what must stay untouched: “Do not modify src/lib/stripe.ts, the User database schema, or any API route outside /api/auth/.” Often the most valuable part of the spec, it is what prevents collateral damage.
  5. 5

    Include example inputs and outputs

    For anything that handles data, show a concrete example: a sample request body, a response payload, an example SQL row. Agents are far more accurate matching a concrete example than interpreting an abstract description.
05

Spec-Driven vs Prompt-Driven, Side by Side

Across the dimensions that matter for production software:

DimensionPrompt-drivenSpec-driven (AIDEN)
Scope controlAgent decides on its ownExplicitly bounded by the spec
ReviewabilityDiff vs a chat messageDiff vs written acceptance criteria
Parallel agentsRisky, scopes overlapSafe, bounded scope + isolated branch
Collateral damageCommonPrevented by the exclusion list
AuditabilityChat log, if you kept itSpec stored with the PR
Definition of doneImplicit and subjectiveConcrete acceptance test in the spec

FAQ

What is a spec in AIDEN?
A spec in AIDEN is a structured document generated from a story card. It defines the task scope, the files to create or modify, the acceptance criteria, and what the agent must not touch. Once approved, the spec becomes the agent's prompt, the contract between you and the agent before any code is written.
Do I write specs manually?
No. You write a short story card, a sentence or two describing what you want, and AIDEN's AI drafts the full spec from your story and its analysis of your codebase. You review, edit anything that looks off, and approve. You can always rewrite parts of a spec by hand when the task calls for it.
Is the spec approval step optional?
No. Since v1.5.21, spec approval is an enforced gate in AIDEN: no agent starts coding until you have approved the spec for its story. Alongside git isolation (one branch or worktree per story), it is one of the two hard guarantees in the workflow.
Does AIDEN automatically run my tests and open a PR after approval?
Not automatically. After approval the agent implements on its own branch, and AIDEN's conventions push it to run your test suite and iterate on failures, but that is best-effort, not a guarantee. An optional LLM review pass can check the diff against the spec, and opening the PR is a single click from the story card, with the spec attached as the description.
How long does spec review take?
Usually a couple of minutes. AIDEN generates the draft in seconds; you skim the scope, acceptance criteria, and exclusion list, adjust what is off, and approve. For larger stories it is worth slowing down, two extra minutes on the spec routinely saves an hour of re-review on the diff.

Keep reading

Ship with specs, not vibes.

AIDEN drafts specs from your story cards, gates every agent behind your approval, and puts the PR one click away. Free for one project.

macOS 12+ · Bring your own Claude Code or Codex · Your code stays local