Skip to main content

Syntax

Description

The spec create command creates a new specification document in your sudocode project. Specs are the first tier in sudocode’s abstraction structure, capturing what you want to build (user intent) rather than how to implement it. When you create a spec, sudocode:
  • Generates a unique spec ID (e.g., SPEC-001, SPEC-002)
  • Creates a markdown file in .sudocode/specs/ directory
  • Adds the spec to the SQLite database
  • Exports to JSONL for version control
  • Applies any tags you specify
Specs are version-controlled artifacts that live alongside your code. They evolve based on feedback from implementation.

Arguments

string
required
The title of your specExample: "Authentication System Design"The title should be clear and descriptive. It will be used to generate the markdown filename if --file-path is not specified.

Options

number
default:"2"
Priority level (0-4, where 0 is highest)Example: --priority 1Priority levels:
  • 0 - Critical (highest priority)
  • 1 - High
  • 2 - Medium (default)
  • 3 - Low
  • 4 - Lowest
string
Initial description/content for the specExample: --description "This spec defines our OAuth 2.0 implementation"This becomes the markdown content below the frontmatter. You can edit the markdown file later to add more detail.
string
Custom file path for the markdown fileExample: --file-path "auth-oauth2.md"If not provided, sudocode generates a filename based on the title. The path is relative to .sudocode/specs/.
string
Parent spec ID for hierarchical organizationExample: --parent SPEC-001Use this to create child specs under a parent spec, enabling hierarchical organization of related specifications.
string
Comma-separated tags for organizationExample: --tags "auth,security,backend"Tags help with filtering and organizing specs. Use commas to separate multiple tags (no spaces).

Examples

Basic Spec Creation

Create a simple spec with default priority:
This creates:
  • Spec ID: SPEC-001
  • File: .sudocode/specs/authentication-system.md
  • Priority: 2 (default)
  • Empty content

Spec with Description and Priority

Create a high-priority spec with initial content:
The markdown file will contain:

Hierarchical Spec (Child Spec)

Create a child spec under a parent:
This creates a hierarchy:

Spec with Tags

Create a spec with multiple tags for organization:
The markdown file includes tags in the frontmatter:

Custom File Path

Specify a custom filename:

After Creating a Spec

After creating your spec, you can:

Edit the Spec

View Spec Details

Create Implementation Issues

Add to Parent Spec

Spec File Structure

Created specs have this structure:
The markdown file contains YAML frontmatter + content:

Common Workflows

Creating a Feature Spec

1

Create the spec

2

Edit with details

Edit .sudocode/specs/user-dashboard.md to add:
  • Requirements
  • Design decisions
  • Open questions
3

Create implementation issues

Creating an Architecture Spec

1

Create parent spec

2

Create child specs

3

View hierarchy

JSON Output

Use the global --json flag for machine-readable output:

Common Questions

No, spec IDs are immutable and generated sequentially. They ensure stable references across the system.
The --description flag sets initial content when creating the spec. After creation, you typically edit the markdown file directly for more detailed content.
Create a spec if:
  • It requires multiple independent tasks
  • It’s strategic/architectural
  • It captures WHAT to build
Create an issue if:
  • It’s a single actionable task
  • It captures HOW to implement
  • An agent can complete it in one session
Yes! Specs can exist independently. You create issues from specs as you plan implementation.

Troubleshooting

Cause: No .sudocode/ directory foundSolution:
Cause: Priority must be 0-4Solution:
Cause: The markdown file is created in .sudocode/specs/, not the current directorySolution:

spec list

List all specs with filtering

spec show

View spec details

spec update

Update existing spec

issue create

Create implementation issues

link

Link specs to issues

init

Initialize sudocode project

Next Steps

1

Create your first spec

2

Edit the spec content

Add requirements, design decisions, and questions
3

Create implementation issues

4

Track implementation

Specs Concept Guide

Learn more about specs and their role in sudocode’s abstraction structure