Interactive skill that guides spec creation through structured questioning, auto-detection, and validation. Gathers requirements in 5-7 adaptive questions, generates a complete spec document, validates it, and offers plan generation.
Unified skill that guides spec creation through a structured, interactive process. Wraps progressive-disclosure (requirements gathering), spec-validator (schema validation), and plan-generator (plan from spec) into a single cohesive workflow.
spec-init automates the entire specification creation process:
1. Detects the work type (feature, bug, chore, refactor, docs)
2. Asks 5-7 adaptive questions tailored to the detected type
3. Auto-populates a complete spec document from answers
4. Validates the spec against a standard schema
5. Offers to generate an implementation plan
6. Stores the spec with metadata tracking
**MANDATORY FIRST STEP:**
Read `.claude/context/memory/learnings.md` to leverage previous patterns and decisions.
Ask the user: "What are you building?"
Auto-detect the work type from their description:
Use adaptive questioning based on the detected type. Ask **only the most relevant questions** to minimize user effort while maximizing context quality.
**Domain Selection:**
```
feature → general domain
bug → debugging domain
chore → general domain
refactor → architecture domain
docs → documentation domain
```
**Core Question Set (adapt based on type):**
1. **What's the objective?** (all types)
- For features: "What capability are you adding?"
- For bugs: "What's the current broken behavior?"
- For refactors: "What structure needs improvement?"
2. **Who is impacted?** (features, bugs)
- "Who will use this feature?" / "Who is affected by this bug?"
3. **What's the success metric?** (features, refactors)
- "How will you measure success?"
4. **What's the timeline/urgency?** (all types)
- For bugs: "What's the severity and business impact?"
- For features: "When is this needed?"
5. **What are the acceptance criteria?** (all types)
- "How will you know this is complete and correct?"
6. **What are the constraints?** (if relevant)
- "Are there technical limitations, dependencies, or performance requirements?"
7. **What's out of scope?** (if needed for clarity)
- "What should explicitly NOT be included?"
**Adaptive Stopping Logic:**
Auto-populate this template from the gathered answers:
```markdown
**Title**: [From question 1]
**Type**: [Detected type: feature/bug/chore/refactor/docs]
**Objective**: [User summary from answers]
**User Story**: As a [user type], I want [capability], so that [benefit]
**Acceptance Criteria**:
- **In Scope**: [What's included]
- **Out of Scope**: [What's excluded, from question 7]
(Provide realistic estimates based on scope and complexity)
```
Check the generated spec against these validation rules:
If validation fails, highlight missing sections and ask user to provide missing information.
Store the validated spec to:
```
.claude/context/artifacts/specs/[feature-name]-spec-YYYYMMDD.md
```
Track metadata:
```json
{
"trackId": "[auto-generated-uuid]",
"type": "[detected-type]",
"status": "new",
"created_at": "[ISO-8601-timestamp]",
"title": "[spec-title]",
"path": "[spec-file-path]"
}
```
After spec is saved and validated, ask:
"Spec created and validated! Would you like me to generate an implementation plan?"
**After completing the workflow:**
**Memory Protocol Rule:** If it's not in memory, it didn't happen. Always persist learnings for future invocations.
```
User: "I want to add dark mode to the UI"
Workflow:
1. Detect type = "feature"
2. Ask 5 adaptive questions:
- What UI components need dark mode?
- Who are the target users?
- How will users toggle between modes?
- Any accessibility requirements?
- How will you validate it works correctly?
3. User answers in <5 minutes
4. Generate complete spec with all sections
5. Validate spec (all sections present, 3+ criteria)
6. Save to .claude/context/artifacts/specs/dark-mode-spec-20260202.md
7. Offer plan generation
```
```
User: "There's a memory leak in the scheduler"
Workflow:
1. Detect type = "bug"
2. Ask 5 debugging-focused questions:
- What are the reproduction steps?
- What's the expected vs actual behavior?
- What's the business impact and severity?
- Are there any error logs or stack traces?
- How will you verify the fix?
3. Generate bug fix spec with Problem Statement, Root Cause (if known), and Fix Approach
4. Validate and save
5. Offer plan generation for fix implementation
```
```
User: "Reorganize the authentication module"
Workflow:
1. Detect type = "refactor"
2. Ask 6 architecture-focused questions:
- What's the current structure and its problems?
- What's the target architecture?
- What are the performance or maintainability goals?
- What are the risks of this refactor?
- How will you ensure no regressions?
- What's out of scope?
3. Generate refactor spec with clear before/after architecture
4. Validate and save
5. Offer plan generation
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/spec-init/raw