skills/diagnosing-bugs/SKILL.md
Use when diagnosing bugs, debugging failures, chasing regressions, explaining broken/throwing/failing/slow behavior, or building a repro/root-cause loop before fixing code.
npx skillsauth add paulrberg/dot-agents diagnosing-bugsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Loop-first debugging for hard bugs and performance regressions. Do not theorize until there is a tight signal that can catch the user's exact symptom.
scripts/hitl-loop.template.sh: copy and edit only when an unattended repro is impossible and the user must perform manual steps.Produce one command that can go red on the bug and green after the fix. Run it at least once before moving on.
Prefer loops in this order:
scripts/hitl-loop.template.sh.Tighten the loop until it is:
If no loop is possible, stop. State what was tried and ask for a captured artifact, repro access, or permission to add temporary instrumentation.
Run the loop and confirm it fails for the same symptom the user reported. If it finds a nearby but different failure, fix the loop before continuing.
Minimize one variable at a time: inputs, callers, config, data, timing, mocks, environment, and steps. After every cut, rerun the loop. Stop minimizing when every remaining element is load-bearing.
Write 3-5 ranked hypotheses before testing any of them. Each hypothesis must include its falsifying prediction:
If <cause> is true, then <probe/change> will make <observable result> happen.
Briefly show the ranked list to the user when useful, especially when domain or deployment history could reorder it. If they are unavailable, proceed with the current ranking.
Map every probe to a hypothesis prediction. Change one variable per run.
Prefer:
Prefix temporary logs with a unique token such as [DEBUG-a4f2] and remove them before completion. For performance bugs, establish a baseline measurement first, then profile or bisect; logging is usually the wrong first tool.
Before the fix, turn the minimized repro into a failing regression test if a correct seam exists. The seam is correct only if it exercises the real bug pattern as it happens at the call site.
If no correct seam exists, document that as an architecture risk and keep the original feedback loop as the verification command.
Then:
Before declaring done:
development
Refactor naming and repository structure exhaustively while preserving behavior and external contracts.
tools
Uses Chrome DevTools via MCP for efficient debugging, troubleshooting and browser automation. Use when debugging web pages, automating browser interactions, analyzing performance, or inspecting network requests. This skill does not apply to `--slim` mode (MCP configuration).
testing
Audit an entire repository with fresh eyes for correctness errors, bugs, omissions, duplication, inconsistencies, and other evidenced mistakes; fix every safe issue and verify the result.
development
Autonomous overnight codebase improvement with bounded runtime, evidence-gated changes, and verification.