bug-hunting
bug-hunting fixes bugs only after the root cause is confirmed. Reactive mode fixes a known bug; proactive mode hunts hidden bugs in code you point at.
bug-hunting fixes bugs without creating future bugs. Reactive mode fixes a known bug; proactive mode hunts hidden bugs in code you point it at. Both enforce the same discipline.
Core principle: A claim is not evidence. Evidence is not root cause. Root cause is not a fix.
When to use it
- "Fix this bug", "test failing", "production error" (reactive).
- "Review this code", "find bugs in…", "audit this" (proactive).
When not to use it:
- The bug has design implications across a system boundary → pocket-grinding.
- You want a small change, not a bug → hotfix.
Prerequisites
Reproducibility where possible: if it cannot be reproduced, it cannot be fixed (and the skill says so rather than guessing). An Education repo asks whether you want to hunt the bug yourself with guidance.
How to invoke it
/pocketto:bug-hunting "checkout total is off by one cent"On Pi: "fix bug", "debug", "why is X broken", or a proactive audit request.
How it works
The three iron laws:
LAW 1: NO FIX WITHOUT CONFIRMED ROOT CAUSE
LAW 2: NO CLAIM WITHOUT EVIDENCE
LAW 3: FIX THE SOURCE, NOT THE SYMPTOMThe five phases each complete before the next, with no skipping:
- Reconnaissance: expected behavior (what it should do), bug type (logic, race, data corruption, integration…), components involved, common bugs in the domain. Unclear expected behavior stops the investigation here.
- Evidence hunt: read every error line, reproduce consistently, check recent changes, add diagnostic instrumentation at component boundaries. Every piece is classified
CONFIRMED,SUSPECTED, orTHEORETICAL. No fix attempts in this phase. - Blast radius: the primary bug plus at least two additional suspects sharing the pattern, each with severity (Critical → Low). Fixing one bug while missing three siblings is a delay, not a fix.
- Root cause trace: trace backward from the crash site to the origin; form one hypothesis ("root cause is X because confirmed evidence Y") and test minimally. Three failed hypotheses means an architectural problem. Stop and discuss before fix #4.
- Resolution: create the failing test first (TDD: it must fail for the right reason), fix one bug at a time at the source, apply defense-in-depth so the bug cannot recur, verify with the full suite.
Evidence language is policed: "almost certainly" → state the actual evidence or mark SUSPECTED; "probably X" → reproduce it or mark THEORETICAL; "fix is safe regardless of cause" → rejected outright.
Outputs and artifacts
The fix commits (test first, one bug at a time), plus the evidence trail in conversation. Proactive audits report findings with severity instead of changing code.
Approval gates and constraints
- No fix ships without a confirmed root cause: "quick fix now, investigate later" is a stop-and-return trigger.
- An Education repo asks before any implementation; a handover must be explicit.
- Security-adjacent fixes follow the same evidence rules. Verification is never outsourced to authority ("senior already confirmed it" is a red flag).
Example
Illustrative: "checkout total is off by one cent" → evidence: CONFIRMED on two cart shapes; blast radius finds the same rounding in refund logic; root cause traced to a float toFixed call at the pricing boundary, not the crash site; failing test added for the exact edge case; fix at the source plus a shared money helper; suite green.
Related documentation
- hotfix: small changes without a bug
- Pocket Education: you hunt, it guides
- Pipeline overview
Pocket Education
Pocket Education is the opt-in mentor mode: you write the code while the agent explains the task, reviews your diff, and coaches with a hint ladder.
hotfix
hotfix handles small-to-medium changes fast: a brief plan and an independent subagent review come before the first line of code, without the full pipeline.