What to do when this skill is invoked
When the user invokes /spec-init, they will provide a description of the feature they want to plan (e.g., "Add real-time notifications", "Fix performance in search results").
Your job is to:
- •Parse the feature description - Extract the key feature name/topic from what the user provided
- •Count existing specs - Check
.claude/specs/to find the highest numbered spec - •Generate a spec filename - Convert the feature description to a valid markdown filename in kebab-case with an incrementing numeric prefix (e.g.,
01-add-real-time-notifications.md,02-fix-performance-search.md) - •Create the spec file - Create
.claude/specs/{filename}.mdwith the template below - •Pre-fill basic info - Add the feature description/title at the top
- •Leave placeholders - Keep all sections as scaffolding for the user to fill in
Spec Template to use
Use this exact template structure (with placeholders as shown):
markdown
# {Feature Title/Name}
> Based on: {Brief description from user input}
## 1. Problem Statement
- What problem does this solve?
- Who is affected?
- What happens if we don't solve it?
## 2. Proposed Solution
- High-level description of the approach
- Key user-facing behavior changes
## 3. Acceptance Criteria
- [ ] Given [context], when [action], then [result]
- [ ] ...
## 4. Technical Design
- Components/modules affected
- New interfaces or APIs needed
- Data flow changes
## 5. Dependencies & Risks
- External dependencies
- Breaking changes
- Edge cases to handle
## 6. Out of Scope
Explicitly list what this does NOT include to prevent scope creep.
## 7. Implementation Steps
Ordered list of discrete, mergeable chunks:
1. Step one (what it delivers)
2. Step two (what it delivers)
...
---
> **To refine this spec:** Use `/spec-refine` or simply comment on what you'd like to change. Claude will understand you're working on this spec.
Key points
- •Use the Write tool to create the file in
.claude/specs/ - •Pre-fill only the title/description at the top - leave the rest as placeholders
- •Output a confirmation message showing the file path and next steps
- •Suggest that the user can edit it directly or use
/spec-refineto flesh out details with codebase research - •Do NOT ask for confirmation - just create the file immediately. The user can always edit or refine afterward.