Skip to main content
Spec-Driven Development

What Is Spec-Driven Development

AI-assisted

From Vibe Coding to spec-driven development: understanding how AI programming evolves from 'intuition' to 'engineering', and mastering the new paradigm of writing specs before code

Introduction

This approach succeeds where 'just prompting the AI' fails due to a basic truth about how language models work: they're exceptional at pattern completion, but not at mind reading.

In October 2025, GitHub open-sourced a toolkit called Spec Kit, officially bringing the concept of "Spec-Driven Development" into the AI programming landscape. This seemingly retro idea -- write specs before code -- is becoming the new paradigm for harnessing AI programming tools.

If you regularly use AI coding assistants like Claude Code, Cursor, or GitHub Copilot, you have likely encountered this frustration: you say "add a user login feature," the AI eagerly produces a heap of code, but upon closer inspection -- it uses an unfamiliar framework, the security strategy differs from what you expected, the UI style does not match... Then you enter round after round of corrections until you are exhausted.

Where does the problem lie? It is not that the AI is not smart enough -- it is that you have not provided enough information. "Add a user login feature" seems clear, but it actually hides hundreds of unstated decisions: What authentication method? What are the password requirements? How to handle failed logins? Should the login state be remembered? Support third-party login? ... The AI has no choice but to guess, and guessing means deviation.

Spec-driven development was born to solve exactly this problem.

Vibe Coding: The Cost of Speed

In early 2025, former Tesla AI Director Andrej Karpathy coined the term "Vibe Coding" to describe a development approach of "accepting AI suggestions without deep review." The term went viral and was even named Collins Dictionary's Word of the Year for 2025.

The appeal of Vibe Coding is obvious: you describe an idea, the AI generates code, and if it looks like it works, that is good enough. For rapid prototyping, hackathons, and throwaway scripts, this approach is genuinely efficient. But when it is applied to production systems, problems emerge.

We allowed a developer to vibe-code an entire user authentication flow... When we later needed to extend the auth system, it collapsed. No one could trace what was connected to what.

Stories like this are commonplace in the industry: AI-generated database queries run fine in small-scale tests but crawl under real traffic; a patched-together authentication module passes QA, only for someone to discover two weeks later that deactivated accounts can still access admin tools. According to a 2025 survey by Final Round AI, 16 out of 18 CTOs have experienced production disasters caused by AI-generated code.

This does not mean Vibe Coding is worthless. The key is knowing its boundaries:

ScenarioVibe CodingSpec-Driven Development
Prototypes / demosSuitableOverkill
Throwaway scriptsSuitableOverkill
Production featuresHigh riskRecommended
Security-relatedDangerousEssential
Team collaborationHard to maintainRecommended

Spec-driven development aims to retain the efficiency of AI while avoiding the pitfalls of Vibe Coding.

What Is Spec-Driven Development

Spec-driven development workflow
Spec-driven development: define 'what to build' before considering 'how to build it'

The core idea of spec-driven development can be summarized in one sentence: Define "what to build" before considering "how to build it".

This sounds like a software engineering cliche, but in the age of AI programming, it takes on new meaning. Traditional requirements documents are written for humans -- often lengthy, vague, and filled with jargon. The "spec" in spec-driven development is written for AI -- concise, structured, and actionable.

Imagine you are building a house. The traditional AI programming approach is like telling the construction crew "build me a comfortable three-bedroom house" and letting them figure it out. The result might be fine, but more likely it will be vastly different from what you imagined. Spec-driven development means drawing the architectural blueprint first: how many floors, square footage per floor, window orientation, material specifications... The crew builds according to the blueprint, and the result naturally meets expectations.

In AI programming, this blueprint is the specification. It does not concern itself with what programming language or framework to use -- only what the feature should achieve, what tasks users need to complete, and what the success criteria are.

Compared to traditional development workflows, spec-driven development has a fundamental difference:

Traditional AI ProgrammingSpec-Driven Development
Describe requirements directly -> AI generates codeRequirements -> Spec -> Plan -> Tasks -> Code
AI must guess many detailsEvery step is explicit; AI only needs to execute
Frequent rework, high communication costUpfront investment, smooth execution later
Suited for simple tasksSuited for complex features

This process of "progressive refinement" is the essence of spec-driven development. You do not go from zero to code in one leap -- instead, you progressively clarify requirements through multiple stages, each of which can be reviewed and adjusted.

Speckit Workflow Overview

GitHub's Spec Kit and the speckit command in Claude Code both follow a similar workflow, roughly divided into six stages:

Constitution -> Specify -> Clarify -> Plan -> Tasks -> Implement
     |             |          |         |        |          |
  Project     Feature     Resolve   Technical  Task      Execute
  Charter      Spec      Ambiguity   Plan    Breakdown  Implementation

