Skip to main content

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.
A spec is a structured markdown document that defines user intent at various levels of detail. Specs can be:
  • 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:
Specs start as drafts when first created. Use this status while:
  • Gathering requirements
  • Iterating on design
  • Adding details
  • Getting feedback from agents during implementation
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 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 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:

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.
Specs support two types of references using Obsidian-style syntax:

Issue References

Link to issues that implement parts of the spec:
The [[@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:
The [[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:
This creates a hierarchy:
Use hierarchies to:
  • 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:
  • 0 - Critical (highest priority)
  • 1 - High
  • 2 - Medium (default)
  • 3 - Low
  • 4 - Lowest
Priority affects:
  • 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:
Purpose: Human-editable interface
  • Located in .sudocode/specs/
  • YAML frontmatter + markdown body
  • Edit directly or via CLI
  • Synced to JSONL automatically
Purpose: Source of truth, git-tracked
  • One JSON object per line
  • Contains all spec data
  • Committed to version control
  • Used for distribution via git
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

  • 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
  • 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

1

Start with WHY

Explain the problem you’re solving and why it matters
2

Define clear requirements

Use numbered lists and link to issues as you create them
3

Make design decisions explicit

Document choices and reasoning for future reference
4

Link related specs

Use [[SPEC-XXX]] to connect cross-cutting concerns
5

Keep it evolving

Update specs based on feedback from implementation

Spec vs Issue Decision Matrix

Rule of thumb: If it requires more than one agent session or multiple independent tasks, it’s probably a spec. If it’s a single actionable task, it’s an issue.

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

1

Create the spec

2

Write requirements and design

Edit .sudocode/specs/user-dashboard.md with your requirements
3

Create issues from spec

Use CLI or let an agent create issues linked to the spec:
4

Track implementation feedback

As agents work on issues, they can provide feedback:
5

Iterate and refine

Update spec based on learnings from implementation

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