Why Spec Driven Development
Part 2: The Framework
The real bottleneck in software is the "cost of knowing what to build." Knowing what and how to build is far more important than just having people who can code.
The Reality of Vibe Coding
The Vibe Coding Trap: "We don't need to know software engineering anymore; we just talk to the AI and the product gets built!"
One of the biggest current misunderstandings about AI is the concept of "Vibe Coding."
However, the main problem is that AI does not inherently understand the whole project. It only operates based on the limited context window it sees at that specific moment.
Because of this, many Vibe Coding projects follow a predictable pattern: they start off amazing, but as they grow larger, real issues begin to emerge. When a project lacks a clear structure:
- System architecture falls apart.
- Naming conventions become inconsistent.
- Scalability and development become much harder.
- Performance starts to drop.
Eventually, the AI completely loses its grasp on the project.
Enter Spec Driven Development
This is where some special commands and skills become very valuable.
The core idea is simple: Before writing any code, we force the AI to truly understand the project first.
The framework interviews and challenges the user about:
Core Business Logic & Domain Rules
The foundational rules and operations of the application.
System Architecture & Design Patterns
Component, dependency flows, and patterns (e.g., layered, event-driven, clean architecture).
Technical Decisions & Trade-offs
Selection of tools, databases, frameworks, and recording architectural decisions (ADRs).
Naming Conventions & Ubiquitous Language
Establishing a unified, domain-driven vocabulary.
Non-Functional Requirements (NFRs)
Designing for security boundaries, scalability, latency targets, and caching strategies.
API Contracts & Integration Boundaries
Defining clear interfaces and protocols for internal and external communication.
Testing & Verification Strategies
Establishing how code is validated, from unit tests to automated E2E suites.
Project Constraints & Rules
Enforcing style guides, directory layouts, and deployment limitations.
Building an Engineering Memory
After this process, the framework generates real, structured specifications for the project, including:
- Project glossaries
- Architecture design documents
- Technical Decision Records (ADRs)
- Coding conventions
- A shared project vocabulary
As a result, the AI develops a structured, engineered memory of your project.
Sample Spec-Driven Repo Structure
These specifications live in a predictable layout that every agent and developer can navigate:
AGENTS.md (symlink to CLAUDE.md and/or GEMINI.md)
docs/
├── ARCHITECTURE.md
├── DESIGN.md
├── BACKEND.md
├── FRONTEND.md
├── DATA-MODELS.md
├── PLANS.md
├── PRODUCT.md
├── RELIABILITY.md
└── SECURITY.md
├── design-docs/
│ ├── index.md
│ ├── ui.md
│ ├── ux.md
│ └── ...
├── exec-plans/
│ ├── active/
│ ├── archived/
│ └── tech-debt.md
├── generated/
│ └── db-schema.md
├── references/
│ ├── system-design-reference.md
│ └── ...
Code and PR Review of AI Outputs
The Review Shift: Since it is impossible to manually review thousands of lines of fast-generated AI code, the review focus must shift to specifications, design documentation, and test validity.
Code review is a vital practice, but its role is changing in the AI era. Because it is impossible to manually read thousands of lines of AI-generated code, the focus must shift to reviewing specifications, documentation, and tests.
Ultimately, the most critical function of a code review is to keep the entire team aligned and moving in the right direction.
A good code review achieves eight things:
1. Style
Keeps the codebase clean, organized, and consistent.
2. Bug detection
Catches errors before they reach production.
3. Design discussion
Creates a space to debate the pros and cons of technical choices.
4. Correct solution
Verifies that the code actually solves the right problem.
5. Security & safety
Verifies that the new code doesn't introduce vulnerabilities.
6. Performance & scalability
Identifies potential bottlenecks.
7. Mental alignment
Helps everyone understand how the system is evolving.
8. And More principles ...
The Ultimate Benefits
- Consistent Code: Codebases stay clean and aligned.
- Protected Architecture: System design does not degrade over time.
- Fewer Repetitive Prompts: You waste less time re-explaining the context.
- Manageable Growth: Project development stays completely under control.
- True Collaboration: The AI begins to act like a real, reliable teammate.