Spec Writer
by @lgyanami
Generate structured implementation spec documents for coding projects or features. Use when a user provides a requirement, feature idea, bug description, or...
clawhub install spec-writerπ About This Skill
name: spec-writer description: Generate structured implementation spec documents for coding projects or features. Use when a user provides a requirement, feature idea, bug description, or GitHub issue and needs a spec before implementation. Produces a spec document covering objectives, user stories, technical plan, boundaries, verification criteria, and task breakdown β ready to hand off to a coding agent or human developer. Triggers on "write a spec", "draft a spec", "create an implementation plan", "spec this out", or any request to formalize requirements into a structured document. NOT for actually implementing code (use dev-workflow for that).
Spec Writer β Structured Implementation Spec Generator
Generate high-quality, AI-agent-friendly spec documents from vague requirements.
When to Use
Output
A single Markdown spec document saved to the project directory (default: SPEC.md or spec/).
Workflow
Step 1: Gather Context
Collect information from available sources. Do not ask the user for things you can find yourself.
From the user's input:
From the project (if accessible):
From external sources (if referenced):
Step 2: Draft the Spec
Use the spec template at references/spec-template.md. Read it before generating.
Fill every section based on gathered context. Key principles:
Step 3: Review with User
Present the draft to the user. Common discussion points:
Revise until the user confirms. Mark status as "β Confirmed" when approved.
Step 4: Save and Deliver
Save the confirmed spec to the project. Suggested locations:
SPEC.md in project rootspec/.md Tell the user the spec is ready and suggest next steps:
Adapting to Project Scale
Small task (bug fix, small feature):
Medium task (feature, refactor):
Large task (new module, major feature):
Principles
These come from industry best practices (GitHub's study of 2,500+ agent files, Anthropic's context engineering research, and practical spec-driven development patterns):
1. Spec is the source of truth β It persists across sessions, anchoring the agent when context gets long or sessions restart.
2. Structure for parseability β Clear Markdown headings, consistent format. AI models handle well-structured text better than free-form prose.
3. Six core areas β Commands, Testing, Project Structure, Code Style, Git Workflow, Boundaries. Use as a completeness checklist.
4. Three-tier boundaries β β Always do (proceed without asking) / β οΈ Ask first (need human approval) / π« Never do (hard stop). More effective than flat rule lists.
5. Modularity β Each section should be independently useful. A coding agent working on the backend doesn't need the frontend spec section in its context.
6. Living document β Update the spec when decisions change. An outdated spec is worse than no spec.