What is Spec-Driven Development?
Spec-driven development (SDD) is a workflow where specifications serve as the foundation for all implementation work. Instead of requirements living in disconnected documents, specs become version-controlled, queryable artifacts that evolve alongside your code through bidirectional feedback between humans and AI agents.- Write requirements (Google Docs, Notion, Jira)
- Implementation begins
- Requirements drift from reality
- Documentation becomes stale
- Context is lost
- Write spec as version-controlled markdown
- AI agents create implementation plan from spec
- Agents execute work, providing feedback on ambiguities
- Human updates spec based on learnings
- Spec remains synchronized with implementation
- Context is durable and queryable
Core Principles
Durable Context
- Version controlled in git
- Queryable through CLI/MCP
- Evolve through feedback
- Never drift from reality
Bidirectional Feedback
- Agents discover ambiguities
- Feedback anchored to specific lines
- Humans refine specs
- Knowledge compounds
Graph-Based Planning
- Issues implement specs
- Dependencies explicit
- Topological execution
- Parallel work enabled
Agent Autonomy
- Agents claim ready work
- Self-directed implementation
- Multi-agent coordination
- Human-in-the-loop for decisions
How sudocode Implements SDD
sudocode provides the infrastructure for spec-driven development through:1. Specs as First-Class Entities
Specs are structured markdown files with:- Unique IDs (SPEC-001, SPEC-002, etc.)
- Metadata (priority, status, tags)
- Version-controlled content
- Hierarchical organization (parent-child)
2. Issues Implement Specs
Issues are work items that implement specifications:- Created from specs (manually or by agents)
- Linked via
implementsrelationship - Track implementation progress
- Close when complete
ISSUE-042 implements SPEC-005
3. Anchored Feedback System
Agents provide feedback on specs during implementation:- Anchored to lines - Feedback tied to specific spec locations
- Auto-relocating - Anchors update when specs change
- Typed feedback - Comments, suggestions, requests
- Bidirectional - Agents to humans, humans to agents
4. Dependency Graph
All work is modeled as a directed acyclic graph:- Issues can block other issues
- Dependencies explicit via
blocksrelationships ready()query finds unblocked work- Topological ordering enables parallel execution
5. Multi-Agent Coordination
Multiple agents can work simultaneously:- Each agent queries
ready()for available work - Status updates prevent work conflicts
- Agents discover and create blockers
- Completion automatically unblocks dependent work
The Spec-Driven Development Workflow
1. Create Spec (Human)
- Requirements and constraints
- Architecture decisions
- API designs
- Success criteria
- Open questions
Tips for writing effective specs
Tips for writing effective specs
- Start high-level: Capture intent before details
- Be explicit: State constraints and assumptions
- Ask questions: Document unknowns
- Link references: Include RFCs, documentation
- Define success: What does done look like?
2. Break Down (Optional)
- Parallel work on independent sub-specs
- Focused reviews
- Incremental delivery
3. Plan Implementation (Human + Agent)
Example: Agent creates implementation plan
Example: Agent creates implementation plan
4. Execute Issues (Agent)
-
Find ready work
-
Claim the issue
-
Review requirements
-
Implement
-
Complete
-
Next work becomes available
5. Provide Feedback (Agent → Human)
- Tied to line 23 of SPEC-005
- Visible when viewing spec
- Survives spec edits (auto-relocates)
- request - Need clarification or decision
- suggestion - Improvement ideas
- comment - Observations or context
6. Iterate (Human)
7. Track Progress
Complete Example Walkthrough
Let’s walk through building an OAuth authentication system from start to finish.Phase 1: Specification
Human creates initial spec:SPEC-005
Human edits SPEC-005 markdown:
Phase 2: Planning
Human asks AI agent to create plan:- ISSUE-050: Set up OAuth provider configuration (P0)
- ISSUE-051: Token exchange (blocked by 050)
- ISSUE-052: User flow (blocked by 051)
- ISSUE-053: Token refresh (blocked by 051)
- ISSUE-054: Security hardening (blocked by 052)
Phase 3: Execution
Agent 1 claims foundation work:Phase 4: Feedback Integration
Human reviews feedback:Phase 5: Completion
Final issues complete:- Users can sign in with Google
- Users can sign in with GitHub
- Tokens refresh automatically
- No security vulnerabilities (OWASP)
- Auth flow completes in < 3 seconds
Best Practices
For Humans
Start high-level, refine iteratively
Start high-level, refine iteratively
- Core requirements
- Key constraints
- Open questions
Keep issues small and focused
Keep issues small and focused
- Parallel work possible
- Clear completion criteria
- Easy to track progress
- Reduces blocking
Use relationships to model dependencies
Use relationships to model dependencies
blocks relationships.Example:- Automatic
ready()filtering - Parallel work discovery
- Bottleneck identification
Encourage feedback early and often
Encourage feedback early and often
- Specs improve continuously
- Reduces back-and-forth
- Agents stay unblocked
- Knowledge compounds
Commit context with code
Commit context with code
- Context travels with code
- Reviews include design decisions
- History is complete
For AI Agents
Always check ready() before claiming
Always check ready() before claiming
Read specs before implementing
Read specs before implementing
Provide feedback on ambiguities
Provide feedback on ambiguities
Update issue descriptions on close
Update issue descriptions on close
Comparison to Traditional Workflows
| Aspect | Traditional | Spec-Driven |
|---|---|---|
| Requirements | Google Docs, Notion | Version-controlled markdown |
| Drift | Requirements diverge from code | Continuous sync via feedback |
| Context | Lost over time | Durable and queryable |
| Agent autonomy | Limited (unclear requirements) | High (clear specs, ready work) |
| Feedback loop | Slow (meetings, async comments) | Fast (anchored feedback) |
| Dependencies | Implicit (tribal knowledge) | Explicit (graph relationships) |
| Parallelization | Manual coordination | Automatic (graph-based) |
| Progress tracking | Manual updates | Automatic (status queries) |
Common Patterns
Pattern: Spec-First Feature Development
Pattern: Multi-Agent Parallel Development
Pattern: Feedback-Driven Spec Refinement
Pattern: Hierarchical Spec Organization
Troubleshooting
No issues are ready (everything blocked)
No issues are ready (everything blocked)
Specs drift from implementation
Specs drift from implementation
- Train agents to use
add_feedback()liberally - Review feedback regularly:
sudocode feedback list --status open - Make spec updates part of PR review process
- Dismiss feedback only after spec updated
Too many issues created upfront
Too many issues created upfront
- Create only foundation issues initially
- Use
discovered-fromrelationship for issues found during work - Allow specs to evolve based on implementation reality
- Embrace iterative planning
Feedback anchors become stale
Feedback anchors become stale
Related Documentation
Specs Concept
Feedback System
Agent Workflows
CLI Reference
Graph Planning
MCP Tools
Next Steps
Create your first spec
Break it down into issues
Let agents execute
ready(), claim work, provide feedbackReview and iterate
Track progress

