Conversation
Add a diagnosis-first bug workflow mirroring /spec's command-suite structure, under .claude/commands/bugfix/: triage -> confirm (gate) -> test-first (gate) -> fix -> verify It is /test-first wrapped with an explicit Confirm gate up front, because a bug's root cause is a hypothesis until proven. Confirm proves the cause (code-trace and/or red repro) and surfaces scope changes before any code is written -- as in #4054, where confirming the camelCase round-trip cause also exposed a second defect the suggested fix only partially addressed. Resolves the proposal's open questions: - State: single bugfix.md record + one .confirm-approved marker (lighter than /spec's three markers) - Confirm evidence: red repro preferred, code-trace allowed for infra-bound bugs; durable test written at the test step - Issue linking: capture root cause + Fixes #N; never auto-close - Delegation: triage/confirm use a read-only Plan sub-agent; the main agent owns the Confirm gate and bookkeeping Also documents /bugfix in the commands README, skills_overview, and CLAUDE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Review:
|
- verify.md: replace dated "Claude Opus 4.8" co-author with a stable placeholder so the commit template can't misattribute as models change - switch.md: clarify the argument is the full NNNN-slug dir name, not the bare slug (and align the overview usage hint) - status.md: note that a section still holding its placeholder counts as empty for phase derivation - skills_overview.md: redraw the decision tree so the bug and behavior arms no longer cross columns Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
No application code in the PR — skipped Code Health checks.
See analysis details in CodeScene
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Review:
|
Summary
Fleshes out the
/bugfixproposal in #4204 as a working command suite, mirroring how/spec:*is built (a set of subcommands under.claude/commands/). It is a lightweight, diagnosis-first bug workflow:It is essentially
/test-firstwrapped with an explicit Confirm gate up front, because a bug's root cause is a hypothesis until proven. It deliberately omits the ADR/requirements/adversarial-review rounds that/specmandates.Why
Bugs differ from features in one key way: the root cause is a hypothesis until proven. Issues often arrive with a suggested fix (sometimes agent-authored) that can be wrong, incomplete, or address a symptom.
/test-firstjumps straight to a test for an assumed cause — it has no gate for confirming the diagnosis first.Worked example — #4054 (ASB
SessionIdcase-sensitivity): Confirm proved the cause (JsonSerialisationOptions.PropertyNamingPolicy = CamelCasecamelCases header keys on round-trip) and surfaced a second defect the suggested fix only partially addressed (reserved-header stripping is also case-sensitive). Confirming the theory changed the scope of the fix — which is exactly what the Confirm gate exists to catch.Commands (
.claude/commands/bugfix/)/bugfix:triage [issue|desc]Plan, opus, read-only/bugfix:confirm.confirm-approvedPlan, opus, read-only/bugfix:test/test-first)/bugfix:fix/tidy-firstif cleanup needed/bugfix:verifyFixes #N/bugfix:status,/bugfix:switchbugfixes/Open questions from #4204 — resolved
bugfixes/NNNN-slug/dir with onebugfix.mdrecord + the single.confirm-approvedmarker (lighter than/spec's three markers).Fixes #Nso merge closes the issue — never auto-close from the command./tidy-first:/bugfix:fixdefers to it when a fix needs structural cleanup first (separaterefactor:thenfix:commits).Docs
Adds
/bugfixto.claude/commands/bugfix/README.md(workflow diagram, gate rationale, sub-agent/model-policy table), the top-level commands README,.agent_instructions/skills_overview.md, andCLAUDE.md.Closes #4204
🤖 Generated with Claude Code