Spec-Driven Development Explained: From “Prompt and Pray” to “Spec and Steer”

1. Where the Problem Begins

As coding agents have become more capable, a pattern has emerged: you describe a goal and receive a large amount of code that looks approximately right—but is not quite right. This “vibe coding” approach is excellent for rapid prototypes but unreliable for serious, critical applications.

The 2025 Stack Overflow Developer Survey, covering more than 90,000 developers, found that 66% named “almost right, but not quite” as their greatest frustration with AI tools, while 45% said they spend substantial time debugging AI-generated code.[1]

The problem is not the Agent’s coding ability; it is the input we give it. We treat a coding Agent like a search engine, but it is really an extremely literal pair programmer. It excels at pattern matching but needs clear, unambiguous instructions.

2. Core Definition

Spec-Driven Development treats the specification, not the code, as the source of truth. AI performs far better on structured tasks than on open-ended prompts.[2]

In a spec-driven workflow, the specification drives implementation, testing, and task decomposition. You do not begin writing code until the specification has been validated.[3]

In one sentence: do not ask AI to write code first. Ask it to write a specification, verify that the specification is correct, and then have it implement that specification.

3. Comparison with Vibe Coding

Vibe CodingSpec-Driven Development
InputAmbiguous natural-language promptStructured specification document
Time of validationProblems are discovered only after seeing codeProblems are discovered in the specification before code is written
Cost of changesChange code, which is expensiveChange the specification, which is inexpensive
ReproducibilityLost when the prompt is lostThe specification persists in the repository
Team collaborationDepends on individual prompting skillThe specification is a shared contract

A concrete example illustrates the difference. A vibe-coding prompt is “Build a rate limiter middleware for Express.” A spec-first prompt is “Implement the rate limiter defined in .spec/features/rate-limiter.md, which specifies a sliding window algorithm, 100 requests per minute per API key, 429 responses with Retry-After headers, and Redis-backed state for horizontal scaling.” The second approach leaves no room for the Agent to improvise. Decisions that belong to you are not delegated to the Agent.[4]

The key insight is that both approaches often consume roughly the same total time; they differ in where that time is spent. Vibe coding spends time repeatedly revising code after generation. SDD spends time writing the specification before generation. The specification is reusable and remains useful as documentation after delivery.[4]

Traditional development locks you into early decisions, whereas spec-driven development makes changing direction straightforward: update the specification, regenerate the plan, and let the Agent handle the remaining work.[5]

4. The Four-Stage Workflow

GitHub’s Spec Kit and Addy Osmani’s guide describe essentially the same four-stage model.

Phase 1: Specification

Begin with a high-level prompt, such as “Build a web app where users can track tasks, with user accounts, a database, and a simple UI.” The Agent responds with a structured draft specification containing an overview, feature list, technology recommendations, data model, and so on. This specification becomes the source of truth that both you and the Agent can consult.[3]

A specification is neither a PRD nor an SRS, but a combination of both. Writing it like a PRD ensures that you include user-centered context—the “why” behind each feature—so AI does not optimize in the wrong direction. Extending it like an SRS ensures that you pin down the concrete details AI needs to generate the correct code, such as the database and API to use.[3]

A specification normally includes goals and motivation, user stories, testable acceptance criteria, technical constraints, explicit non-goals, and integration points.

Phase 2: Plan

Ask the Agent to read requirements.md and produce plan.md, a technical implementation plan mapping requirements to design decisions. The crucial point is that you still have not asked it to write code.[1]

The plan answers “how to implement it”: file structure, module decomposition, API design, data model, and dependency choices.

Phase 3: Tasks

The coding Agent decomposes the specification and plan into actual units of work: small, reviewable pieces, each solving one concrete subproblem. Every task should be independently implementable and testable, much like applying TDD to an AI Agent. Instead of “build authentication,” use a concrete task such as “create a user registration endpoint that validates email format."[3]

Phase 4: Implement

The Agent processes tasks one at a time or in parallel. Instead of reviewing a dump of thousands of lines, however, you review focused changes that solve particular problems. The Agent knows what to build because the specification tells it, how to build it because the plan tells it, and what to work on now because the task tells it.[5]

At every stage, your role is not merely to direct but to validate: Does the specification capture what you truly want? Does the plan account for real constraints? Are there edge cases AI omitted?

5. Why Spec-Driven Development Matters More in the AI Era Than in Traditional Development

In traditional development, when a specification is incomplete, a human developer can debug and adapt during implementation. If the authentication service needs a different approach or a package version introduces a breaking change, a person can respond flexibly.

AI agents currently lack that level of adaptive debugging and research. They execute a specification literally, and incomplete research can snowball into implementation failure.[6]

Another key point is that AI-assisted development greatly increases the cost of ambiguity. When an AI Agent participates, unclear intent does not merely slow progress; it actively creates risk. A specification is no longer a helpful suggestion but a constraint.[7]

6. The Specification as a Living Document