1. Constitution (Project Charter)

The project constitution defines the fundamental principles and constraints for the entire project, such as "test first," "simplicity above all," "API first," etc. These principles carry through all subsequent stages, ensuring AI-generated solutions align with your technical preferences.

2. Specify (Feature Spec)

This is the critical first step. You describe the desired feature in natural language, and the AI helps organize it into a structured specification document, including:

  • User stories: who needs to do what, and why
  • Functional requirements: capabilities the system must have
  • Success criteria: how to determine if the feature meets the bar

Importantly, the spec document focuses only on "what to build," not "how to build it" -- no specific tech stacks, no code structure.

3. Clarify (Resolve Ambiguity)

The AI reviews the spec for ambiguous points and asks up to 5 key questions. These typically involve feature boundaries, user types, security requirements, etc. Through this Q&A, the spec becomes much clearer.

4. Plan (Technical Plan)

Only after having a clear spec do you begin considering the technical approach. This step produces:

  • Technology choices (language, framework, database)
  • Data model design
  • API contract definitions
  • Research reports (resolving technical decisions)

5. Tasks (Task Breakdown)

The technical plan is broken down into an executable task list. Each task has a clear ID, description, and file paths, ready to be handed off to the AI for execution. Tasks are grouped by user story and support parallel development.

6. Implement (Execute)

Tasks are executed one by one from the list. Each completed task is marked as done, ensuring traceability.

The deliverables from these six stages form a clear chain:

StageDeliverablePurpose
Constitutionconstitution.mdDefine project principles
Specifyspec.mdDescribe functional requirements
ClarifyUpdated spec.mdEliminate ambiguity
Planplan.md, research.mdTechnical solution design
Taskstasks.mdExecutable task list
ImplementActual codeFinal deliverable

Why This Approach Works

Spec-driven development succeeds where "just let AI write code" fails because it addresses the core contradiction of AI programming: information asymmetry.

When you say "add a photo sharing feature," you may have a complete picture in your mind, but the AI only sees those few words. It must guess: share to where? Who can see it? Does it need compression? Watermarks? Batch support? ... Every guess could be wrong.

Spec-driven development solves this by "forcing you to think it through first." When you are required to write down user stories, functional requirements, and success criteria, the details you assumed were "obvious" surface. This process itself is valuable -- even without AI, clearly writing out requirements reduces communication costs.

Furthermore, progressive refinement exposes errors earlier. Discovering a requirements deviation at the Specify stage costs virtually nothing to fix; discovering it after the code is written might mean starting over.

Of course, spec-driven development is not a silver bullet. It has clear use cases:

Good fit:

  • Complex feature development (involving multiple modules and interactions)
  • Team collaboration projects (spec documents serve as communication medium)
  • High-quality scenarios (requiring traceability and verifiability)

Not a good fit:

  • Simple bug fixes or minor changes
  • Exploratory programming (when you do not yet know what to build)
  • Extremely time-constrained situations (no time to write specs)

The key is recognizing task complexity. Something that takes an hour to complete does not need an hour of spec writing; a week-long feature absolutely warrants two hours of spec writing.

But Specs Are Not a Silver Bullet

One common misconception needs clarifying: spec-driven development reduces guessing, but it does not eliminate the need for review.

Even with a complete spec, AI may still:

  • Miss edge cases (extreme scenarios the spec did not cover)
  • Generate code that does not meet performance requirements
  • Introduce potential security vulnerabilities
  • Produce implementations with inconsistent style

This is like construction: even with detailed blueprints, inspection is still necessary. You would not move into a house just because the crew finished building it according to the plans -- you would check that the wiring is safe, the plumbing works, and the doors and windows are secure.

If specs define intent and agents generate the code, do we need to review code anymore? Short answer: yes, absolutely.

The value of spec-driven development lies in making errors easier to find, not in eliminating errors themselves.

Summary

The core of spec-driven development is a simple truth: the more complex the task, the more you need to think it through before starting. AI programming tools amplify the importance of this truth -- because AI will faithfully execute your instructions, but cannot truly understand your intent.

The person who communicates the best will be the most valuable programmer in the future. The new scarce skill is writing specifications that fully capture your intent and values.

Remember three key takeaways:

TakeawayMeaning
Spec before codeDefine "what to build" before considering "how to build it"
Progressive refinementFrom vague to clear, with review and adjustment at every step
Reduce guessingClear specs = less room for AI speculation

Now that you understand the philosophy, the next article, Speckit Practical Guide, will walk you through hands-on practice: how to use the speckit command to complete a spec-driven development workflow for a feature.

Combined with Claude Skills, you can further automate and standardize the execution of specs.

Comments

Table of Contents