/claude-dev-kit:spec [ISSUE-NNN | (empty for ad-hoc)] [--rewrite]from claude-dev-kit
Writes a tech spec/RFC document capturing problem, options, trade-offs, decision, migration, and rollback before code is written. Useful for feature planning and enforcing spec-first workflow.
Ships in claude-dev-kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Kit root: ${CLAUDE_PLUGIN_ROOT}
scripts/ dir): prefix every kit script command with it, e.g.
bash <kit-root>/scripts/checkpoint.sh …. Absolute paths also work from worktrees.${…} placeholder above → standalone layout: run commands as written.Run these checks silently at the start. Use results to adapt behavior:
[ -f issues.md ] — if true, this project uses the sprint system. Respect issue numbering and STATUS.md.[ -f docs/sprint_state.md ] — if true and Status shows running, a sprint is active. Be aware of parallel work in worktrees.[ -f docs/prd_digest.md ] — if true, read it for quick project context before starting.gh auth status before any GitHub operation.
Goal: produce a reviewable SPEC document that captures the decision behind a non-trivial feature before code is written. Two callers expect this skill:/spec ISSUE-NNN or /spec (ad-hoc)./implement in sprint mode: auto-invokes this skill for issues flagged Spec-Required: true.Parse $ARGUMENTS:
ISSUE-NNN: this is an issue-linked SPEC. Set mode=linked, issue_id=ISSUE-NNN.--rewrite): this is an ad-hoc SPEC. Set mode=adhoc.--rewrite flag; if present, set rewrite=true.Determine SPEC number:
mode=linked: spec_num = the numeric part of issue_id (e.g., ISSUE-007 → SPEC-007).mode=adhoc: scan docs/specs/ for existing SPEC-NNN.md files, take the max NNN, increment by 1. If no specs exist, start at SPEC-001.Compute target path: docs/specs/SPEC-<NNN>.md.
Check existence:
rewrite=false: refuse with message:
docs/specs/SPEC-NNN.md already exists.
Re-run with --rewrite to regenerate (the previous file will be overwritten).
STOP.rewrite=true: proceed; warn that the previous version will be overwritten.If mode=linked: read the target issue from issues.md:
### ISSUE-NNN: ... section.Read project context files in parallel (skip silently if absent):
docs/architecture.md — current system shape, tech stack.docs/ux_spec.md — UX flows touched by this feature.docs/prd_digest.md or PRD.md — product-level intent.docs/data_model.md — current schema state (relevant when the issue touches data).Grep the codebase for related code:
Open templates/spec.md as the structural reference. Every section must be populated.
Problem: 1–3 sentences. Quote a concrete situation that forces the decision. Avoid abstract framing.
Context: list bounding constraints (prior decisions, deadlines, capacity, external deps). Cite file paths or schema versions where possible.
Options: produce at least 2 named options. Each option MUST have:
+20% write latency, -1 service dep, +3 days impl. Vague phrasing like "more flexible" is rejected at validation time.Decision: explicitly choose one option (**Chosen: Option A**). Cite the specific trade-off line that drove the choice.
Trade-offs Accepted: bullet list of what is deliberately given up.
Migration: ordered steps from current state to target state. If no migration needed, state that explicitly.
Rollback: how to undo this decision. What signal triggers rollback? How long does rollback take?
Open Questions: things deliberately NOT decided here. Each item names an owner and a by-when.
Write the SPEC to docs/specs/SPEC-<NNN>.md.
Run the SPEC validator:
python3 scripts/validate_spec.py docs/specs/SPEC-<NNN>.md
If mode=linked: update the target issue in issues.md so Spec: docs/specs/SPEC-<NNN>.md (was none or absent).
Run the issues validator:
python3 scripts/validate_issues.py issues.md
Verify the issue's Spec: field is satisfied. Report any other warnings to the user but do not block.
docs/specs/SPEC-<NNN>.mdmode=linked: that the issue's Spec: field has been updated.issue/ISSUE-<NNN>-spec branch for spec-only review before /implement runs./implement): just return — /implement continues on the same branch.NEVER:
docs/specs/ and the target issue's metadata.INSTEAD:
When invoked by /implement in sprint mode (env KIT_SPRINT_MODE=1), this skill MUST:
docs(spec): SPEC-<NNN> — <one-line decision summary>./implement once the validator passes.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub pillip/claude-dev-kit --plugin claude-dev-kit23 skills in this plugin
/bizanalysisAnalyzes and critiques business viability. Use after /brainstorm and before /prd./brainstormExplores ideas and defines problems through free-form conversation. Use before /prd when direction is unclear./carefulActivates destructive command warnings for the current session. Use when working in sensitive environments./desktop-uiuxEstablishes a desktop design philosophy based on kickoff outputs, and generates a desktop design system/wireframes/Electron prototype. Recommended flow — /prd → /kickoff → /desktop-uiux/devopsSet up or update CI/CD pipelines, Dockerfiles, and deployment configs, then create a GH Issue + PR./diagnoseAnalyze a bug from error logs or reproduction steps, fix it, and create a GH Issue + PR.Other plugins' skills for the same job