Loading...
Loading...
Structured specification with explicit scope boundaries: user stories, acceptance criteria, out-of-scope definition, risks, and estimation. Positions before feature-design in the feature lifecycle pipeline. Use when: "write spec", "user stories", "define requirements", "scope this", "what should this do", "acceptance criteria", "define scope"
npx skill4agent add notque/claude-code-toolkit spec-writer.feature/SPEC.md# Spec: [Feature Name]
## 1. User Stories
> Max 7 stories. Each has single responsibility.
- **US-1**: As a [role], I want [action] so that [benefit].
- **US-2**: As a [role], I want [action] so that [benefit].
## 2. Acceptance Criteria
> 2-5 criteria per story. All must be verifiable.
### US-1: [Story title]
- GIVEN [context] WHEN [action] THEN [result]
- GIVEN [context] WHEN [action] THEN [result]
### US-2: [Story title]
- GIVEN [context] WHEN [action] THEN [result]
## 3. Out of Scope
> Minimum 3 items. Each states WHY it is excluded.
This feature does NOT:
- [ ] Handle X (deferred to future work because Y)
- [ ] Support Y (explicitly excluded because Z)
- [ ] Replace Z (existing solution remains because W)
## 4. Risks & Assumptions
| Risk/Assumption | Impact | Mitigation |
|-----------------|--------|------------|
| Assumption could be wrong | What breaks | How to detect/recover |
| External dependency blocks | Delay estimate | Fallback plan |
## 5. Estimation
| Dimension | Assessment | Justification |
|-----------|------------|---------------|
| T-shirt size | S / M / L / XL | Why this size |
| Files changed | ~N files | Which areas of codebase |
| Testing complexity | Low / Medium / High | What makes testing easy or hard |.feature/.feature/SPEC.mdSPEC.mdSpec saved to [path]. Run /feature-design to begin design exploration.| Error | Cause | Solution |
|---|---|---|
| Cannot identify target users | Vague feature request | Ask user to describe who benefits and how |
| More than 7 stories | Scope too broad | Decompose into multiple specs, one per coherent capability |
| Cannot list 3 out-of-scope items | Scope not yet defined | Brainstorm adjacent features, related capabilities, and future enhancements that are NOT part of this work |
| Acceptance criteria use subjective language | "fast", "easy", "intuitive" | Replace with measurable assertion: latency threshold, click count, error rate |
| Anti-Pattern | Why Wrong | Do Instead |
|---|---|---|
| Kitchen sink spec (>7 stories) | Scope is too broad to implement or validate coherently | Decompose into multiple specs, prioritize |
| Empty out-of-scope | If nothing is excluded, everything is included -- that is a scope problem | Force 3+ exclusions with reasoning |
| Untestable criteria | "Should be user-friendly" becomes an opinion debate during review | Use measurable assertions: "<3 clicks", "<200ms", "zero data loss" |
| Spec as implementation | Spec says WHAT, not HOW. Code and schemas belong in feature-design | Remove implementation details, keep behavioral descriptions |
spec-writer (SPEC.md)
--> feature-design (reads stories + scope boundaries)
--> feature-plan (reads acceptance criteria for test requirements)
--> feature-implement
--> feature-validate (checks acceptance criteria as quality gates)
--> feature-release