Formal bug fix pipeline — root cause analysis, scope lock, behavior contract, differential testing, regression proof.
/fix <description|#issue> [--severity critical|high|medium|low] [--hotfix|--lite|--lite-strict|--verified|--full|--swarm]
--hotfix compresses the pipeline without skipping correctness checksNote: /fix can also be auto-triggered by a Monitor webhook when production error events cross a threshold — see Monitor Integration in the skill for the .claude/monitors/ config that wires an error tracker (Sentry, Datadog, Rollbar) to the pipeline.
/fix POST /auth/refresh returns 500
What you’ll see: an investigation that converges on a root cause (with file:line evidence), a scope-locked fix with a regression test proven to catch the bug, a differential test showing nothing else changed (any unrelated test regression blocks the PR), and a PR with the full evidence trail.
/fix #123 # load the bug from a GitHub issue
/fix #123 --severity critical # explicit severity (otherwise auto-assessed)
/fix #123 --hotfix # production fire — expedited single-trace path
/fix --severity high token refresh fails silently
| Flag | Values | Default | What it does |
|---|---|---|---|
--severity |
critical | high | medium | low |
auto-assessed | Drives QA depth and merge urgency |
--hotfix |
— | off | Expedited path for production fires: single backward trace, compressed checks, deferred deep investigation post-merge |
--lite / --verified / --full (alias --swarm) / --lite-strict |
— | auto-detected | Advanced: force the investigation depth (lite → verified → full ladder) instead of letting the pipeline pick it from the bug’s signals; --verified (analyst + challenger) is what auto-detection picks when no signal fires |
All six investigation-depth flags (--hotfix, --lite, --lite-strict, --verified, --full/--swarm) are mutually exclusive — pass at most one. Leave them all off to let auto-detection pick a depth from the bug’s signals.
User-confirmation checkpoints (marked below) are interactive prompts where /fix pauses and asks you to decide something — which hypothesis to pursue, whether to accept a symptom-side fix, what QA level to run. In CI, autopilot, or Monitor-triggered runs, each checkpoint uses a safe default instead of blocking.
--lite-strict to disable this and accept the lite verdict as-is.full recommended for critical/high severity (user-confirmation checkpoint), runs /qa, restarts local servers, and asks you to test the fix manually before proceeding (user-confirmation checkpoint). Then creates the PR via /pr with the bug-fix evidence template, updates the knowledge base, runs a final completion verification, and prints a post-fix checklist (incident record, bug-pattern, knowledge-graph write, verifier) before announcing the PR URL. In unattended runs (CI, autopilot, Monitor-triggered) it never prompts: the QA level is derived from severity and manual testing is deferred with a logged notice.| Agent | Model tier | Role |
|---|---|---|
| backward-tracer / forward-tracer | sonnet | Independent root-cause investigation strategies |
| pattern-matcher | haiku | Searches the knowledge base for matching past incidents |
| implementation agent (backend / frontend) | sonnet | Applies the fix inside the Fix Zone |
| fix-reviewer | sonnet | Correctness checklist + root-cause pre-gate |
| qa-attacker | sonnet | Adversarial attack scenarios against the fix |
| completion-verifier | sonnet | Final completeness cross-check |
Note: in calibrated projects, these agent assignments and model tiers can be overridden — check .claude/registry.json for active agent substitutions and model-policy.yml (or .claude/model-policy.yml) for model-tier overrides.
.claude/.fix-scope-lock.json — the enforced Fix/Watch/Frozen zones. Written in Step 2 and read by the implementation agent, which is blocked from editing anything outside the Fix Zone. Don’t delete or hand-edit it mid-fix — if the scope is too narrow, re-run /fix with a clearer description instead..claude/.fix-behavior-contract.md — what changes vs. what’s preserved.claude/qa-knowledge/incidents/ and a bug-patterns.md entry| Problem | Fix |
|---|---|
Uncommitted changes present — commit, stash, or discard before /fix |
The pipeline refuses to start on a dirty tree — clean it up first |
Rebase conflicts against origin/main |
The base shifted under you — run git rebase --abort and sync manually before re-running |
| Investigation swarm could not converge | You’ll be shown all competing hypotheses with evidence — pick one or ask it to investigate all |
| Review verdict: BLOCK (“fix patches symptom only”) | The diff doesn’t address the root cause — the pipeline returns to implementation rather than shipping a band-aid |
| Regression test passes both with and without the fix | The test is rejected as useless and rewritten — this is by design |