What is spec-driven development?
Definition
Spec-driven development is a way of building software in which a written, reviewed specification of behavior is the main artifact. A coding agent or a developer turns the spec into a plan, tasks and code, and tests derived from its acceptance criteria show whether the code still does what the spec says.
Why is spec-driven development back now?
Writing down what the software should do before building it is old practice: test-driven development, behavior-driven development and API design-first all start there. What changed is who reads the spec. A coding agent fills gaps in a request with guesses, and it can produce code faster than a reviewer can read it. A reviewed spec gives the agent fewer gaps to guess at and gives the reviewer something to check the diff against.
A practitioner paper from January 2026, Spec-Driven Development: From Code to Contract in the Age of AI Coding Assistants (Piskala, submitted to AIWare 2026), describes the shift as treating specifications as the source of truth and code as "a generated or verified secondary artifact". Our agentic engineering guide covers the wider practice of supervising agents; this page covers the spec part in detail.
What are the levels of spec-driven development?
The same paper separates three levels of rigor. Most arguments about spec-driven development are really arguments about which level a team means.
| Level | What people edit | What happens to the spec after the code ships | Where it fits |
|---|---|---|---|
| Spec-first | The spec, then the code | It may be dropped or allowed to drift | Prototypes, one-off features, a first pass with an agent |
| Spec-anchored | The spec and the code, together | It stays current; tests derived from it fail when the two drift | The paper calls it the sweet spot for most production systems |
| Spec-as-source | Only the spec | Code is regenerated from it and never edited by hand | Domains with mature code generation, such as OpenAPI server stubs or Simulink models |
The paper's examples of spec-anchored work need no AI at all: Cucumber scenarios that run as tests, or an OpenAPI file checked by contract tests. It names Tessl as a tool that aims to bring spec-as-source to general software.
How do GitHub Spec Kit and Kiro run the process?
Piskala's paper names both GitHub Spec Kit and Kiro, and both publish detailed docs. By default both expect a person to review each phase before the next one starts.
| GitHub Spec Kit | Kiro (from AWS) | |
|---|---|---|
| What it is | Open source toolkit plus the specify CLI, used with the coding agent you already have (GitHub Copilot in the README example) | AWS's own agent, in an IDE, CLI, web and mobile app |
| Project rules | A constitution: principles that every later phase is checked against | Steering files in .kiro/steering/ that hold project conventions |
| Feature artifacts | spec.md, plan.md, tasks.md | requirements.md, design.md, tasks.md |
| Requirement format | User stories and requirements; the tech stack stays out of the spec | EARS notation: "WHEN [condition] THE SYSTEM SHALL [behavior]" |
| Checks on the spec itself | clarify asks up to five questions; checklist writes "unit tests for your requirements"; analyze reports gaps across the three files without editing them | Analyze Requirements looks for inconsistencies, ambiguities, conflicting constraints and gaps before design |
| Checks on the code | converge compares code with spec, plan and tasks, and only appends missing tasks | Property-based tests generated from EARS requirements (IDE only) |
| Faster path | Steps such as clarify and analyze are optional | Quick Spec writes all three files without approval gates |
Spec Kit's command reference gives the full order: constitution, specify, clarify, plan, checklist, tasks, analyze, implement, converge. Only specify is strictly required before plan. You repeat implement and converge until converge finds no gaps. The latest release when we checked was v1.4.2, published November 17, 2026.
Kiro's feature specs offer two orders: requirements first, for product work where the behavior is known, or design first, when the architecture or strict non-functional limits come first. When you run all tasks, Kiro builds a dependency graph from tasks.md and runs independent tasks in parallel waves.
Example: a spec and the check that keeps code honest
You do not need either tool to try the idea. Below is a three-line spec in EARS style, the code, tests that name each requirement ID, and a script that fails when a requirement has no test or a test fails. It is our own minimal setup, not output from Spec Kit or Kiro. We ran it with Node.js 22.9.
spec.md:
# Feature: coupon codes
- REQ-1: WHEN a user enters a coupon code with spaces or lowercase letters, THE SYSTEM SHALL normalize it to uppercase without spaces.
- REQ-2: WHEN the normalized code is not 6 to 12 letters or digits, THE SYSTEM SHALL reject it with INVALID_FORMAT.
- REQ-3: WHEN the code is on the expired list, THE SYSTEM SHALL reject it with EXPIRED.
coupon.js:
const EXPIRED = new Set(["SUMMER2025"]);
export function applyCoupon(input) {
const code = input.replace(/\s+/g, "").toUpperCase();
if (!/^[A-Z0-9]{6,12}$/.test(code)) return { ok: false, error: "INVALID_FORMAT" };
if (EXPIRED.has(code)) return { ok: false, error: "EXPIRED" };
return { ok: true, code };
}
coupon.test.js (REQ-2 checks a rule over 500 random inputs instead of a few hand-picked ones):
import { test } from "node:test";
import assert from "node:assert/strict";
import { applyCoupon } from "./coupon.js";
test("REQ-1 normalizes case and spaces", () => {
assert.deepEqual(applyCoupon(" welcome 10 "), { ok: true, code: "WELCOME10" });
});
test("REQ-2 rejects bad formats, for 500 random inputs", () => {
const chars = "ab9 -_!Z";
for (let i = 0; i < 500; i++) {
let s = "";
for (let n = Math.floor(Math.random() * 16); n > 0; n--) s += chars[Math.floor(Math.random() * chars.length)];
const r = applyCoupon(s);
assert.ok(r.ok ? /^[A-Z0-9]{6,12}$/.test(r.code) : r.error === "INVALID_FORMAT", `input ${JSON.stringify(s)}`);
}
});
test("REQ-3 rejects expired codes", () => {
assert.deepEqual(applyCoupon("summer2025"), { ok: false, error: "EXPIRED" });
});
package.json (so Node treats the import lines as ES modules):
{"type":"module"}
check-spec.js:
// Fails when a requirement in spec.md has no test that names its ID, then runs the tests.
import { readFileSync } from "node:fs";
import { execSync } from "node:child_process";
const ids = [...readFileSync("spec.md", "utf8").matchAll(/^- (REQ-\d+):/gm)].map((m) => m[1]);
const tests = readFileSync("coupon.test.js", "utf8");
const missing = ids.filter((id) => !tests.includes(`test("${id} `));
if (missing.length) {
console.error(`No test for: ${missing.join(", ")}`);
process.exit(1);
}
console.log(`${ids.length} requirements, each has a test`);
// execSync throws, and the script exits non-zero, if any test fails.
const out = execSync("node --test", { encoding: "utf8" });
console.log(out.split("\n").filter((line) => /^# (tests|pass|fail) /.test(line)).join("\n"));
Output of node check-spec.js (exit code 0):
3 requirements, each has a test
# tests 3
# pass 3
# fail 0
Then we added a fourth requirement to spec.md ("REQ-4: WHEN a code was already used by the same account, THE SYSTEM SHALL reject it with ALREADY_USED") without a test:
No test for: REQ-4
The script exited with code 1. We also disabled the expired-code check in coupon.js, and the script exited with code 1 again, this time because the REQ-3 test failed. Run it in CI and the spec stops being a document that drifts: a requirement nobody tested, or a behavior that no longer matches, fails the build. That is the spec-anchored level from the table above.
When is spec-driven development worth it, and when is it overhead?
It pays off when a misunderstanding is expensive: features that several people or agents touch, behavior that must survive refactors, regulated or contractual rules, and any task where an agent works for long stretches without a person watching.
The paper lists where it is overkill: throwaway prototypes, solo short-lived projects, exploratory coding where you do not yet know what you are building, and simple CRUD with obvious requirements. Its rule of thumb is to use the minimum level of rigor that removes ambiguity. It also names the failure modes: specs that turn into forms people fill in to satisfy a process, and teams buried under generated plans and task lists.
What should you check before relying on it?
- A person approves the spec before the plan. The spec is the cheapest place to catch a wrong assumption.
- Every requirement has an ID and at least one test, and CI fails when one is missing, as in the example.
- Behavior changes update the spec in the same pull request. Otherwise you are back at spec-first, with a spec that drifts.
- Reviewers own the checklists, not the agent. Spec Kit's reference says implementation must not silently self-approve custom checklists; keep that rule whatever tool you use.
- Generated artifacts stay short enough to read. If nobody reads
plan.md, it is not a control.
At SDCLabs, AI agents draft specs, code, tests and reviews, and senior engineers review them and decide what ships. Our AI-enabled engineering service sets up the same loop in your repositories and CI, with test and coverage gates that check AI-drafted changes before merge. For the agent side of the loop, see agentic coding.
Sources
- Spec-Driven Development: From Code to Contract in the Age of AI Coding Assistants, arXiv (Piskala), 2026-01-30
- Spec Kit README, GitHub, 2026-11
- Agentic SDD command reference, Spec Kit Documentation (GitHub), 2026-11
- Spec Kit 1.4.2 release, GitHub, 2026-11-17
- Specs, Kiro Docs, 2026-11-12
- Feature Specs, Kiro Docs, 2026-08-04
- Steering, Kiro Docs, 2026-10-21
- Correctness with property-based tests, Kiro Docs, 2026-08-04
Frequently asked questions
What is spec-driven development in AI?
In AI-assisted coding, the coding agent works from a reviewed spec instead of a one-line prompt: requirements with acceptance criteria first, then a plan and tasks it executes. A person approves each artifact before the agent moves on.
How do you start with spec-driven development?
Pick one feature, write its requirements as testable statements with IDs, and review them with whoever owns the behavior before asking an agent for a plan. Then make CI fail when a requirement has no passing test.
Is spec-driven development worth it?
It is worth it when a misunderstood requirement costs more than writing it down. A quick test: if two engineers could build different things from your one-line request, write the spec first.
Is spec-driven development the future?
The tools are young and change fast; GitHub Spec Kit shipped release 1.4.2 on November 17, 2026. The habit underneath them, testable requirements agreed before code, is older than AI coding and does not depend on any one tool.
Read next
Related terms
Mykhailo PoliarushFounder and CEOLeads SDCLabs, an AI development company founded in Krakow in 2011.LinkedInGitHub