From spellbook
Use when the user asks to "create a spec", "specify a feature or fix", "write a specification", or to plan/record a code change before implementing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spellbook:writing-specsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Drives the creation of a technical specification and emits it as an **XML**
Drives the creation of a technical specification and emits it as an XML
document saved to specs/<slug>/spec.xml. This XML is the planning contract —
readable and versionable — later consumed by the running-spec-dev skill, which
derives tasks.json from it and runs the development loop.
feat or fix before implementing.running-spec-dev.Gather the essentials. Make sure you have:
feat or fix.If something critical is missing and can't be inferred from the code, ask.
Otherwise, record the best hypothesis and mark the requirement with status="hypothesis".
Investigate the code. When the spec touches existing modules, read them and
cite real file:line in <context><reference> — never invent paths.
Fill in the template. Read references/spec_template.xml and produce the spec
by replacing the {placeholders}. Non-negotiable rules:
& < >).R1, R2… for requirements; number="1", "2"… for steps.created).<technology_stack>, <open_questions>) if unused.Save. To specs/<slug>/spec.xml (create the directory). The <slug> is the
spec's identity (the folder carries it, not the file name): kebab-case,
short, and descriptive enough to identify the work on its own — e.g.,
code-reviewer-skill, fix-token-refresh; avoid generic ones like spec,
new-feature, or change. Don't embed the type in the slug (it's already a
spec attribute and becomes the branch feat/<slug>|fix/<slug>). Confirm with
the user before overwriting an existing spec.
Validate (feedback loop). Run:
python "${CLAUDE_PLUGIN_ROOT}/skills/writing-specs/scripts/validate_spec.py" specs/<slug>/spec.xml
Fix and re-validate until the validator exits with code 0. Only then proceed.
Summarize. 2–4 lines of what was specified, plus any open <open_questions>.
If it makes sense, suggest running running-spec-dev pointing at the spec.
spec.xmlRoot <spec type="feat|fix" slug="..." created="YYYY-MM-DD">, with children:
| Tag | Required | Content |
|---|---|---|
<title> | yes | Short, specific title |
<overview> | yes | Prose: problem + desired outcome |
<scope> | yes | <includes> / <excludes> |
<context> | yes | `<reference type="file |
<technology_stack> | no | <item> per relevant dependency/constraint |
<requirements> | yes | testable <requirement id priority status> |
<implementation_steps> | yes | <step number><title><tasks> (becomes tasks.json) |
<success_criteria> | yes | verifiable <criterion id> |
<open_questions> | no | unanswered <question> |
type: feat | fixpriority: high | medium | lowstatus: confirmed | hypothesis | discardedThe canonical template is in references/spec_template.xml.
<implementation_steps> is what becomes trackable tasks: each <step> should have
concrete, orderable tasks (the natural dependency is the order of number).<reference>.npx claudepluginhub iagovrocha/spellbook-agents --plugin spellbookGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.