Make the specification a living document; do not write it and forget it. Update it whenever you and the Agent make a decision or discover new information. If AI must change the data model or you decide to remove a feature, reflect that in the specification so it remains the ground truth. Treat it as version-controlled documentation.[3]

Good version-control habits matter even more in AI-assisted development. Commit specification files to the repository. This not only preserves history; the Agent can use Git diff or blame to understand changes.[3]

This directly echoes the central point of the harness article: the file system is the Agent’s persistent memory layer. The specification is one of the most important files in that layer.

7. Three Maturity Levels

An arXiv paper from early 2026 describes three distinct levels.[1] Industry practice also falls broadly into these categories:

Level 1: Spec-First—write the specification first and execute manually. This is the process defined in your AGENTS.md: clarify requirements, write a specification, confirm it, and then implement. There is no automation; the process depends on Agent discipline. This is the right starting point for most teams in 2026.

Level 2: Spec-Validated—automated specification validation. Add automated drift detection. If the implementation diverges from the specification, CI fails. Tools such as GitHub Spec Kit and Amazon Kiro belong at this level.

Level 3: Spec-as-Code—the specification is the code. This is the more radical view: the specification is the only artifact that needs maintenance, while code is an automatically generated intermediate artifact. It resembles SQL generating a query plan or Terraform generating infrastructure. This level remains experimental.

8. Today’s Tooling Ecosystem

Leading spec-driven development tools in 2026 fall into two groups: living-spec platforms that keep documentation and code synchronized while an Agent works, and static-spec tools that structure requirements in advance but require manual correction when implementation drifts.[8]

The main tools are:

GitHub Spec Kit (open source, MIT). It provides scaffolding for a spec-driven workflow through a Python CLI, has 72.7k stars, and supports more than 22 AI Agent platforms.[9] It is suitable for greenfield projects.

Amazon Kiro. It implements spec-driven development using EARS (Easy Approach to Requirements Syntax) and integrates deeply with the AWS ecosystem.

AGENTS.md / CLAUDE.md with a manual process. This is what you currently do: implement a spec-first workflow with Markdown files and Agent behavior rules without depending on a particular tool. If you use a methodology-neutral tool such as Cursor or Claude Code, you need to find a workflow that suits you. The core of SDD is moving beyond vibe coding by separating design from implementation.[10]

9. Relationship to What You Already Know

Relationship to Harness Engineering. A specification is part of the harness’s Context Injection layer. It is the most important structured information injected into Agent context. A good specification directly determines the Agent’s behavior throughout the work cycle.

Relationship to the Ralph Loop. The Ralph Loop’s central prerequisite is an explicit completion criterion. Without acceptance criteria in the specification, its verification step cannot determine whether a task is truly complete. When the Ralph article says that “good Agent results come not from a smart model but from writing a good specification,” this is what it means.

Relationship to your AGENTS.md. The Spec-Driven Development section you added implements SDD at Level 1. Agent behavior rules in AGENTS.md + a specification file at specs/FEATURE_NAME.md + acceptance criteria + a confirmation mechanism form a lightweight but complete spec-driven workflow.

10. An Honest Caveat

Experienced programmers may find that overly formal specifications create unnecessary friction and slow cycles of change and feedback, much like the problems encountered in early waterfall development.[10]

Martin Fowler also points out that “neither Kiro nor spec-kit are suited for the majority of real-world coding problems."[11]

The main difficulty with SDD is not AI, but people. SDD requires developers to specify intent precisely, yet that is exactly the greatest challenge. Across more than a decade of software development, few projects have fully clarified their requirements before implementation begins.[12]

This is a real risk. SDD works best for features of moderate or greater complexity. For a one-line fix, a simple refactor, or a rapid prototype, following the entire specification process is overengineering. The intuition to know when a specification is necessary and when to act directly is itself part of engineering experience.


Sources

#SourceURL
[1]Java Code Geeks: Spec-Driven Development with AI Coding Agents (2026.03)https://www.javacodegeeks.com/2026/03/spec-driven-developmentwith-ai-coding-agents-the-workflow-replacingprompt-and-pray.html
[2]Medium: Spec-Driven Development Is Eating Software Engineering (2026.03)https://medium.com/@visrow/spec-driven-development-is-eating-software-engineering-a-map-of-30-agentic-coding-frameworks-6ac0b5e2b484
[3]O’Reilly / Addy Osmani: How to Write a Good Spec for AI Agents (2026.02)https://www.oreilly.com/radar/how-to-write-a-good-spec-for-ai-agents/
[4]DEV Community: Spec-Driven Development — Write the Spec, Not the Code (2026.03)https://dev.to/bobbyblaine/spec-driven-development-write-the-spec-not-the-code-2p5o
[5]GitHub Blog: Spec-driven development with AI (2025.09)https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/
[6]Medium: How to write PRDs for AI Coding Agents (2026.01)https://medium.com/@haberlah/how-to-write-prds-for-ai-coding-agents-d60d72efb797
[7]Medium: Spec-Driven Development with AI Agents — From Build to Runtime Diagnostics (2026.01)https://medium.com/@dave-patten/spec-driven-development-with-ai-agents-from-build-to-runtime-diagnostics-415025fb1d62
[8]Augment Code: 6 Best Spec-Driven Development Tools (2026.03)https://www.augmentcode.com/tools/best-spec-driven-development-tools
[9]Augment Code: What Is Spec-Driven Development — A Complete Guide (2026.02)https://www.augmentcode.com/guides/what-is-spec-driven-development
[10]ThoughtWorks: Spec-driven development (2025.12)https://thoughtworks.medium.com/spec-driven-development-d85995a81387
[11]Pasquale Pillitteri: SDD Framework Guide — BMAD, GSD, Ralph Loop (2026.01)https://pasqualepillitteri.it/en/news/158/framework-ai-spec-driven-development-guide-bmad-gsd-ralph-loop
[12]Daniel Sogl: SDD — The Evolution Beyond Vibe Coding (2025.09)https://danielsogl.medium.com/spec-driven-development-sdd-the-evolution-beyond-vibe-coding-1e431ae7d47b

