Back to Learn

Spec-Driven Development: From Vibe Coding to Production-Ready AI Code

Learn how to guide AI coding agents with structured specifications instead of improvised prompts. Used by GitHub, Amazon, and leading AI-native teams.

18 min read
Intermediate
Sept 2025
GitHub Spec Kit Released
25%
YC W2025 uses 95% AI code
10+ Tools
Compatible AI agents
What You'll Learn
  • Move from "vibe coding" to production-ready AI development
  • Master the four-phase spec-driven workflow
  • Use GitHub Spec Kit with Claude Code, Cursor, GitHub Copilot, Windsurf, and more
  • Build consistent, high-quality code with AI agents
What is Spec-Driven Development?

Spec-Driven Development (SDD) is a methodology where you write detailed specifications BEFORE generating code, making the spec—not the code—your source of truth. Think of it as the evolution of Product Requirements Documents (PRDs) for the AI age.

The Problem It Solves

"Vibe coding" (coined by Andrej Karpathy, Feb 2025) works great for prototypes, but fails for production systems. You describe what you want, get code back, and… it compiles but doesn't match intent, has wrong architecture, or introduces security holes.

The Solution

Instead of treating AI agents like search engines, treat them like literal-minded pair programmers. They need unambiguous instructions, not vague prompts.

Traditional Workflow:
Requirements → Design → Coding → Testing

Spec-Driven Workflow:
Requirements → Detailed Spec → AI Generation → Validation
ELI5: Spec-Driven Development

Imagine you're building with LEGO but blindfolded. "Vibe coding" is like someone describing what to build piece-by-piece as you go ("add a blue brick… now a red one…"). Sometimes it works, often it doesn't.

Spec-driven development is like having the complete LEGO instruction booklet FIRST. You know exactly what you're building, what pieces you need, and how they fit together. Then you hand that booklet to a really fast builder (the AI) who follows it perfectly.

The instruction booklet is your "spec." The AI is your builder. You focus on designing what to build; the AI focuses on building it exactly as specified.

For Product Managers & Builders

Why This Matters

If you're building with Claude Code, Cursor, or GitHub Copilot, you've experienced this: the code looks great, but doesn't quite work. Security requirements were missed. The architecture isn't what you'd choose. Tests are incomplete.

Spec-driven development solves this by:

Separating "what" from "how" - You define what to build (the spec), AI figures out how
Making intent executable - Your specifications become the source of truth that AI follows
Enabling iteration - Update the spec, regenerate code, no expensive rewrites
Embedding quality - Security, testing, design systems are in the spec from day one

Use spec-driven when:

  • Building production systems (not prototypes)
  • Working with existing codebases
  • Team collaboration required
  • Complex architectures
  • Security/compliance matters
  • Greenfield projects that need to scale

Stick with vibe coding when:

  • Quick prototypes and experiments
  • UI-heavy work needing visual iteration
  • Small bug fixes
  • Exploring ideas
  • Learning new technologies

Real-World Example: Building a SaaS Dashboard

Vibe coding approach:
  1. → "Build me a dashboard with login"
  2. → AI generates something generic
  3. → "Add billing"
  4. → Code conflicts with existing auth
  5. → "Add analytics"
  6. → Architecture becomes messy
  7. → Spend days debugging
Spec-driven approach:
  1. 1. Write spec: Auth (OAuth2 + JWT), billing (Stripe), analytics (PostHog), architecture (Next.js + Supabase)
  2. 2. AI generates plan breaking this into tasks
  3. 3. AI implements each task following spec
  4. 4. Review focused changes, not thousand-line dumps
  5. 5. Ship production-ready code
The Four-Phase Workflow

SDD follows a structured process (from GitHub Spec Kit):

1Specify

Write your specification document covering:

  • • What you're building and why
  • • Functional requirements (what it does)
  • • Non-functional requirements (performance, security, etc.)
  • • Technical constraints
  • • Success criteria

2Plan

AI generates a technical plan from your spec:

  • • Architecture decisions
  • • Technology stack
  • • Component design
  • • Integration points
  • • Risk assessment

3Tasks

AI breaks the plan into concrete, testable tasks:

  • • Small, reviewable chunks
  • • Each task solves a specific piece
  • • Includes acceptance criteria
  • • Can be implemented in isolation

4Implement

AI implements tasks one by one:

  • • You review focused changes (not giant code dumps)
  • • Each task is validated against spec
  • • Iterative refinement
  • • Spec remains source of truth

Key Innovation: The Constitution

A constitution.md file defines non-negotiable principles:

  • • Testing approaches (e.g., "always write unit tests first")
  • • Conventions (e.g., "CLI-first for all tools")
  • • Security requirements
  • • Design system rules
  • • Opinionated stacks

This ensures organizational standards are baked into every project.

Tools & Ecosystem

GitHub Spec Kit ⭐ (Primary Tool)

  • Open source toolkit for SDD
  • CLI tool to initialize projects
  • Works with multiple AI agents
  • Templates for specs, plans, tasks
  • Active development (v0.0.79+ as of Oct 2025)

Supported AI Agents

Claude Code (Anthropic)
GitHub Copilot
Cursor
Gemini CLI (Google)
Windsurf
Amazon Q Developer

Related Tools

