Core Principles
Spec-Driven Development is built on six foundational principles that guide the entire methodology:1. Specifications as the Lingua Franca
Principle
The specification becomes the primary artifact. Code becomes its expression in a particular language and framework. Maintaining software means evolving specifications.
- Code reviews focus on whether implementation matches the spec
- Debugging starts by verifying the specification is correct
- Refactoring means restructuring specifications for clarity
- The lingua franca of development moves to a higher level
2. Executable Specifications
Principle
Specifications must be precise, complete, and unambiguous enough to generate working systems. This eliminates the gap between intent and implementation.
- Clear acceptance criteria (Given/When/Then scenarios)
- Unambiguous requirements with no
[NEEDS CLARIFICATION]markers - Measurable success criteria
- Well-defined entities and their relationships
- Explicit edge case handling
Executable doesn’t mean “written in a programming language.” It means precise enough that AI can reliably translate intent into working code.
3. Continuous Refinement
Principle
Consistency validation happens continuously, not as a one-time gate. AI analyzes specifications for ambiguity, contradictions, and gaps as an ongoing process.
/speckit.analyzechecks consistency across artifacts/speckit.clarifystructures ongoing requirement refinement/speckit.checklistgenerates custom validation rules- Constitution compliance verified at every phase
4. Research-Driven Context
Principle
Research agents gather critical context throughout the specification process, investigating technical options, performance implications, and organizational constraints.
Technical Context
Technical Context
- Library compatibility and maturity
- Performance benchmarks for technology choices
- Security implications of architectural decisions
- Platform capabilities and limitations
Organizational Context
Organizational Context
- Company database standards
- Authentication and authorization requirements
- Deployment policies and infrastructure constraints
- Compliance and regulatory requirements
/speckit.plan and is documented in research.md, ensuring every technical decision has documented rationale.
5. Bidirectional Feedback
Principle
Production reality informs specification evolution. Metrics, incidents, and operational learnings become inputs for specification refinement.
- Performance bottlenecks → become non-functional requirements
- Security vulnerabilities → become constraints affecting future generations
- User behavior patterns → inform UX specifications
- Production incidents → update specifications for next regeneration
This isn’t just hotfixes—it’s systematic evolution. Production learnings flow back into specifications, improving every future generation.
6. Branching for Exploration
Principle
Generate multiple implementation approaches from the same specification to explore different optimization targets—performance, maintainability, user experience, cost.
- Performance-optimized branch using async processing and caching
- Simplicity-optimized branch with minimal dependencies
- Cost-optimized branch using serverless architecture
- UX-optimized branch prioritizing user experience over performance
The Constitutional Foundation
At the heart of SDD lies a constitution—a set of immutable principles that govern how specifications become code. The constitution acts as the architectural DNA of the system.Why a Constitution?
Without governing principles, AI generation produces:- Inconsistent architectural patterns
- Over-engineered solutions
- Untestable code
- Technical debt from day one
Nine Articles of Development
While each project creates its own constitution, successful SDD constitutions typically include:Article I: Library-First Principle
Article I: Library-First Principle
Every feature must begin as a standalone library—no exceptions. This forces modular design from the start.Why it matters:
- Prevents monolithic applications
- Enforces clear boundaries and minimal dependencies
- Makes features reusable across projects
- Enables independent testing and versioning
Article II: CLI Interface Mandate
Article II: CLI Interface Mandate
Every library must expose its functionality through a command-line interface.Requirements:
- Accept text as input (stdin, arguments, or files)
- Produce text as output (stdout)
- Support JSON format for structured data exchange
- Enforces observability—everything is inspectable
- Enables testability through text-based interfaces
- Prevents hiding functionality in opaque classes
- Makes debugging straightforward
Article III: Test-First Imperative (NON-NEGOTIABLE)
Article III: Test-First Imperative (NON-NEGOTIABLE)
No code before tests. This is the most transformative article.Process:
- Unit tests are written
- Tests are validated and approved by the user
- Tests are confirmed to FAIL (Red phase)
- Only then is implementation code written
- Completely inverts traditional AI code generation
- Ensures behavior is defined before implementation
- Creates living documentation through tests
- Prevents “generate code and hope it works” approaches
Articles VII & VIII: Simplicity and Anti-Abstraction
Articles VII & VIII: Simplicity and Anti-Abstraction
Combat over-engineering through concrete constraints.Simplicity Gate (Article VII):
- Maximum 3 projects for initial implementation
- Additional projects require documented justification
- No future-proofing or speculative features
- Use framework features directly rather than wrapping them
- Single model representation (no parallel abstractions)
- Justify every layer of complexity
Article IX: Integration-First Testing
Article IX: Integration-First Testing
Prioritize real-world testing over isolated unit tests.Requirements:
- Use realistic environments (real databases, not mocks)
- Actual service instances over stubs
- Contract tests mandatory before implementation
Constitutional Enforcement
The implementation plan template operationalizes constitutional principles through Phase -1 Gates:Constitutional Evolution
While principles are immutable, their application can evolve:Modifications to the constitution require:
- Explicit documentation of the rationale for change
- Review and approval by project maintainers
- Backwards compatibility assessment
Template-Driven Quality
The true power of SDD lies in how templates guide LLM behavior toward higher-quality specifications.How Templates Constrain LLMs
Preventing Premature Implementation
Templates explicitly instruct:
- ✅ Focus on WHAT users need and WHY
- ❌ Avoid HOW to implement
Forcing Explicit Uncertainty
Templates mandate
[NEEDS CLARIFICATION] markers:- Don’t guess authentication method
- Don’t assume data retention period
- Mark all ambiguities explicitly
Structured Thinking Through Checklists
Templates include comprehensive checklists:
- No
[NEEDS CLARIFICATION]markers remain - Requirements are testable and unambiguous
- Success criteria are measurable
Constitutional Compliance Gates
Templates enforce architectural principles:
- Simplicity gates prevent over-engineering
- Anti-abstraction gates require justification
- Test-first gates ensure quality
Hierarchical Detail Management
Templates enforce proper information architecture:
- Main documents stay high-level and readable
- Detailed specs go in
implementation-details/ - Code samples extracted to separate files
Test-First Thinking
Templates enforce test-first development:
- Create
contracts/with API specifications - Create test files (contract → integration → e2e → unit)
- Create source files to make tests pass
The Compound Effect
These constraints work together to produce specifications that are:- Complete - Checklists ensure nothing is forgotten
- Unambiguous - Forced clarification markers highlight uncertainties
- Testable - Test-first thinking baked into the process
- Maintainable - Proper abstraction levels and information hierarchy
- Implementable - Clear phases with concrete deliverables
The templates transform the LLM from a creative writer into a disciplined specification engineer, channeling its capabilities toward producing consistently high-quality, executable specifications that truly drive development.
Beyond Rules: A Development Philosophy
The constitution isn’t just a rulebook—it’s a philosophy that shapes how LLMs think about code generation:Observability Over Opacity
Everything must be inspectable through CLI interfaces. No hidden functionality, no opaque abstractions.
Simplicity Over Cleverness
Start simple, add complexity only when proven necessary. Three projects max. Direct framework usage. Justify every abstraction.
Integration Over Isolation
Test in real environments, not artificial ones. Real databases, actual services, contract tests mandatory.
The Power of Immutable Principles
The constitution’s power lies in its immutability. While implementation details evolve, core principles remain constant. This provides:- Consistency Across Time - Code generated today follows the same principles as code generated next year
- Consistency Across LLMs - Different AI models produce architecturally compatible code
- Architectural Integrity - Every feature reinforces rather than undermines the system design
- Quality Guarantees - Test-first, library-first, and simplicity principles ensure maintainable code
By embedding these principles into the specification and planning process, SDD ensures that generated code isn’t just functional—it’s maintainable, testable, and architecturally sound.
Next Steps
Understand the Workflow
Learn the step-by-step process of practicing Spec-Driven Development
Get Started
Begin implementing SDD in your projects