Grouped by topic and arranged from introductory to advanced.

Getting Started: What SDD Is and Why It Is Necessary

TitleSourceDescription
The uncomfortable truth about vibe codingRed Hat Developer (2026.02)The most direct explanation of why vibe coding collapses after three months and how SDD addresses the problem
Beyond Vibe-Coding: A Practical Guide to Spec-Driven DevelopmentScalable Path (2025.11)An introductory guide for technical leaders that clearly explains SDD’s value to teams
Spec-Driven Development: Write the Spec, Not the CodeDEV Community (2026.03)A concrete rate-limiter example comparing a vibe-coding prompt with a spec-first prompt

Core Methodology: How to Write a Specification

TitleSourceDescription
How to Write a Good Spec for AI AgentsAddy Osmani / O’Reilly (2026.02)Essential. Written by a Google Chrome engineering director; currently the most comprehensive guide to writing specifications
How to write PRDs for AI Coding AgentsDavid Haberlah / Medium (2026.01)Focuses on combining the PRD format with Agent Skills and includes a practical Replit PRD Skill example
How to Vibe Code like a Google EngineerDrew Maring / Substack (2025.12)Demonstrates the complete path from specification to implementation with an open-source project, MacroMetric, whose code you can clone and study

Tools and Frameworks: How to Implement SDD

TitleSourceDescription
Spec-driven development with AI — GitHub Spec KitGitHub Blog (2025.09)GitHub’s official introduction to Spec Kit’s four-stage workflow and the foundational article for the SDD tooling ecosystem
Diving Into Spec-Driven Development With GitHub Spec KitMicrosoft Developer Blog (2025.09)Microsoft’s practical Spec Kit guide, including advanced use with multiple implementation variants
6 Best Spec-Driven Development Tools for AI Coding in 2026Augment Code (2026.03)A comparative evaluation of Intent, Kiro, Spec Kit, OpenSpec, BMAD, and Cursor
SDD Framework Guide — BMAD, GSD, Ralph LoopPasquale Pillitteri (2026.01)Compares installation, usage, and practical examples for mainstream SDD frameworks, including the relationship between the Ralph Loop and SDD
TitleSourceDescription
Spec-driven developmentThoughtWorks (2025.12)ThoughtWorks’ industry analysis, including the debate over whether specifications should replace code as the source of truth
Spec-Driven Development Is Eating Software EngineeringVishal Mysore / Medium (2026.03)A landscape of more than 30 frameworks, grouped into the Specification, Orchestration, Execution, and IDE layers
Beyond vibe coding: the case for spec-driven AI developmentThe New Stack (2026.02)The enterprise perspective: productivity without governance automates the creation of technical debt
Spec-Driven Development with AI Coding Agents — The Workflow Replacing “Prompt and Pray”Java Code Geeks (2026.03)For enterprise Java teams, with detailed explanations of the three maturity levels and recommendations for choosing tools

Complete Vibe Coding Guides, with SDD as a Key Stage

TitleSourceDescription
Vibe Coding: The Complete Guide to Building AI-Powered Apps in 2026Kumar Gauraw (2026.02)The most comprehensive vibe-coding guide, covering 17 tools and four levels, with SDD as the core methodology
Vibe Coding Guide 2026 — AI-First DevelopmentSitePoint (2026.03)The most technically detailed vibe-coding guide, covering multi-model orchestration, context management, and model-selection advice

If time is limited, read in this order:

  1. Red Hat: The uncomfortable truth about vibe coding — 5 minutes to understand the problem
  2. Addy Osmani: How to Write a Good Spec for AI Agents — 30 minutes for the core methodology; the most important article
  3. GitHub Blog: Spec-driven development with AI — 15 minutes to understand the four-stage workflow and Spec Kit
  4. Drew Maring: How to Vibe Code like a Google Engineer — 20 minutes for one complete practical example
  5. ThoughtWorks: Spec-driven development — 15 minutes to understand the industry debate and SDD’s boundaries

The total is under two hours and covers the complete picture from concept to practice to controversy.