Specification-driven development workflow for AI agents. Use when tasks are too large for a single session, require multi-step implementation, span multiple files/features, or need persistent requirements tracking. Provides structured specification management with token-optimized artifacts for complex feature development, brownfield modifications, and cross-session continuity.
/plugin marketplace add ThilinaTLM/claude-plugin/plugin install thilinatlm-spec-driven-dev-spec-driven-dev@ThilinaTLM/claude-pluginThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Manage complex development tasks through structured specifications that persist across sessions and minimize context overhead.
specs/
├── project.md # Project-level conventions, stack, patterns
├── features/ # Active specifications (source of truth)
│ └── {feature}/
│ ├── spec.md # Requirements + acceptance criteria
│ ├── plan.md # Technical implementation plan
│ ├── tasks.yaml # Task breakdown (YAML format)
│ └── design.md # Architecture decisions (optional)
├── changes/ # Proposed changes (deltas)
│ └── {change-name}/
│ ├── proposal.md # What and why
│ ├── tasks.yaml # Implementation checklist
│ └── specs/ # Spec deltas (additions/modifications)
└── archive/ # Completed changes
Create specs/features/{feature}/spec.md:
# {Feature Name}
## Purpose
One-line description of what this delivers.
## User Stories
### US-1: {Story Title}
AS A {role} I WANT {capability} SO THAT {benefit}
#### Acceptance Criteria
- [ ] GIVEN {context} WHEN {action} THEN {outcome}
- [ ] ...
## Requirements
### REQ-1: {Requirement}
The system SHALL {behavior}.
### REQ-2: {Requirement}
The system MUST {constraint}.
## Out of Scope
- {Explicitly excluded items}
## Open Questions
- [ ] {Unresolved decisions}
Key principles:
Clarifying requirements: Use the AskUserQuestion tool to resolve ambiguities before writing specs. Common clarifications:
Create specs/features/{feature}/plan.md:
# Implementation Plan: {Feature}
## Technical Approach
{High-level architecture decision and rationale}
## Stack/Dependencies
- {framework}: {version} - {purpose}
- {library}: {version} - {purpose}
## Data Model
{Schema changes, new models}
## API Contracts
{Endpoint definitions, request/response shapes}
## Implementation Phases
### Phase 1: {Name}
{Description and components}
### Phase 2: {Name}
{Dependencies on Phase 1}
## Risks & Mitigations
| Risk | Impact | Mitigation |
|------|--------|------------|
| {risk} | {H/M/L} | {strategy} |
Before planning:
Explore the codebase using the Task tool with subagent_type=Explore to understand:
Surface ambiguities by reviewing:
Use AskUserQuestion if exploration reveals architectural decisions that need user input.
Create specs/features/{feature}/tasks.yaml:
feature: feature-name
phases:
- id: 1
name: Phase Name
checkpoint: Validation criteria before Phase 2
tasks:
- id: "1.1"
title: Task Title
files: [src/file.ts]
depends: []
notes: Implementation hints
subtasks:
- text: Implementation
done: false
- text: Tests
done: false
- id: "1.2"
title: Task Title
files: [src/other.ts]
depends: []
parallel: true
subtasks:
- text: Implementation
done: false
- text: Tests
done: false
- id: 2
name: Phase Name
tasks:
- id: "2.1"
title: Task Title
files: [src/file.ts]
depends: ["1.1", "1.2"]
subtasks:
- text: Implementation
done: false
- text: Tests
done: false
Task granularity:
Execute tasks sequentially:
Task with subagent_type=Explore if you need broader context)done: trueSession continuity: Use ${CLAUDE_PLUGIN_ROOT}/cli/dist/spec resume {feature} to load spec + tasks, show progress, and identify next task.
When blocked: Use AskUserQuestion to get user input on implementation decisions rather than making assumptions.
When feature complete:
specs/features/{feature}/ with final statespecs/archive/Always load (minimal context):
Load on demand:
For token-constrained contexts, use compact notation:
## US-1: User Login
AC: [valid-creds→JWT] [invalid→401] [lockout@5-fails]
REQ: SHALL issue JWT on success, MUST hash passwords bcrypt
Save progress atomically:
<!-- specs/features/{feature}/checkpoint.md -->
## Session: {date}
- Completed: 1.1, 1.2, 1.3
- Next: 2.1
- Blockers: None
- Notes: {Context for next session}
For modifications to existing behavior:
specs/changes/{name}/## ADDED Requirements
### REQ-5: Two-Factor Auth
The system MUST require OTP on login.
## MODIFIED Requirements
### REQ-2: Session Duration (was: 24h)
The system SHALL expire sessions after 1h of inactivity.
## REMOVED Requirements
### REQ-3: Remember Me
Deprecated in favor of REQ-5.
The CLI is automatically built when the plugin is installed. Run commands using:
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec [command]
Note: Requires Bun to be installed for the initial build.
| Command | Description |
|---|---|
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec init [name] | Initialize specs/ structure with templates |
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec status | Show all features and their progress |
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec resume {feature} | Show progress + next task + minimal context |
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec next {feature} | Show only next task (minimal output for AI) |
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec mark {feature} {task-id} | Mark task/subtask complete |
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec validate {path} | Check spec completeness, task coverage, dependencies |
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec compact {file} [-o out] | Generate token-optimized version |
All commands output JSON by default, optimized for programmatic parsing.
Get structured data:
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec status # All features as JSON
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec resume {feature} # Progress + next task as JSON
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec next {feature} # Only next task as JSON
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec validate {path} # Validation result as JSON
Minimal output for token efficiency:
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec status -q # Just feature names + percentages
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec resume {feature} -q # Just next task ID + files
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec next {feature} --filesOnly # Just file paths to load
Update progress:
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec mark {feature} {task-id} # Mark all subtasks complete
${CLAUDE_PLUGIN_ROOT}/cli/dist/spec mark {feature} {task-id} --subtask 0 # Mark first subtask complete
| Tool | When to Use |
|---|---|
AskUserQuestion | Clarify requirements, resolve ambiguities, get decisions on implementation choices |
Task with subagent_type=Explore | Understand existing codebase, find patterns, discover affected files |
Task with subagent_type=Plan | Design implementation approach for complex phases |
Principle: Ask early, explore thoroughly. Use AskUserQuestion before making assumptions about requirements. Use Explore agents before planning to understand what exists.