HOME / SPEC-DRIVEN DEVELOPMENT / PILLAR GUIDE
PILLAR SPECIFICATION · REV 2026.1

Spec-Driven Development (SDD)

The Definitive Engineering Guide for AI Coding Agents (Cursor, Claude Code, Windsurf)

DEFINITION // GEO SNIPPET 40-WORD ENTITY EXTRACT

Spec-Driven Development (SDD) is an AI-first software engineering methodology where structured, version-controlled technical specifications (constitution.md, requirements.md, solution.md, tasks.md) precede code generation to eliminate AI hallucinations, context window decay, and architectural spaghetti.

SECTION 01 THE CRISIS

Why Vibe Coding Breaks at 500 Lines of Code

The emergence of autonomous AI coding agents (Cursor Composer, Claude Code, Windsurf Cascade, Lovable, Bolt) has supercharged developer velocity. Prototyping an idea in an afternoon feels magical.

However, teams quickly hit the Context Window Decay Curve:

⚠ THE 3 POST-500 LOC FAILURE MODES:
  • Silent Scope Mutation: Prompts drift across multi-turn chats; the AI forgets previous API contracts and rewrites existing helpers.
  • Architectural Spaghetti: The AI picks incompatible dependencies or mixes ORMs (e.g. Prisma and Drizzle in the same repo).
  • Unreproducible State: Chat history is ephemeral. There is no version-controlled artifact defining why a decision was made.
"LLMs require deterministic architectural contracts, not clever conversational prompting."
SECTION 02 THE 4-FILE BUNDLE

Anatomy of the Standard 4-File SDD Bundle

In Spec-Driven Development, all product features are governed by four version-controlled markdown files located in your repository's specs/ directory (the MCP server mirrors downloads into a gitignored .specs/ folder, so the committed bundle and your agent's working copy never collide):

01. constitution.md
Immutable Governance

Tech stack rules, linting constraints, forbidden dependencies, and security boundaries that the AI agent can never violate.

02. requirements.md
Functional Specification

EARS+ compliant user stories, explicit business logic, edge case handling, and acceptance criteria testable to 100% precision.

03. solution.md
System Architecture

Database schemas, API endpoints, component trees, state management diagrams (rendered live via Mermaid.js).

04. tasks.md
Atomic Execution Plan

Ordered, unit-testable implementation tasks sized small enough to fit within an LLM's optimal attention window.

SECTION 03 COMPARISON

SDD vs. TDD vs. Traditional PRDs vs. Vibe Coding

Methodology Single Source of Truth AI Agent Compatibility Context Drift Risk
Vibe Coding Chat window history Poor (High hallucination) Extremely High
Traditional PRD Confluence / Notion Doc Medium (Too abstract) Medium
TDD (Test-Driven) Unit Test Files Good (Post-architecture) Low
Spec-Driven (SDD) 4-File Versioned Markdown Bundle Optimal (Native MCP Context) Zero (Deterministic)
SECTION 04 TOOLING & MCP

How to Implement SDD with Cursor, Claude Code, and Windsurf

Instead of manually copy-pasting markdown files into your chat window, MySpec exposes your project specifications directly over the Model Context Protocol (MCP):

# Connect MySpec MCP Server in Cursor / Claude Code
npx -y @myspec/mcp-server

Your AI coding agent can now list projects, read_spec_file the constitution before it writes a line, download_spec_file the whole bundle into .specs/, and push its own edits back as new revisions with update_spec_file - 31 tools in total, with a hosted HTTP variant for agents that have no filesystem. See the MCP server docs.

On Claude Code, the official MySpec plugin sets this up in two commands and adds skills that build the bundle task by task - one test per acceptance criterion, a constitution check, and the task ticked off on MySpec.

Scale that to many agents at once and you have an AI software factory: parallel Claude Code sessions building from one spec, with every pull request verified against its acceptance criteria and a human gate at each milestone.

SECTION 05 SPEC FILE FIELD GUIDE

Every Spec File Type, Explained

Each file in a bundle answers one question and feeds the next. The core MySpec bundle is four files; brownfield work adds a change proposal, and the Spec Kit and OpenSpec methodologies use their own file names for the same jobs. Each guide covers the file's purpose, its section-by-section anatomy, a specimen, the review rules the AI reviewer enforces, and how coding agents consume it.

SECTION 06 THREE WORKFLOWS

MySpec, Spec Kit, or OpenSpec - Pick Per Session

SDD is a methodology, not a single file layout. MySpec runs three of them natively, so a team already using GitHub's Spec Kit or Fission's OpenSpec keeps its folder conventions and CLI commands while the AI Architect does the interviewing and drafting.

Compare all three side by side →

TOPIC CLUSTER DEEP-DIVE GUIDES

Explore the SDD Topic Cluster

Ready to Build Your First SDD Spec Bundle?

Let the AI Senior Architect interview you and draft your 4-file bundle for free. No credit card required.