Spec Management Skill
CRITICAL: The description field above controls when Claude auto-loads this skill.
Overview
Provides comprehensive specification management capabilities including spec creation, status tracking, validation, searching, and template-based documentation. Manages feature specifications in the specs/ directory with consistent numbering, metadata, and status tracking.
Instructions
Creating New Specifications
- Use
scripts/create-spec.sh <spec-name> [description] to create new numbered specs
- Automatically assigns next available spec number (e.g., 001-feature-name.md)
- Generates spec with complete frontmatter and all sections
- Initializes status as "draft" with creation timestamp
- Creates organized directory structure if needed
Listing Specifications
- Use
scripts/list-specs.sh [--status STATUS] [--format FORMAT] to list all specs
- Displays specs with number, title, status, priority, and last modified date
- Filter by status: draft, in-progress, review, approved, implemented, rejected
- Output formats: table (default), json, markdown, csv
- Sorted by spec number with color-coded status indicators
Validating Specifications
- Use
scripts/validate-spec.sh <spec-file> to check spec completeness
- Validates frontmatter: title, status, priority, owner, tags
- Checks required sections: Problem, Solution, Requirements, Tasks, Success Criteria
- Verifies task breakdown format and numbering
- Generates validation report with warnings and errors
Updating Spec Status
- Use
scripts/update-status.sh <spec-file> <new-status> to change spec status
- Valid statuses: draft, in-progress, review, approved, implemented, rejected
- Updates status timestamp and maintains status history
- Optionally adds status change comment
- Validates status transition rules
Searching Specifications
- Use
scripts/search-specs.sh <query> [--section SECTION] to search spec content
- Searches across all specs or within specific sections
- Supports regex patterns and multi-word queries
- Displays matches with context and spec location
- Filter by tags, status, or priority
Available Scripts
- create-spec.sh: Create new numbered specification with template
- list-specs.sh: List all specifications with filtering and formatting
- validate-spec.sh: Validate spec completeness and format
- update-status.sh: Update specification status with history tracking
- search-specs.sh: Search specification content with context
Templates
- spec-template.md: Complete specification template with all standard sections
- spec-metadata.yaml: Frontmatter template with all metadata fields
- task-breakdown-template.md: Task list format with subtasks and estimates
- requirements-template.md: Requirements documentation format (functional, non-functional, constraints)
- success-criteria-template.md: Success metrics and acceptance criteria format
Examples
See examples/ directory for detailed usage examples:
example-spec-simple.md - Simple feature specification with basic sections
example-spec-complex.md - Complex feature with detailed technical design
example-spec-ai-feature.md - AI/ML feature specification with model details
example-validation-report.md - Example validation output with errors and warnings
example-spec-list.md - Example list command output in different formats
Specification Structure
Required Frontmatter
---
spec-id: 001
title: Feature Name
status: draft
priority: medium
owner: team-name
created: 2025-01-15
updated: 2025-01-15
tags: [category, feature-type]
---
Required Sections
- Problem Statement - What problem are we solving?
- Proposed Solution - How will we solve it?
- Requirements - Functional, non-functional, constraints
- Technical Design - Architecture, components, data models
- Task Breakdown - Numbered tasks with estimates
- Success Criteria - Measurable outcomes and acceptance criteria
- Dependencies - External dependencies and blockers
- Timeline - Estimated schedule and milestones
- Risks - Potential risks and mitigation strategies
Status Workflow
draft → in-progress → review → approved → implemented
↓
rejected
Validation Rules
Frontmatter Validation
- Spec ID must be numeric and unique
- Status must be valid enum value
- Priority must be: low, medium, high, critical
- Owner must be specified
- Created and updated dates must be valid ISO dates
- Tags must be non-empty array
Content Validation
- All required sections must be present
- Each section must have content (not empty)
- Task breakdown must have numbered tasks
- Requirements must be categorized
- Success criteria must be measurable
Warnings
- Long spec (>1000 lines) may need splitting
- Missing optional sections (e.g., Alternatives Considered)
- Outdated spec (not updated in >30 days)
- Tasks without estimates
- Vague success criteria
Directory Structure
Phase-Nested Structure (Recommended)
Specs are organized in phase directories based on dependencies:
specs/
├── phase-0/ # Features with no dependencies
│ ├── F001-core-data/
│ │ ├── spec.md
│ │ └── tasks.md
│ └── F002-base-api/
├── phase-1/ # Features depending on Phase 0
│ ├── F003-user-auth/
│ └── F004-chat-system/
├── phase-2/ # Features depending on Phase 1
│ └── F005-analytics/
└── infrastructure/ # Infrastructure specs (not phased)
└── 001-database/
Phase Calculation
Phase is calculated automatically based on dependencies:
- Phase 0: No dependencies (foundation features)
- Phase N: max(dependency phases) + 1
Example: F003 depends on F001 (phase 0) and F002 (phase 0) → F003 is Phase 1
Naming Convention
- Format:
F{XXX}-{feature-slug}/
- Numbering: Zero-padded 3-digit IDs (F001, F002, ..., F050, F100)
- Slug: kebab-case, 2-4 words max
- Numbers are never reused. Deleted specs leave gaps in numbering.
Legacy Flat Structure
For backward compatibility, the system also supports:
specs/
├── features/
│ ├── 001-feature-name/
│ └── 002-another-feature/
└── infrastructure/
└── 001-component/
The system checks phase-nested first, then falls back to legacy structure.
Integration
This skill is used by:
planning:create-spec command - Create new feature specifications
planning:review-specs command - Review and validate all specs
planning:track-progress command - Track feature implementation progress
- All development agents - Reference specs for implementation guidance
- Project management tools - Export spec data for tracking
Best Practices
- Keep specs focused - One feature per spec
- Update status regularly - Reflect current development state
- Link related specs - Reference dependencies between specs
- Include examples - Add code samples and mockups
- Review before approval - Validate with team before implementation
- Archive old specs - Move implemented specs to archive/
- Use consistent tags - Maintain tag taxonomy for filtering
- Write measurable criteria - Success criteria must be testable
Purpose: Comprehensive specification management for feature documentation
Used by: Planning agents, development teams, project managers
1---2name: spec-management-33description: Templates, scripts, and examples for managing feature specifications in specs/ directory. Use when creating feature specs, listing specifications, validating spec completeness, updating spec status, searching spec content, organizing project requirements, tracking feature development, managing technical documentation, or when user mentions spec management, feature specifications, requirements docs, spec validation, or specification organization.4---5
6# Spec Management Skill
7
8**CRITICAL: The description field above controls when Claude auto-loads this skill.**
9
10## Overview
11
12Provides comprehensive specification management capabilities including spec creation, status tracking, validation, searching, and template-based documentation. Manages feature specifications in the `specs/` directory with consistent numbering, metadata, and status tracking.
13
14## Instructions
15
16### Creating New Specifications
17
181. Use `scripts/create-spec.sh <spec-name> [description]` to create new numbered specs
192. Automatically assigns next available spec number (e.g., 001-feature-name.md)
203. Generates spec with complete frontmatter and all sections
214. Initializes status as "draft" with creation timestamp
225. Creates organized directory structure if needed
23
24### Listing Specifications
25
261. Use `scripts/list-specs.sh [--status STATUS] [--format FORMAT]` to list all specs
272. Displays specs with number, title, status, priority, and last modified date
283. Filter by status: draft, in-progress, review, approved, implemented, rejected
294. Output formats: table (default), json, markdown, csv
305. Sorted by spec number with color-coded status indicators
31
32### Validating Specifications
33
341. Use `scripts/validate-spec.sh <spec-file>` to check spec completeness
352. Validates frontmatter: title, status, priority, owner, tags
363. Checks required sections: Problem, Solution, Requirements, Tasks, Success Criteria
374. Verifies task breakdown format and numbering
385. Generates validation report with warnings and errors
39
40### Updating Spec Status
41
421. Use `scripts/update-status.sh <spec-file> <new-status>` to change spec status
432. Valid statuses: draft, in-progress, review, approved, implemented, rejected
443. Updates status timestamp and maintains status history
454. Optionally adds status change comment
465. Validates status transition rules
47
48### Searching Specifications
49
501. Use `scripts/search-specs.sh <query> [--section SECTION]` to search spec content
512. Searches across all specs or within specific sections
523. Supports regex patterns and multi-word queries
534. Displays matches with context and spec location
545. Filter by tags, status, or priority
55
56## Available Scripts
57
58- **create-spec.sh**: Create new numbered specification with template
59- **list-specs.sh**: List all specifications with filtering and formatting
60- **validate-spec.sh**: Validate spec completeness and format
61- **update-status.sh**: Update specification status with history tracking
62- **search-specs.sh**: Search specification content with context
63
64## Templates
65
66- **spec-template.md**: Complete specification template with all standard sections
67- **spec-metadata.yaml**: Frontmatter template with all metadata fields
68- **task-breakdown-template.md**: Task list format with subtasks and estimates
69- **requirements-template.md**: Requirements documentation format (functional, non-functional, constraints)
70- **success-criteria-template.md**: Success metrics and acceptance criteria format
71
72## Examples
73
74See `examples/` directory for detailed usage examples:
75- `example-spec-simple.md` - Simple feature specification with basic sections
76- `example-spec-complex.md` - Complex feature with detailed technical design
77- `example-spec-ai-feature.md` - AI/ML feature specification with model details
78- `example-validation-report.md` - Example validation output with errors and warnings
79- `example-spec-list.md` - Example list command output in different formats
80
81## Specification Structure
82
83### Required Frontmatter
84```yaml
85---
86spec-id: 001
87title: Feature Name
88status: draft
89priority: medium
90owner: team-name
91created: 2025-01-15
92updated: 2025-01-15
93tags: [category, feature-type]
94---
95```
96
97### Required Sections
981. **Problem Statement** - What problem are we solving?
992. **Proposed Solution** - How will we solve it?
1003. **Requirements** - Functional, non-functional, constraints
1014. **Technical Design** - Architecture, components, data models
1025. **Task Breakdown** - Numbered tasks with estimates
1036. **Success Criteria** - Measurable outcomes and acceptance criteria
1047. **Dependencies** - External dependencies and blockers
1058. **Timeline** - Estimated schedule and milestones
1069. **Risks** - Potential risks and mitigation strategies
107
108### Status Workflow
109```
110draft → in-progress → review → approved → implemented
111 ↓
112 rejected
113```
114
115## Validation Rules
116
117### Frontmatter Validation
118- Spec ID must be numeric and unique
119- Status must be valid enum value
120- Priority must be: low, medium, high, critical
121- Owner must be specified
122- Created and updated dates must be valid ISO dates
123- Tags must be non-empty array
124
125### Content Validation
126- All required sections must be present
127- Each section must have content (not empty)
128- Task breakdown must have numbered tasks
129- Requirements must be categorized
130- Success criteria must be measurable
131
132### Warnings
133- Long spec (>1000 lines) may need splitting
134- Missing optional sections (e.g., Alternatives Considered)
135- Outdated spec (not updated in >30 days)
136- Tasks without estimates
137- Vague success criteria
138
139## Directory Structure
140
141### Phase-Nested Structure (Recommended)
142
143Specs are organized in phase directories based on dependencies:
144
145```
146specs/
147├── phase-0/ # Features with no dependencies
148│ ├── F001-core-data/
149│ │ ├── spec.md
150│ │ └── tasks.md
151│ └── F002-base-api/
152├── phase-1/ # Features depending on Phase 0
153│ ├── F003-user-auth/
154│ └── F004-chat-system/
155├── phase-2/ # Features depending on Phase 1
156│ └── F005-analytics/
157└── infrastructure/ # Infrastructure specs (not phased)
158 └── 001-database/
159```
160
161### Phase Calculation
162
163Phase is calculated automatically based on dependencies:
164- **Phase 0**: No dependencies (foundation features)
165- **Phase N**: max(dependency phases) + 1
166
167Example: F003 depends on F001 (phase 0) and F002 (phase 0) → F003 is Phase 1
168
169### Naming Convention
170
171- **Format**: `F{XXX}-{feature-slug}/`
172- **Numbering**: Zero-padded 3-digit IDs (F001, F002, ..., F050, F100)
173- **Slug**: kebab-case, 2-4 words max
174- Numbers are never reused. Deleted specs leave gaps in numbering.
175
176### Legacy Flat Structure
177
178For backward compatibility, the system also supports:
179```
180specs/
181├── features/
182│ ├── 001-feature-name/
183│ └── 002-another-feature/
184└── infrastructure/
185 └── 001-component/
186```
187
188The system checks phase-nested first, then falls back to legacy structure.
189
190## Integration
191
192This skill is used by:
193- `planning:create-spec` command - Create new feature specifications
194- `planning:review-specs` command - Review and validate all specs
195- `planning:track-progress` command - Track feature implementation progress
196- All development agents - Reference specs for implementation guidance
197- Project management tools - Export spec data for tracking
198
199## Best Practices
200
2011. **Keep specs focused** - One feature per spec
2022. **Update status regularly** - Reflect current development state
2033. **Link related specs** - Reference dependencies between specs
2044. **Include examples** - Add code samples and mockups
2055. **Review before approval** - Validate with team before implementation
2066. **Archive old specs** - Move implemented specs to archive/
2077. **Use consistent tags** - Maintain tag taxonomy for filtering
2088. **Write measurable criteria** - Success criteria must be testable
209
210---
211
212**Purpose**: Comprehensive specification management for feature documentation
213**Used by**: Planning agents, development teams, project managers