/debug
Systematic bug investigation: reproduce, isolate, hypothesize, fix, verify, prevent.
Usage
/debug "<description>" [--bisect] [--trace]
What It Does
Follows a systematic debugging protocol to find and fix bugs. Generates hypotheses ranked by likelihood, tests them methodically, implements a minimal fix, and adds a regression test.
Implementation
- REPRODUCE -- create consistent reproduction steps from the description.
- ISOLATE -- narrow to the smallest reproduction case. Check recent changes with
git log. - HYPOTHESIZE -- form 2-3 specific, testable theories ranked by likelihood.
- TEST -- validate hypotheses systematically, starting with most likely.
- FIX -- implement minimal, targeted fix addressing root cause.
- VERIFY -- confirm fix resolves the issue without regressions.
- PREVENT -- add regression test to prevent recurrence.
If --bisect: use git bisect to find the commit that introduced the bug.
If --trace: add detailed logging to trace execution path.
Examples
# Debug a specific issue
/debug "API returns 500 intermittently on /users endpoint"
# Use git bisect to find when bug was introduced
/debug "Search results are empty" --bisect
# Add tracing to understand execution flow
/debug "Session expires too early" --trace