/spec-workflow:spec-workflowfrom spec-workflow
Explicit activation only. 仅当用户明确点名 spec-workflow、Spec workflow,或明确要求使用、走或启动该插件时选择;不得根据请求内容或任务类型推断触发。作为用户显式启动后的插件入口,负责目录选择、intake、分支路由与 acceptance。
Ships in spec-workflow. 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.
None: SKILL.md is the whole skill.
This is the lightweight entrypoint for the Spec workflow plugin. Keep this file small: select an isolated workflow directory first, run intake, classify the request, announce the route, hand off to the branch skill, then run pre-acceptance and final acceptance when branch tasks are complete.
spec-workflow / Spec workflow, explicitly asks to use or start this plugin, or continues a workflow that they previously started explicitly.Once this skill is read and selected, print:
我读到了Spec workflow技能。
我会先按照“spec-intake”完成需求澄清。
After intake produces an Intake Handoff / 澄清交接摘要 with Status: complete or Status: assumptions-accepted, print the route decision:
## Spec 路由决定
- 路径:Feature / Requirements-First | Feature / Design-First | Bugfix | 待澄清
- Design-First 粒度:n/a | High Level Design | Low Level Design
- Intake 状态:complete | assumptions-accepted | blocked | 需要反问
- 原因:[一句话说明判断依据]
- 下一步:[Intake 反问 | 分流澄清 | 需求澄清 | Design-First 澄清 | Bug 分析澄清 | 规范生成]
Immediately after the route block, print one branch line:
我会按照“Feature / Requirements-First”分支来完成。
or:
我会按照“Feature / Design-First”分支来完成。
or:
我会按照“Bugfix”分支来完成。
If the route is still unclear:
我会先完成分流澄清,再进入对应分支。
docs/specs/ and select a single <specs_dir> for this run. Do not resume an old workflow automatically when the user is starting a new one.<specs_dir>; chat-only plans are not the source of truth.docs/specs/<run-id>/ and include Markdown artifacts plus <specs_dir>/spec.yml and <specs_dir>/progress.md. tasks.md is the human-readable task source, progress.md is the resume entrypoint, and spec.yml is the Kiro-compatible machine index.批准规范,启动执行; branch-specific legacy phrases remain valid where documented for compatibility.spec_approve or python <plugin-root>/scripts/spec_progress.py approve <specs_dir> --evidence "<approval phrase/context>" before implementation. start must fail if this step has not happened.scripts/spec_progress.py: checkbox/status/evidence/completed_at/notes/blocker, top-level progress summary, completion log, progress.md, and current-task/index state.sync-check --write to mark reapproval-required, update specs, and wait for another accepted approval phrase plus approve. Do not silently rewrite approved spec content mid-task.scripts/spec_progress.py. Do not hand-edit task completion in chat only.Before intake, run or request the equivalent of:
python <plugin-root>/scripts/spec_progress.py discover docs/specs/
open_workflows is empty, create a new isolated directory with python <plugin-root>/scripts/spec_progress.py new docs/specs/ --slug "<short-slug>", then use the returned specs_dir as <specs_dir> for the whole run.open_workflows is not empty, list each candidate's specs_dir, workflow, status, approval, and current task. Ask whether to continue one of them or create a new isolated workflow. Do not run resume or read old task progress until the human chooses a candidate.new docs/specs/ --slug "<short-slug>" and do not treat older progress.md/tasks.md files as the source of truth for this request.docs/specs/tasks.md is a valid candidate for resuming old runs, but new runs must write to docs/specs/<run-id>/.<run-id> first, then create the isolated worktree and branch as described in ## Git Delivery Chain, then run new --run-id <run-id> from inside that worktree so the spec directory matches the branch and artifacts land on spec/<run-id>. In a non-git repository, skip the worktree step and run new in place (no --run-id).When the run happens inside a git repository, wrap the whole workflow in a branch-and-PR delivery chain so the main working tree stays clean and each task lands as a reviewable commit. This chain is anchored at the workflow level, not per task: one branch, one draft PR, one final human merge. Check the degradation ladder before every git action and never block the workflow when a rung is unavailable.
Degradation ladder (evaluate before each step):
git worktree add is unavailable or fails → degrade to git switch -c spec/<run-id> in the current working tree and continue with commits and PR steps.gh missing / gh auth status fails → keep the local worktree and branch, skip every PR step, and note in the output that PR steps were skipped.Chain steps:
Create. After the human chooses to start a new workflow, first pick the <run-id> yourself: <timestamp>-<short-slug>, e.g. 20260707-153000-add-auth. This id names the worktree, the branch, and the spec directory, so decide it once up front. Then create the isolated worktree and branch from the current HEAD:
git worktree add ../<repo-name>--spec-<run-id> -b spec/<run-id>
Run every later command (new, intake, artifact generation, approve, implementation, acceptance) from inside that worktree directory. Then run spec_progress.py new docs/specs/ --run-id <run-id> inside the worktree so the spec directory matches the branch name exactly and artifacts are created on the branch. In a non-git repository you skip this step, so omit --run-id and let new generate the id itself.
On approval. After approve freezes the baseline (see ## Approval Freeze):
git add docs/specs/<run-id> && git commit -m "docs(spec): add <run-id> spec artifacts"
git push -u origin spec/<run-id>
gh pr create --draft
Generate the draft PR body from tasks.md: a one-line goal, a - [ ] checklist mirroring the tasks, a link to the spec directory, the high-risk warning when applicable, and Closes #N only when a tracking issue already exists.
Per task. After complete records evidence, commit the business code and the progress files together using the branch skill's commit message suggestion (this satisfies the pre-commit progress guard), push, then regenerate the PR body checklist from tasks.md with gh pr edit --body-file. The PR body is a one-way projection of tasks.md; tasks.md stays the single source of truth.
PR rediscovery. Locate the PR at any time from the branch name with gh pr list --head spec/<run-id>. Do not persist the PR URL; progress files are re-rendered by the scripts and hand-added fields are overwritten.
Issue (on demand). Only when the human explicitly asks, create a tracking issue with gh issue create (body from the spec summary) and add Closes #N to the PR body. Do not create issues by default.
Merge and cleanup. After final acceptance passes and the PR is marked ready (see ../spec-acceptance/SKILL.md), print suggested commands for the human to run — for example gh pr merge --squash --delete-branch and git worktree remove <path>. Never merge or remove the worktree autonomously.
After a human chooses an existing <specs_dir>:
python <plugin-root>/scripts/spec_progress.py resume <specs_dir>.<specs_dir>/progress.md, <specs_dir>/spec.yml, <specs_dir>/tasks.md, and the branch spec artifacts.interrupted, inspect the diff and verification evidence before continuing. Do not mark any task complete until evidence is recorded.reapproval-required or resume reports frozen-baseline drift, stop implementation and ask for human reapproval after syncing specs.When the run is inside a git repository and progress.md records a spec/<run-id> branch, continue inside that branch's worktree: if it still appears in git worktree list, switch into that directory before resuming; if the worktree is gone but the branch exists, recreate it with git worktree add ../<repo-name>--spec-<run-id> spec/<run-id>. Follow the ## Git Delivery Chain degradation ladder when git or the worktree is unavailable.
Print a short resume summary before continuing.
Before routing, read and follow ../spec-intake/SKILL.md unless the current conversation already includes an Intake Handoff / 澄清交接摘要 with Status: complete or Status: assumptions-accepted.
If intake asks questions, stop after the questions and wait for the human answer. Do not generate spec artifacts or enter a branch workflow yet.
When intake produces a complete or assumptions-accepted handoff, use those conclusions as routing input and carry them into the selected branch's primary spec artifact. If intake is blocked, ask for the missing decision and do not route.
For Requirements-First and Design-First, the selected branch must perform Kiro-style Analyze Requirements before finalizing specs. Record the result inside product.md or requirements.md; do not create a standalone analysis file unless the user explicitly asks.
The analysis must check ambiguity, undefined concepts, conflicting constraints, missing boundary cases, failure paths, permissions, concurrency, data consistency, and safety/security risks. Quick Plan may skip the full analysis only for low-risk work with explicit human authorization, and the skip reason must be recorded.
After artifacts are generated and structurally validated, the human may approve with 批准规范,启动执行. On receiving approval:
python <plugin-root>/scripts/spec_progress.py approve <specs_dir> --evidence "<approval phrase/context>" or MCP spec_approve.spec.yml shows approval: approved, artifact_hashes, and task_plan_hash.spec/<run-id> branch, and open the draft PR as described in ## Git Delivery Chain. Follow the degradation ladder when the worktree, remote, or gh is unavailable.spec_start_task or python <plugin-root>/scripts/spec_progress.py start <specs_dir> <task-id>.artifact_hashes freeze primary branch artifacts. task_plan_hash freezes task IDs, task titles, files, verify criteria, dependencies, risk, coverage, and parallelization. Progress updates are allowed; spec/task-plan edits require sync-check --write and reapproval.
After intake is complete, check in this order and stop at the first match:
Bugfix: the user wants to fix, investigate, reproduce, roll back, or recover existing expected behavior.Feature / Design-First: the user asks for design-first, tech design first, high-level design, low-level design, architecture, ADR, or gives a technical plan or primary technical constraints that must drive requirements.Feature / Requirements-First: the user asks for a new feature, capability, workflow, scaffold, complex refactor, or product outcome without a fixed technical design starting point.待澄清: ask one question only: 这次主要是 A. 恢复既有预期行为 / 修复缺陷,B. 从业务需求新增或调整能力,还是 C. 从技术设计 / 架构约束推进?Only hand off after spec-intake is complete or assumptions-accepted.
../spec-requirements-first/SKILL.md.../spec-design-first/SKILL.md.../spec-bugfix/SKILL.md.After handoff, keep only the selected branch in scope until the user changes direction.
After the selected branch has no unchecked tasks in <specs_dir>/tasks.md, first run local pre-acceptance with python <plugin-root>/scripts/validate_spec.py <specs_dir> --pre-acceptance, then read and follow ../spec-acceptance/SKILL.md. The current Spec workflow opt-in covers the review agents required by that skill; do not ask for a second orchestration authorization.
Do not report the whole Spec workflow complete until final acceptance passes. New runs use adaptive acceptance by default: independent unit review, risk- or issue-triggered adversarial review, targeted delta re-review, and one final global integration review. Record acceptance repairs in acceptance-fixes.md; do not append them to the original task plan or restart the entire review when only affected units changed.
If the task involves authentication, authorization, payments, billing, database schema changes, data repair, distributed consistency, cache consistency, secrets, encryption, sensitive data, incident mitigation, rollback, or hotfix work, include:
> [!WARNING]
> 高风险变更警告:当前任务涉及核心系统或高影响范围区域,必须进行人类深度审查,切勿草率合并。
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gy212/useful-marketplace --plugin spec-workflow7 skills in this plugin
/spec-acceptanceExplicit activation only. Internal final step of a user-invoked spec-workflow. Select only after the active branch hands off, or when the user explicitly names spec-acceptance and thereby opts into the plugin; otherwise do not select./spec-bugfixExplicit activation only. Internal branch of a user-invoked spec-workflow. Select only after the active router hands off, or when the user explicitly names spec-bugfix and thereby opts into the plugin; otherwise do not select./spec-design-firstExplicit activation only. Internal branch of a user-invoked spec-workflow. Select only after the active router hands off, or when the user explicitly names spec-design-first and thereby opts into the plugin; otherwise do not select.