Disciplined diagnosis loop for hard bugs, regressions, failures, flakes, and performance problems. Use when the user says "diagnose", "debug this", "this is broken", "why is this failing/slow", or reports a bug that needs a tight repro before fixing. Adapted from mattpocock/skills.
The skill is the feedback loop. Do not jump from symptom to theory until there is a red-capable command that exercises the user's actual bug.
Prefer, in order:
Completion criterion:
If no loop is possible, stop and ask for a trace, log, access, or permission to add temporary instrumentation.
Run the loop. Confirm it fails for the user's symptom. Then remove inputs, config, steps, and callers one at a time until every remaining part is load-bearing.
Write 3-5 ranked hypotheses. Each must predict what would change if it were true. Show the list briefly; proceed if the user is AFK.
Change one variable at a time. Prefer debugger/REPL over logs. If logging, tag every temporary line with a unique prefix and remove it before finishing.
Turn the minimized repro into a regression test when a correct seam exists. If no correct seam exists, document that as an architecture finding and consider codebase-design.
Before declaring done:
tdd when the bug can be fixed test-first.counterfactual when expected behavior needs formal comparison.recent-code-bugfix when the bug likely came from recent commits.webapp-testing for browser-visible bugs.Upstream: github.com/mattpocock/skills/skills/engineering/diagnosing-bugs/SKILL.md at 5d78bd0903420f97c791f834201e550c765699f8.