Spec-Driven Development Plugin
A structured workflow plugin for Claude Code & Codex that transforms feature ideas into formal specifications before implementation.
Overview
This plugin guides you through three phases:
- Requirements - User stories with EARS notation and acceptance criteria
- Design - Technical architecture, sequence diagrams, implementation considerations
- Tasks - Discrete, trackable implementation items that mirror to Claude Code's todo system
Commands
Commands use / prefix in Claude Code and $ prefix in Codex.
Core Workflow
| Claude Code | Codex | Description |
|---|
/spec-brainstorm | $spec-brainstorm | Brainstorm a feature idea before spec creation |
/spec <name> | $spec <name> | Start a new feature spec with interactive 3-phase workflow |
/spec-bugfix <name> | $spec-bugfix <name> | Start a new bugfix spec with defect analysis and regression prevention |
/spec-refine | $spec-refine | Refine requirements/design for current spec |
/spec-tasks | $spec-tasks | Regenerate tasks from updated spec |
/spec-status | $spec-status | Show spec progress, task completion, and dependency status |
/spec-validate | $spec-validate | Validate spec completeness and consistency |
Research & Navigation
| Claude Code | Codex | Description |
|---|
/research | $research | Deep parallel research before planning — searches docs, web, and codebase |
/zoom-out | $zoom-out | Map modules, interfaces, and callers for unfamiliar code |
/ubiquitous-language | $ubiquitous-language | Extract domain terms into a canonical glossary with flagged ambiguities |
Implementation
| Claude Code | Codex | Description |
|---|
/spec-exec | $spec-exec | Run one autonomous implementation iteration |
/spec-loop | $spec-loop | Loop implementation until all tasks complete |
Post-Completion (Optional)
| Claude Code | Codex | Description |
|---|
/spec-accept | $spec-accept | Run user acceptance testing for formal sign-off |
/spec-docs | $spec-docs | Generate documentation from spec and implementation |
/spec-release | $spec-release | Generate release notes and deployment checklist |
/spec-verify | $spec-verify | Run post-deployment smoke tests |
/spec-retro | $spec-retro | Run a retrospective on a completed spec |
/spec-complete | $spec-complete | Run full post-completion pipeline (accept → docs → release → retro) |
Usage
Starting a New Spec
Claude Code:
/spec user-authentication
Codex:
$spec user-authentication
This will:
- Create
.claude/specs/user-authentication/ directory
- Gather requirements interactively (2-3 rounds of questions)
- Guide you through Design phase (architecture docs)
- Generate Tasks with explicit status, wiring, verification, and dependencies
Spec Files Location
Specs are stored in .claude/specs/<feature-name>/ by default. Existing .codex/specs/<feature-name>/ directories are supported as a migration fallback, or set SPEC_ROOT explicitly:
.claude/specs/user-authentication/
├── requirements.md # User stories with acceptance criteria
├── design.md # Architecture and implementation plan
└── tasks.md # Trackable implementation tasks
Cross-Spec Dependencies
Specs can declare dependencies on other specs via a ## Depends On section in requirements.md:
## Depends On
- auth-system
- database-migrations
Execution scripts check dependencies before running. A dependency is considered complete when all its tasks are verified. /spec-status shows dependency status.
Implementation
After creating a spec, run autonomous implementation:
# single task
bash scripts/spec-exec.sh --spec-name user-authentication
# loop until all tasks complete
bash scripts/spec-loop.sh --spec-name user-authentication --max-iterations 20
Scripts live in the plugin's scripts/ directory. If only one spec exists, --spec-name is auto-detected.
Post-Completion (Optional)
After implementation completes, optionally run:
# user acceptance testing
bash scripts/spec-accept.sh --spec-name user-authentication
# generate documentation
bash scripts/spec-docs.sh --spec-name user-authentication
# release notes and deployment checklist
bash scripts/spec-release.sh --spec-name user-authentication
# post-deployment smoke tests
bash scripts/spec-verify.sh --spec-name user-authentication --url https://staging.example.com
# retrospective analysis
bash scripts/spec-retro.sh --spec-name user-authentication
# or run all at once
bash scripts/spec-complete.sh --spec-name user-authentication
Checkpoint Recovery