Diagnosing Bugs#
Disciplined diagnosis loop for hard bugs and performance regressions.
Description#
The diagnosing-bugs skill enforces a six-phase discipline in which building a tight, red-capable feedback loop comes first and hypothesis building is forbidden until that loop exists:
Build a feedback loop — one fast, deterministic, agent-runnable command that goes red on the user’s exact symptom. Ten construction strategies are provided, from failing tests to bisection harnesses.
Reproduce + minimise — watch it go red, then shrink the repro until every remaining element is load-bearing.
Hypothesise — 3–5 ranked, falsifiable hypotheses, shown to the user before testing.
Instrument — probes mapped to predictions, one variable at a time, every debug log tagged (e.g.
[DEBUG-a4f2]) for one-grep cleanup. Performance regressions are measured and bisected, not logged.Fix + regression test — regression test before the fix, but only at a correct seam; a missing seam is itself a finding.
Cleanup + post-mortem — repro re-run, instrumentation removed, the winning hypothesis recorded in the commit message, and a what-would-have-prevented-this recommendation (the
complexityskill can quantify architectural hotspots).
Triggers#
/wf:diagnosing-bugs
Also: “diagnose this”, “debug this”, “performance regression”.
Output#
A fixed bug with a regression test (or a documented seam gap), a clean tree, and the confirmed hypothesis in the commit message.
Attribution#
Adapted from the diagnosing-bugs skill in
mattpocock/skills (MIT
license).