/feature-dev:spec <feature or project description> | --publish <SPEC> new|#N|owner/repo#N|URLfrom feature-dev
Creates a structured specification for ambiguous features or non-obvious scope changes. Supports publishing specs as GitHub issues via --publish flag.
Ships in feature-dev. Installing the plugin adds it to Claude Code.
git branch --show-currentgit log --oneline -5jq -r '.permissions.additionalDirectories[]? // empty' .claude/settings.local.json 2>/dev/null || truetest -f ../CLAUDE.md && echo "../CLAUDE.md exists (read for repo catalog)" || echo "no ../CLAUDE.md".feature-dev/features/<slug>/, managed by ${CLAUDE_PLUGIN_ROOT}/scripts/features.py (pass --root <repo root>). Layout: artifact-locations.md.${user_config.spec_store} (a literal ${user_config...} here means file).bash "${CLAUDE_PLUGIN_ROOT}/scripts/args.sh" '$ARGUMENTS'<best_practices> @feature-dev/skills/spec-driven-development/SKILL.md </best_practices>
First, check for --publish <SPEC> <target>. --publish is a flag the parser does not know, so it stays in positional: when positional[0] is --publish, positional[1] is <SPEC> and positional[2] is <target>. Go straight to Publish Mode below — it skips the authoring phases (Specify, Handoff) entirely and never reads the rest of the arguments as a feature description. Otherwise, continue below.
Then read the description. positional, joined with spaces, is the feature description. --with-tasks was removed in 3.0.0: if it is there, drop it and say in one line that the plan comes from /feature-dev:explore-plan (or, for a small feature, /feature-dev:tdd straight from the ACs). If the Arguments line in Context is a shell error instead of JSON (an apostrophe in the description does that: "the user's profile"), read the description from the bold line below and strip the flags by hand.
You are creating a structured specification for the feature description left after stripping flags: $ARGUMENTS
This command ends at the spec: Phase 1, then Handoff. It never writes an implementation plan or a task list: the step-level plan is /feature-dev:explore-plan's job, and a second plan inside the spec drifts from the one explore-plan derives from the code.
Phase 1 requires user approval before Handoff.
Detect multi-repo scope (runs silently — feeds the recommendation in step 2). A feature is multi-repo only when the description clearly spans concerns owned by different repos (e.g., "API + UI", "service + worker"). Confirm that first, then corroborate with at least one infrastructure signal:
additionalDirectories (Context block above) lists sibling repos as accessible.../CLAUDE.md exists and catalogs sibling repos with their purpose — read it to learn the repo set.Recommend multi-repo only when A AND (B OR C) hold. additionalDirectories alone is a false positive (users grant access for reference, not feature scope). Detection only shapes the recommended option in step 2; the scope answer decides. If the answer names two or more repos, the multi-repo sections (frontmatter repos:, "Cross-Repo Contracts", "Decisions Log") are in for the rest of this command, whatever detection concluded; if it leaves one repo in, they are out.
Ask the scope question — first, and on its own. Before surfacing assumptions and before reading any code, ask one AskUserQuestion with a single question: which repos and components are in, and what is explicitly out. Offer a recommended option inferred from the description and step 1 (e.g. " API + page; out: admin UI, other tenants") and one or two real alternatives — a narrower and a wider cut. Record what the answer rules out: it becomes the spec's ## Non-Goals.
Scope goes first because everything after it is sized by it: a scope change after approval (a backend endpoint added, "not tied to one customer") has meant re-planning. It goes alone because a scope question bundled with other questions gets answered last — one sat unanswered for almost 7 hours.
Surface assumptions. Now list 3-5 assumptions about the tech stack, architecture, and behavior within the agreed scope, and ask about them in their own round-trip, after the scope answer. Each assumption is one question so each can be answered on its own:
Reframe vague requirements. If the input is vague, translate it into concrete, testable success criteria. Present these to the user for validation.
Write the spec following spec-template.md — Read it now; it is the only definition of the sections, their order and their id rules. In short: Objective, Non-Goals, Business Rules (BR-n), Acceptance Criteria (AC-n, citing the rules they exercise), QA Checklist, Boundaries, plus Cross-Repo Contracts and Decisions Log when multi-repo. Write the rules before the criteria: a criterion that exercises no rule and states no error case is often a rule that was never named. Do not write commands, file layout, code conventions or a test strategy — the plan derives those from the code.
Save the spec to the path ${CLAUDE_PLUGIN_ROOT}/scripts/features.py new <feature-slug> --kind spec --root <repo root> prints (.feature-dev/features/<feature-slug>/SPEC-<feature-slug>.md); this is the spec path used below. The script creates the feature as a draft. If it refuses because the feature already exists, you are revising: edit the existing SPEC in place. Before editing a spec the user has already seen, snapshot it once per review round with ${CLAUDE_PLUGIN_ROOT}/scripts/review_server.py snapshot <spec path> — it copies the file to .feature-dev/features/<feature-slug>/history/SPEC-<feature-slug>.<n>.md, which /feature-dev:review diffs against; without it nobody can see what changed between versions. Refuse an old-layout path: if $ARGUMENTS or a spec path points outside .feature-dev/features/ (a root SPEC-*.md, or the layout older than 2.0.0), refuse it in one line and name .feature-dev/features/<slug>/ as the only place specs live. The file begins with the template's frontmatter block.
The feature's state (draft, approved, implemented) lives in feature.json, not in the frontmatter: after the user validates the spec in step 8, run ${CLAUDE_PLUGIN_ROOT}/scripts/features.py approve <feature-slug> --root <repo root>.
Update .gitignore. Run git check-ignore -q .feature-dev first: exit 0 means the folder is already excluded (by .gitignore, or by .git/info/exclude as a headless caller sets it) and nothing is edited. Otherwise add .feature-dev/ to the project's .gitignore (features, review files and version history). The spec is a local working artifact, not a repo deliverable — this prevents accidental commits via git add .. (Mirrors the same step performed by /feature-dev:explore-plan for the plan.)
Present the review brief (below) — not the spec itself. Do NOT proceed until the user approves.
Every approval gate in this command ends with this block instead of re-printing the spec. Users answer from the chat, not from the file: a several-hundred-line spec pasted back buries the few decisions they actually need to rule on. Keep it to ~15 lines, number items continuously across groups so the user can answer "2: no, 5: ok", and omit a group that would be empty. Give the path; show full content only when asked.
### Review brief — SPEC-<slug>.md (<line count> lines)
**Decided** (review if you disagree)
1. <a choice the spec makes that the user did not state — scope cut, contract shape, error behavior>
**Assumed — confirm**
2. <an assumption from step 3 that the user has not confirmed, or one added while writing>
**Unverified claims about the code**
3. `<Model.field>` is nullable — not checked
**Out of scope**
- <each `## Non-Goals` item, one line>
Reply with the numbers you want changed, or "approved".
Or review it in the browser: /feature-dev:review <spec path>
"Unverified claims about the code" lists the facts about existing code the spec relies on — paths, symbols, field nullability, FK direction, endpoint paths, migration numbers, config keys — that you did not open the file to confirm. Say "not checked" rather than guessing; /feature-dev:spec-review checks them against the code.
A business rule the user did not state is a "Decided" item: a rule is the easiest place for a silent assumption to become binding.
After the spec is approved:
The spec file is a local working artifact, not a repo deliverable. Do NOT commit it, and do NOT run any git commands. Downstream commands read it directly from the working tree.
Confirm the feature is approved (${CLAUDE_PLUGIN_ROOT}/scripts/features.py approve <feature-slug> --root <repo root> has run; /feature-dev:tdd marks it implemented when it finishes).
Ask about publishing — once, gated, right here. Read .claude/feature-dev.local.md (Read tool; a missing file is simply absent, no fallback value). This is the only place this question is asked: never on edits or review rounds — not when the user asks you to change something in an already-approved spec, and not at the end of a review brief. Handoff runs once, after the spec is approved, so asking only here already satisfies that.
spec_store in .claude/feature-dev.local.md when that file sets it (project setting, wins); otherwise the Spec store option in Context. issue is the only value that means "issue"; anything else, or nothing set anywhere, is file.issue or the feature is already linked to an issue (its issue in features.py list --json is not null). Either condition alone is enough to ask.#N; offered only when the feature is already linked to an issue), and "create an issue" (target new).issue is the publishing option — "publish to #N" if the feature is already linked to an issue, otherwise "create an issue" (there is no #N yet to publish to). When the question was asked only because the feature is already linked to an issue (store setting file), default to "keep local".#N or new), start to finish, then continues below with its result. "Keep local" changes nothing and continues below immediately.End with the next command, using the spec path you just wrote, then stop and let the user choose:
Next: /feature-dev:spec-review <spec path> (optional) or /feature-dev:explore-plan <spec path>
Recommend explore-plan: it writes a reviewed step-level plan from the code. /feature-dev:tdd <spec path> (straight from the spec's ACs) is the fallback for a small feature, so mention it only when the spec is small enough that a plan adds nothing.
Entered only when positional[0] was --publish (<SPEC> and <target> read above). This mode skips the authoring phases: it never asks the scope question, never surfaces assumptions, never writes spec content, and never presents a review brief.
<target> (new, #N, owner/repo#N, or an issue URL) per issue-store.md's Argument parsing.<SPEC> and the resolved target, start to finish, including its gh preflight, its scratch-file handling, and its fingerprint verification. Do not restate those steps here — follow the reference.#N) offers "import the issue's version instead," and the user picks it, run issue-store.md's Import algorithm against that issue, start to finish, then stop — this invocation does not also publish. Do not restate Import's steps here — follow the reference.gh preflight or a failed verification (the reference's steps 1 and 6) leaves the local spec untouched and reports that nothing was published.additionalDirectories setting grants access; the spec's repos: block declares intent. It is the canonical record of which repos are in scope — future downstream tooling will read it rather than re-inferring from settings.Files this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
opus7-day visitors to each command page
npx claudepluginhub juanmhidalgo/claude-plugins --plugin feature-dev8 commands in this plugin
/cleanupContextUse to bulk-delete implemented features (spec, plan, review history and feedback) from .feature-dev/features/, and stale review-server pointers. Lists only safe candidates and requires Y/N confirm.
Offers first to rescue a spec's Decisions Log and unticked QA items as a comment on its branch's PR or into docs/decisions/.
Do NOT use during active feature work — destructive on confirmed candidates.
/explore-planContextUse when starting a feature that touches multiple parts of the codebase and you need a
structured implementation plan before coding.
Do NOT use for simple bug fixes or single-file changes.
/hardenContextUse after an implementation is finished — typically right after /feature-dev:tdd — to review it in
fresh context (defects, spec conformance and tech debt at once), verify every finding, fix the ones
you approve, and re-review what the fixes changed. Replaces running /code-review:staged,
/code-review:receive and /code-review:tech-debt by hand.
Do NOT use for a PR with bot comments (/code-review:triage), for a read-only review
(/code-review:staged or :branch), or before the implementation is done.
/plan-reviewContextUse to re-validate a PLAN-*.md edited by hand, or one written before explore-plan reviewed its own plans. Outputs Blocking / Should Address / Nice to Have findings.
Do NOT use right after /feature-dev:explore-plan (it already ran this review), for code review, or for SPEC review (use /feature-dev:spec-review).
/reviewContextUse to review a SPEC-*.md or PLAN-*.md in the browser — outline, decision cards, text-anchored comments, diff against the previous version — and apply the verdict.
Do NOT use for a structural gap check (use /feature-dev:spec-review or /feature-dev:plan-review) or for code review.
/spec-reviewContextUse to validate a SPEC-*.md for gaps before planning or implementation. Outputs Blocking / Should Address / Nice to Have findings.
Do NOT use to verify implementation (use /prd:validate).
Other plugins' commands for the same job