What Are Specs?
Specs are the first tier in sudocode’s 4-tier abstraction structure. They capture user intent - the WHAT you want to build, not the HOW. Think of specs as your requirements documents, RFCs, design decisions, and research questions all living as version-controlled artifacts alongside your code.Key Principle: Specs capture what humans want. Issues (tier 2) capture how agents will implement it.
- High-level requirements - “Build a user authentication system”
- RFCs - “Proposal for migrating to OAuth 2.0”
- Design decisions - “API authentication flow design”
- Research questions - “Evaluate database options for time-series data”
- Architecture docs - “Microservices architecture overview”
Specs vs. Issues
Specs
User intent (WHAT)
- Written by humans
- Requirements and design
- Long-lived documentation
- Evolve with learnings
Issues
Agent tasks (HOW)
- Created from specs
- Actionable work items
- Task-level granularity
- Closed when complete
Spec Lifecycle
Specs progress through a defined lifecycle from creation to completion:draft - Initial creation and iteration
draft - Initial creation and iteration
Specs start as drafts when first created. Use this status while:
- Gathering requirements
- Iterating on design
- Adding details
- Getting feedback from agents during implementation
review - Ready for review
review - Ready for review
Move to review when the spec is ready for stakeholder review:
- Requirements are complete
- Design is fleshed out
- Ready for implementation planning
- Awaiting approval
approved - Finalized and ready
approved - Finalized and ready
Approved specs are finalized and ready for implementation:
- Requirements locked in
- Issues can be created from this spec
- Implementation can begin
- Still can receive feedback from agents
deprecated - No longer relevant
deprecated - No longer relevant
Deprecated when the spec is superseded or no longer needed:
- Feature removed
- Replaced by newer spec
- Requirements changed
- Keep for historical reference
Spec Types
Specs are categorized by type to help with organization and filtering:| Type | Purpose | Example |
|---|---|---|
| architecture | System design and structure | ”Microservices migration plan” |
| api | API design and contracts | ”REST API v2 design” |
| database | Data models and schemas | ”User data model redesign” |
| feature | Product features | ”Multi-factor authentication” |
| research | Investigation and analysis | ”Evaluate GraphQL vs REST” |
Spec Structure
Specs are stored as markdown files with YAML frontmatter in.sudocode/specs/:
File Format
Flexible Content: The markdown body is completely flexible - no enforced structure. Organize sections however makes sense for your spec.
Cross-References and Links
Specs support two types of references using Obsidian-style syntax:Issue References
Link to issues that implement parts of the spec:[[@ISSUE-XXX]] syntax creates a bidirectional link:
- The spec knows which issues implement it
- The issue knows which spec requirements it addresses
Spec References
Link to related specs:[[SPEC-XXX]] syntax links specs together for cross-cutting concerns.
Automatic Backlinks: sudocode automatically tracks all references in both directions for easy graph traversal.
Hierarchical Organization
Specs can be organized hierarchically using parent-child relationships:- Break complex specs into manageable pieces
- Organize related specs
- Maintain different levels of detail
- Enable progressive disclosure
Priority Levels
Specs use a 0-4 priority scale:Priority Levels
Priority Levels
- 0 - Critical (highest priority)
- 1 - High
- 2 - Medium (default)
- 3 - Low
- 4 - Lowest
- Execution order (combined with dependencies)
- Which work agents tackle first
- Visibility in queries and reports
Storage and Versioning
Specs are stored in three synchronized layers:Markdown Files (.md)
Markdown Files (.md)
Purpose: Human-editable interface
- Located in
.sudocode/specs/ - YAML frontmatter + markdown body
- Edit directly or via CLI
- Synced to JSONL automatically
JSONL File (specs.jsonl)
JSONL File (specs.jsonl)
Purpose: Source of truth, git-tracked
- One JSON object per line
- Contains all spec data
- Committed to version control
- Used for distribution via git
SQLite Cache (cache.db)
SQLite Cache (cache.db)
Purpose: Fast queries and relationships
- Rebuilt from JSONL after git pull
- Enables efficient graph queries
- Not committed to git
- Auto-synced from JSONL
Git-Native: Specs are version-controlled artifacts. Track requirements alongside code and see how they evolve over time.
Best Practices
When to Create a Spec
✅ Good candidates for specs
✅ Good candidates for specs
- New features or major changes
- Architectural decisions
- Design documents that agents will implement
- Research questions requiring investigation
- Requirements that will generate multiple issues
- Cross-cutting concerns affecting multiple areas
❌ Not good candidates for specs
❌ Not good candidates for specs
- Simple bug fixes (create issue directly)
- Trivial changes (no spec needed)
- Implementation details (belongs in issues)
- Temporary notes (use comments or docs)
Writing Effective Specs
Spec vs Issue Decision Matrix
| Aspect | Spec | Issue |
|---|---|---|
| Scope | High-level, multi-component | Single task, agent-scoped |
| Author | Primarily humans | Humans or agents |
| Lifecycle | Long-lived, evolves | Closed when complete |
| Detail | WHAT and WHY | HOW and acceptance criteria |
| Relationships | Links to issues, other specs | Links to spec, blockers |
CLI Commands
Quick reference for working with specs:Complete CLI Reference
See full documentation for all spec commands and options
Common Workflows
Creating a Spec-Driven Feature
Next Steps
Issues
Learn about issues - the actionable work items derived from specs
Relationships
Understand how specs connect to issues and other specs
Feedback System
See how agents provide feedback on specs during implementation
Spec Commands
Complete CLI reference for managing specs

