spec-writer

spec-writer

Transform conversations and ideas into structured technical specifications. Outputs: User stories, acceptance criteria, technical requirements, edge cases. Use when user wants to document requirements before coding. Triggers: write spec, create user stories, document requirements, /spec

2星標
1分支
更新於 1/18/2026
SKILL.md
readonlyread-only
name
spec-writer
description

>

Spec Writer

Transform vague ideas into precise, implementable specifications that Claude Code can execute without ambiguity.

Purpose

Most AI coding failures happen because specifications are unclear. This skill extracts implicit requirements from conversations and outputs structured specs that eliminate guesswork.

Process

Phase 1: Context Extraction

Entry Check

IF user provided: problem statement + target users + success criteria
    → Proceed to Phase 2
ELSE
    → Gather missing information below (one question at a time)

Information Needed

Item Question Why Required
Problem "What problem are you solving?" Defines scope boundaries
Users "Who will use this?" Shapes UX requirements
Success "How will you know it works?" Creates acceptance criteria
Constraints "Any technical/business constraints?" Prevents wasted effort

Transition Criteria

All four items gathered + user confirmed → Phase 2


Phase 2: Requirement Analysis

Entry Check

IF Phase 1 complete:
    → Analyze and categorize requirements
ELSE
    → Return to Phase 1

Categorization Framework

FOR each requirement mentioned:
    Classify as:
    - MUST: Core functionality, non-negotiable
    - SHOULD: Important but has workarounds
    - COULD: Nice to have, time permitting
    - WON'T: Explicitly out of scope (important to document)

Output: Requirements Table

ID Requirement Priority Rationale
R1 [requirement] MUST/SHOULD/COULD [why this priority]

Edge Case Discovery

FOR each MUST requirement:
    Ask: "What happens when [edge case]?"

    Common edge cases to probe:
    - Empty/null inputs
    - Maximum scale (1000x normal)
    - Concurrent access
    - Network failure
    - Permission denied
    - Invalid data format

Phase 3: User Story Generation

Entry Check

IF requirements table complete + edge cases documented:
    → Generate user stories
ELSE
    → Return to Phase 2

Story Format

AS A [user type]
I WANT TO [action]
SO THAT [benefit]

ACCEPTANCE CRITERIA:
- GIVEN [context]
  WHEN [action]
  THEN [expected result]

EDGE CASES:
- [edge case]: [expected behavior]

TECHNICAL NOTES:
- [implementation hints, if relevant]

Story Generation Rules

FOR each MUST requirement:
    → Generate 1 user story
    → Include 2-4 acceptance criteria
    → Include 1-3 edge cases

FOR each SHOULD requirement:
    → Generate 1 user story (simpler format)
    → Include 1-2 acceptance criteria

Phase 4: Technical Specification

Entry Check

IF user stories generated:
    → Ask: "Ready for technical spec, or need to adjust stories first?"

IF user confirms:
    → Generate technical specification
ELSE
    → Revise stories based on feedback

Technical Spec Structure

## Technical Specification: [Feature Name]

### Overview
[1-2 sentences describing the feature]

### Data Models
[If new data structures needed]

### API Endpoints
[If applicable]
| Method | Path | Request | Response |
|--------|------|---------|----------|

### State Changes
[What changes when this feature runs]

### Dependencies
[External services, libraries, existing code]

### Security Considerations
[Auth, validation, rate limits]

### Testing Strategy
- Unit: [what to unit test]
- Integration: [what to integration test]
- E2E: [critical user flows]

Phase 5: Output Delivery

Output Format Selection

IF user's project has existing spec format:
    → Match that format
ELSE IF user specified format preference:
    → Use requested format
ELSE
    → Use default markdown format below

Default Output Structure

# [Feature Name] Specification

## Summary
[One paragraph overview]

## Requirements
[Requirements table from Phase 2]

## User Stories
[Stories from Phase 3]

## Technical Specification
[Spec from Phase 4]

## Out of Scope
[Explicitly excluded items - prevents scope creep]

## Open Questions
[Unresolved items needing decisions]

Self-Check (Read before every response)

□ Am I gathering context or assuming?
→ Missing info = ask, never fill in

□ Am I asking one question at a time?
→ Multiple questions overwhelm users

□ Are requirements testable?
→ Vague requirements = implementation arguments later

□ Did I include edge cases?
→ Happy path only = bugs in production

□ Is the spec implementable by Claude Code?
→ Read it as if you'll code it: any ambiguity?

□ Did I document what's OUT of scope?
→ Scope creep starts with undefined boundaries

□ Are acceptance criteria specific?
→ "Works correctly" is not acceptance criteria
→ "Returns 200 with user object containing id, email" is


Integration with Other Skills

AFTER spec complete:
    Suggest: "Spec ready. Next steps:"
    - "Use /prd to expand into full PRD"
    - "Use architect-planner to design structure"
    - "Start coding with this spec as context"

You Might Also Like

Related Skills

update-docs

update-docs

137Kdev-docs

This skill should be used when the user asks to "update documentation for my changes", "check docs for this PR", "what docs need updating", "sync docs with code", "scaffold docs for this feature", "document this feature", "review docs completeness", "add docs for this change", "what documentation is affected", "docs impact", or mentions "docs/", "docs/01-app", "docs/02-pages", "MDX", "documentation update", "API reference", ".mdx files". Provides guided workflow for updating Next.js documentation based on code changes.

vercel avatarvercel
獲取
docstring

docstring

97Kdev-docs

Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.

pytorch avatarpytorch
獲取
docs-writer

docs-writer

94Kdev-docs

Always use this skill when the task involves writing, reviewing, or editing files in the `/docs` directory or any `.md` files in the repository.

google-gemini avatargoogle-gemini
獲取
write-concept

write-concept

66Kdev-docs

Write or review JavaScript concept documentation pages for the 33 JavaScript Concepts project, following strict structure and quality guidelines

leonardomso avatarleonardomso
獲取
resource-curator

resource-curator

66Kdev-docs

Find, evaluate, and maintain high-quality external resources for JavaScript concept documentation, including auditing for broken and outdated links

leonardomso avatarleonardomso
獲取
doc-coauthoring

doc-coauthoring

47Kdev-docs

Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.

anthropics avataranthropics
獲取