/spec-workflow:spec-bugfixfrom spec-workflow
Explicit 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.
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.
Use this branch to restore existing expected behavior with evidence, root-cause analysis, and minimal safe implementation.
This branch may run only inside a user-initiated spec-workflow run. If named directly, enter through the spec-workflow router and intake gates first. Generic bug reports and fix requests must not activate it.
If the entry router has not already printed the announcement, print:
我读到了Spec workflow技能。
我会按照“Bugfix”分支来完成。
批准规范,启动执行.批准 bugfix 规范,启动执行.<specs_dir>; they are the source of truth.<specs_dir>/spec.yml and <specs_dir>/progress.md from the templates in ../../assets/templates/.Intake Handoff / 澄清交接摘要 into bugfix.md; do not leave intake conclusions only in chat.<specs_dir>/acceptance_state.json exists, do not append repair tasks to the original <specs_dir>/tasks.md. Use <specs_dir>/acceptance-fixes.md and the acceptance progress tools instead, then return to ../spec-acceptance/SKILL.md.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 this warning even when the router was skipped:
> [!WARNING]
> 高风险变更警告:当前任务涉及核心系统或高影响范围区域,必须进行人类深度审查,切勿草率合并。
Before State A, if the current conversation does not already include an Intake Handoff / 澄清交接摘要 with Status: complete or Status: assumptions-accepted, read and follow ../spec-intake/SKILL.md. If intake asks questions or is blocked, stop and wait for the human answer before generating specs.
Inspect available evidence before asking questions: failing tests, logs, screenshots, issue text, alerts, recent changes, existing specs, manifests, and relevant code paths.
Clarify all bug-critical gaps:
If clarification is needed, continue the multi-round intake loop focused on reproduction, evidence, scope, unchanged behavior, and regression constraints. Unknowns may be recorded as assumptions or risks only if the user explicitly accepts that.
No fix proposal before the root cause is understood. Follow this order before writing design.md:
git diff, dependencies, config), and trace the data flow from the failure point back to its source. In multi-component paths, add boundary diagnostics to locate the failing layer first. Fix at the source, not at the symptom.The root-cause analysis in design.md must cite investigation evidence: the data-flow trace, the reference implementation compared against, and the hypothesis that was tested. A speculative root cause without evidence is not ready for approval.
Time pressure does not waive this discipline. If investigation confirms the problem is genuinely environmental or timing-based, record the investigation, design reasonable handling (retry, timeout, monitoring), and say so in design.md.
If this is an acceptance repair:
<specs_dir>/acceptance_state.json as the source of truth for round, issue severity, affected units, and pending fixes.<specs_dir>/acceptance-fixes.md as the repair task list.<specs_dir>/tasks.md, do not append B-xxx tasks to it, and do not change the frozen original task IDs.python <plugin-root>/scripts/spec_progress.py acceptance-fix-start <specs_dir> F-xxx before editing code and acceptance-fix-complete with evidence after verification.../spec-acceptance/SKILL.md via acceptance-status / acceptance-next-round.For ordinary bugfixes, continue with the normal artifact flow below.
Use the plugin templates from ../../assets/templates/:
bugfix_template.mdbugfix_design_template.mdbugfix_tasks_template.mdprogress_template.mdspec_index_template.ymlGenerate:
<specs_dir>/bugfix.md: intake handoff, defect summary, impact, environment, reproduction evidence, automated-reproduction status, substitute evidence when needed, current behavior, expected behavior, unchanged behavior, scope boundaries, and non-goals<specs_dir>/design.md: root-cause analysis, code-path trace, minimal fix strategy, alternatives, affected surface, explicitly untouched areas, test strategy, and non-automated verification risks when applicable<specs_dir>/tasks.md: ordered atomic tasks using - [ ], starting with reproduction or strongest available evidence, then minimal fix, regression protection, and verification. Each task must include status, files, verify, evidence, depends_on, risk, covers, and parallelizable.<specs_dir>/progress.md: resume entrypoint with workflow status, current task, approval state, branch, commit, blockers, and recovery notes<specs_dir>/spec.yml: Kiro-compatible machine index with workflow, mode, approval, risk level, artifact paths, requirement IDs, task graph, current task, and checkpointBugfix defaults to strict. Do not use Quick Plan for P0/P1, production incidents, data repair, auth, payment, schema, consistency, secrets, encryption, or sensitive-data work.
Before review, replace all template placeholders with concrete content. If a template section does not apply, state that explicitly with the reason instead of leaving placeholder text.
Task plan quality bar:
接口 field: 消费 lists the exact signatures, contracts, or failure-proof entry points taken from upstream tasks, 产出 lists what downstream tasks rely on; write 无 explicitly when empty.TBD, 待定, 处理边界情况, or 类似 B-xxx inside a task is a plan failure, not an acceptable draft. Every task needs concrete file paths, real commands, and expected verification output.覆盖, no placeholders remain, and interface references are consistent across tasks. Fix findings directly instead of reporting them.If automated reproduction cannot be created, record why in bugfix.md, describe substitute evidence strength and limits, and use the strongest available verification substitute.
The preferred approval phrase for implementation is:
批准规范,启动执行
The legacy Bugfix phrase remains valid for compatibility:
批准 bugfix 规范,启动执行
Suggested validation:
python <plugin-root>/scripts/validate_spec.py <specs_dir> --workflow bugfix
python <plugin-root>/scripts/spec_progress.py init <specs_dir>
python <plugin-root>/scripts/validate_spec.py <specs_dir> --resume
This is a structural integrity check only. It does not prove root-cause quality, minimal-fix scope, unchanged-behavior coverage, substitute reproduction strength, rollback safety, or monitoring sufficiency; review those semantics before implementation. Passing validation does not approve implementation; implementation still requires an accepted approval phrase. After the approval phrase is received, run:
python <plugin-root>/scripts/spec_progress.py approve <specs_dir> --evidence "批准规范,启动执行"
In a git repository, after approve freezes the baseline, commit the spec artifacts, push the spec/<run-id> branch, and open the draft PR as described in the router's ## Git Delivery Chain in ../spec-workflow/SKILL.md. Skip the PR steps when no remote or gh is available, and skip the whole git chain outside a git repository.
Only enter this state after explicit approval.
When the approval phrase is received, freeze the baseline with spec_approve or spec_progress.py approve before implementation. Do not start a task until spec.yml shows approval: approved, artifact_hashes, and task_plan_hash.
Implementation rules:
<specs_dir>/bugfix.md, <specs_dir>/design.md, and <specs_dir>/tasks.md.spec_resume or spec_progress.py resume <specs_dir> and stop if it reports frozen-baseline drift.tasks.md.spec_start_task through MCP or run python <plugin-root>/scripts/spec_progress.py start <specs_dir> B-xxx.bugfix.md, design.md, or the task plan in tasks.md must change, stop code work. Run sync-check --write to mark reapproval-required, return to State B, update specs, and wait for an accepted approval phrase plus a fresh approve before continuing. Progress fields may still be updated through the tools.sync-check --write if specs must change, and discuss with the human.complete, run a lightweight two-phase self-check of the task diff: (1) 规格符合性 — exactly the selected task and its 覆盖 IDs; (2) 代码质量 — minimal change tied to the proven root cause, real assertions, no weakened or deleted failing tests. Do not spawn a separate reviewer by default; final acceptance supplies fresh independent review. Use a fresh task-level reviewer only when this check exposes material uncertainty or the task has a critical risk that cannot safely wait for the final unit review. Critical or Important findings block complete; record the verdict in completion evidence.spec_complete_task through MCP or run python <plugin-root>/scripts/spec_progress.py complete <specs_dir> B-xxx --evidence "<verification evidence>". For a reproduction task, passing means the failure proof behaves as expected on unfixed code or the substitute evidence is recorded and strong enough to constrain the fix.spec_block_task or python <plugin-root>/scripts/spec_progress.py block <specs_dir> B-xxx --reason "<reason>".spec_skip_task or python <plugin-root>/scripts/spec_progress.py skip <specs_dir> B-xxx --approval "<human approval evidence>".fix(scope): short description
Implements task: [task description]
Spec: <specs_dir>/tasks.md
In a git repository, after complete, commit the business code and the progress files together with this message (this satisfies the pre-commit progress guard), push the spec/<run-id> branch, and refresh the PR checklist from tasks.md per the router's ## Git Delivery Chain in ../spec-workflow/SKILL.md. When the git chain is not enabled, just surface the suggested message as before.
If unchecked tasks remain, continue to the next executable task under the existing workflow approval. Pause only for a real blocker, a required reapproval, or a decision that materially changes scope or outcome.
If no unchecked tasks remain in <specs_dir>/tasks.md, read and follow ../spec-acceptance/SKILL.md before reporting the whole workflow complete.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
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-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./spec-intakeExplicit activation only. Internal step of a user-invoked spec-workflow. Select only after the active spec-workflow router hands off, or when the user explicitly names spec-intake and thereby opts into the plugin; otherwise do not select./spec-requirements-analysisExplicit activation only. Internal step of a user-invoked spec-workflow. Select only after the active router or branch hands off, or when the user explicitly names spec-requirements-analysis and thereby opts into the plugin; otherwise do not select.
/spec-requirements-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-requirements-first and thereby opts into the plugin; otherwise do not select./spec-workflowExplicit activation only. 仅当用户明确点名 spec-workflow、Spec workflow,或明确要求使用、走或启动该插件时选择;不得根据请求内容或任务类型推断触发。作为用户显式启动后的插件入口,负责目录选择、intake、分支路由与 acceptance。