Amazon Kiro IDE

New VS Code-based IDE with built-in "Spec Mode"

Cursor Plan Mode

Auto-generates plans before coding

spec-coding-mcp

MCP server for spec-driven development

Installation

# Using uvx (recommended)
uvx --from git+https://github.com/github/spec-kit.git specify init my-project

# Choose your AI agent during setup
# Creates folder structure with templates
When SDD Excels

Best Use Cases

1. Greenfield (Zero-to-One)

Starting a new project? Small upfront investment in specs ensures AI builds what you intend, not generic patterns.

2. Legacy Modernization

Original intent lost to time? Capture essential business logic in modern spec, design fresh architecture, let AI rebuild without technical debt.

3. Team Collaboration

Multiple developers, different AI tools? Shared spec becomes single source of truth everyone works from.

4. Enterprise Applications

Security requirements, compliance, design systems? These are specification constraints, not afterthoughts.

Current Limitations

Experimental - Spec Kit still v0.0.x, frequent updates
Greenfield focus - Better for new projects than existing codebases
Tool lock-in - Once initialized with an AI agent, hard to switch
Learning curve - Requires thinking specification-first
Practical Examples

Example 1: Den Delimarsky's GitHub Brain MCP Server

Built entire project by writing specs in Markdown, letting GitHub Copilot compile to Go code. Rarely edits Go directly—works at the specification level.

Read Den Delimarsky's blog post →

Example 2: Legacy System Modernization

Company had 10-year-old monolith. Wrote spec capturing business logic, generated modern microservices architecture, validated against original behavior. Shipped in weeks vs. months of manual rewrite.

Example 3: Multi-Platform App

Wrote single spec for mobile app features, generated iOS (Swift), Android (Kotlin), and Web (React) implementations from same spec. Consistency across platforms, single source of truth.

Getting Started
1

Pick Your First Project

Choose a greenfield project or well-defined feature. Don't start with complex legacy code.

2

Install Spec Kit

uvx --from \ git+https://github.com/github/spec-kit.git \ specify init my-first-spec-project
3

Write Your Constitution

Define your non-negotiables: Testing philosophy, security baseline, code style, technology preferences

4

Create Your First Spec

Use the template. Be specific: What problem? Who are users? What features? What constraints? How measure success?

5

Let AI Plan

Use your AI agent to generate the technical plan from spec.

6

Review and Iterate

The plan probably needs refinement. This is normal. Update spec, regenerate.

7

Generate Tasks

Break the plan into concrete implementation tasks.

8

Implement

Let AI implement tasks. Review each one. Validate against spec.

9

Test and Ship

Run tests, validate behavior, deploy.

Comparison with Other Approaches

SDD vs Vibe Coding

AspectVibe CodingSpec-Driven
Starting pointPromptSpecification
StructureAd-hocSystematic
Best forPrototypesProduction
QualityVariableConsistent
Team useIndividualCollaborative

SDD vs TDD (Test-Driven Development)

  • TDD: Tests are specifications for behavior
  • SDD: Specifications cover entire system (architecture, tests, requirements)
  • They're complementary, not competing
  • SDD can include TDD as part of the spec

SDD vs Traditional PRDs

  • PRDs: Static documents that get outdated
  • SDD: Living specifications that drive implementation
  • PRDs inform humans; specs are executed by AI
  • SDD makes PRD-like thinking executable
The Future of SDD

Trends to Watch

1. IDE Integration

Tools like Amazon Kiro show SDD moving into IDEs natively. Expect VS Code, Cursor, etc. to build this in.

2. Model Improvements

As context windows grow (200K+ tokens now), models handle increasingly complex specifications.

3. Specification Languages

Projects like SpecLang and Plain show movement toward formal spec languages.

4. Multi-Agent Orchestration

Specs become contracts between multiple AI agents working together.

5. Visual Spec Tools

Next generation may combine visual design tools with spec generation.

"We're moving from 'code is the source of truth' to 'intent is the source of truth.' This isn't because documentation became more important. It's because AI makes specifications executable."

— Den Delimarsky, GitHub PM

Community Growth

  • • Active GitHub discussions
  • • Community contributions to Spec Kit
  • • Companies building on the framework
  • • Conference talks and tutorials emerging
Frequently Asked Questions

What is spec-driven development?

Spec-driven development is a methodology where you write detailed specifications before generating code, making the specification—not the code—your source of truth for AI agents to follow.

How is spec-driven different from vibe coding?

Vibe coding uses ad-hoc prompts to generate code iteratively. Spec-driven development uses structured specifications upfront, resulting in more consistent, production-ready code.

What tools support spec-driven development?

GitHub Spec Kit is the primary toolkit, supporting Claude Code, GitHub Copilot, Cursor, Gemini CLI, and 10+ other AI coding agents.

When should I use spec-driven development?

Use SDD for production systems, team collaboration, complex architectures, and when code quality matters. Use vibe coding for prototypes and experiments.

Is spec-driven development compatible with Agile?

Yes, specs can be iterative within sprints. SDD focuses on working software, not documentation for its own sake.

Who coined the term "vibe coding"?

Andrej Karpathy coined the term "vibe coding" in February 2025 to describe the ad-hoc, prompt-driven approach many developers use with AI coding assistants.