/sb:bugfix

Triage-first bug investigation and fix — classifies failure type before any investigation begins, then routes through Path 1A, 1B, or 1C.

Overview

/sb:bugfix is the Silver Bullet orchestrator for bugs, regressions, crashes, errors, and failing tests. It enforces triage-first discipline: classify the failure type before any investigation begins.

It never implements fixes directly — it orchestrates only. Investigation, planning, execution, review, and verification are all delegated to specialist skills.

The key design insight: three very different failure categories require three different starting points. Applying the wrong investigation technique wastes time and produces incomplete diagnoses. Triage first, investigate second.

/sb:bugfix uses the v0.53.0 APO catalog — catalog entity WF-SILVER-BUGFIX composes AF-ORIENT (optional) → AF-DEBUG → AF-PLAN → AF-EXECUTE → WF-POST-EXEC-GATES. See Composable Flows for the full catalog.

When to Use

Use /sb:bugfix for any of these entry trigger signals:

  • "bug" / "broken" / "crash" / "error"
  • "regression" / "failing test" / "not working"
  • Any observation that something that used to work has stopped working
  • A test that was green is now red
  • An SB workflow or plan that failed mid-execution

sb:bugfix always takes precedence over sb:feature and sb:ui when triggered by a bug report.

Workflow Steps

Pre-flight

Silver Bullet reads silver-bullet.md §10 to load user workflow preferences before any step executes.

AF-DEBUG triage — classify failure type

Before any investigation, Silver Bullet presents a classification question:

What best describes this failure? A. Known symptom, unknown fix — I can observe the bug but don't know the root cause B. Unknown cause — session history is unclear, need to reconstruct what happened C. Failed SB workflow specifically — a plan, execution phase, or SB lifecycle command failed

The selection routes to one of three paths. All paths converge at Step 2 (TDD).

Path 1A — Known symptom, unknown fix

Invoked when triage selects A, OR after Path 1B/1C forensics completes and hands off here.

1A.1 — Systematic debugging hypothesis

Invoke /sb:debug in hypothesis mode. Purpose: structure the debugging hypothesis before executing investigation. Produces a testable hypothesis with reproduction steps.

1A.2 — Persistent debugging investigation

Continue in /sb:debug. Purpose: execute investigation with persistent state across context resets. After debugging completes, proceed to TDD regression.

Path 1B — Unknown cause, needs reconstruction

Invoked when triage selects B — session history is unclear or cause cannot be determined from current state.

1B.1 — Forensic cause reconstruction

Invoke /sb:forensics. Purpose: forensics skill that reconstructs cause from git history, artifacts, and state. Produces a cause classification report. After forensics completes: hand off to Path 1A with reconstructed context.

Path 1C — Failed SB workflow

Invoked when triage selects C — an SB plan, execution phase, or lifecycle command failed.

1C.1 — SB workflow post-mortem

Invoke /sb:forensics. Purpose: post-mortem for failed workflows (failed plans, broken state, incomplete phases). Produces a diagnosis of what went wrong in the workflow layer. After forensics completes: hand off to Path 1A with the diagnosis context.

AF-PLAN / AF-EXECUTE — TDD regression and fix

All three triage paths converge before fix implementation. Under AF-PLAN and AF-EXECUTE:

Invoke the SB tdd gate first — write a failing regression test (RED) before any fix code. Then /sb:plan (lightweight, 1–2 tasks) and /sb:execute --tdd. Verify the regression test is green after execution.

⚠
Enforcement: Do not proceed to Step 3 until the regression test is red (failing for the right reason). A green test before the fix means the test does not cover the bug — it must be rewritten.

WF-POST-EXEC-GATES — Review, verify, secure, ship

After AF-EXECUTE, the standard post-execute tail runs:

AF-REVIEW-REQUEST → AF-REVIEW → AF-REVIEW-TRIAGE → AF-VERIFY → AF-SECURE → AF-VALIDATE → AF-QUALITY-GATE (pre-ship) → AF-BRANCH-FINISH → AF-COMPLETION-AUDIT → AF-SHIP

Commands: /sb:review-request, /sb:review, /sb:review-triage, /sb:verify, /sb:secure, /sb:quality-gates, /sb:ship.

Non-Skippable Gates

🔒
These steps cannot be skipped regardless of §10 preferences or user request:
  • /sb:quality-gates pre-ship (AF-QUALITY-GATE)
  • /sb:verify (AF-VERIFY)
  • /sb:secure (AF-SECURE)

Example Invocation

/sb:bugfix Login form throws 500 on empty password field

Silver Bullet presents triage options. You select A (known symptom, unknown fix). SB invokes /sb:debug to form and test a root-cause hypothesis. Root cause found → failing regression test → AF-PLAN / AF-EXECUTE → WF-POST-EXEC-GATES → ship.