/howtoai-builder:debug-systematicallyfrom How to AI — Builder
Finds root causes of bugs instead of patching symptoms — reproduce reliably, form falsifiable hypotheses, bisect the search space, and explain the mechanism. For 'debug this', flaky tests, or prod-only failures.
Ships in How to AI — Builder. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A bug is a gap between what you believe the system does and what it actually does. Debugging closes that gap by finding which belief is wrong — not by changing code until the symptom stops. The deliverable is a sentence explaining the mechanism, a fix that follows from it, and a test that would have caught it.
Reproduce → read → hypothesize → run the cheapest disproof → fix → explain. Restart the loop whenever a result surprises you; the surprise is the highest-value data you'll get, not noise to explain away.
An intermittent reproduction is the first bug to fix, ahead of the one you were asked about: you cannot verify a fix for something you can't trigger on demand. Drive toward a single command that fails every time — pin the seed, the input, the clock, the run order, the environment, then shrink the trigger until it's boring.
Record the exact failure signature (error text, exit code, wrong value). That string is what "fixed" gets measured against later.
If it genuinely can't be triggered, stop fixing and start instrumenting: log at the component boundaries, ship that, wait for evidence. A fix shipped without a repro is a guess with a deploy attached.
The full message, the entire stack (your frames are usually below the framework noise), the real log line — read them before theorizing. Note exact values, line numbers, and codes. A large share of "mysterious" bugs are stated plainly in output nobody scrolled to.
The error's location is where damage surfaced, not where it started. A null dereference in a renderer tells you the renderer received a null; it says nothing about who produced it.
State it so it could be wrong: "the cache returns before the fetch resolves, so X is null on first paint." Something's wrong with the auth flow is not a hypothesis.
Then design the cheapest experiment that could disprove it — one print, one value inspected, one curl, one check of what's actually deployed. Ask what you'd see if the hypothesis were false; if both outcomes look the same, the experiment is worthless. Confirmation is cheap and misleading; disproof is what moves you.
Reading code hoping to spot it scales badly. Halve the search space instead:
| Axis | Move |
|---|---|
| Time | git bisect run <cmd> — a script exit code turns a day of guessing into log₂(n) runs |
| System | Cut at a boundary (client/server, service/DB) and ask which side already sees bad data |
| Input | Shrink the failing input by half until it stops failing |
| Code | Comment out or stub half the pipeline: "does it still happen without X?" |
| Config | Diff against the last known-good state — deps, env, flags, migrations |
Every probe should split what's left. If a probe can only confirm a hunch, pick a different probe.
Order-dependent test failures have a script: bash scripts/find-polluter.sh --help
binary-searches which test file poisons another.
Shotgun debugging — change several things, re-run, see green — costs you the knowledge of which change worked and typically leaves two new bugs behind. If it's already happened, revert everything and reapply one change at a time.
Keep a short log of hypothesis → experiment → result; it stops you re-testing the same theory at hour three. Three failed hypotheses in one area means your model of the system is wrong — go back to the assumptions you never checked.
Done requires all three:
If you can't say why the fix works, you have a coincidence and the bug returns
under a new ticket number. Write the failing test first via
test-driven-development.
references/flaky-tests.mdreferences/production-bugs.mdgit bisect run recipe: references/tracing.mdawait, or a
debugger pause perturbs timing. If the symptom vanishes when you add a print,
that's evidence of a race — not a fix..pyc, a mock still returning yesterday's shape. Before
concluding "the change had no effect", prove the new code is the code running:
change something visible and watch it change.catch {},
|| fallback, .get(key, None), a swallowed non-2xx. Grep the path for them
early; each one is a place the real error was deleted.What SKILL.md sets; muted values are Claude Code's defaults
7 skills in this plugin
/code-reviewReviews someone's code, and handles feedback on yours — intent first, issues ranked by consequence, blocking vs non-blocking labeled. Use for "review this code", "review my PR", "look at this diff", or "how should I respond to this review comment"./git-worktreesRuns work in an isolated git worktree and closes the branch out cleanly. Use for "git worktree", "work on this in isolation", "finish this branch", "clean up my branch", "how do I merge this back", or removing a worktree without losing work./mcp-builderBuilds MCP servers an agent can actually use: tool design, results that fit the context budget, actionable errors, transport, auth. Use for "build an MCP server", "add an MCP tool", "expose my API to an AI assistant", or when tools get picked wrong./parallel-agentsSplits work across subagents running at once — what genuinely parallelizes, briefing each one cold, verifying what comes back. Use for "run these in parallel", "use subagents", "fan this out", "split this work up", or "delegate these tasks"./test-driven-developmentDrives implementation with the test written before the code — red, green, refactor — and knows when test-first is wrong. Use for "TDD", "write tests first", "test-driven", "add tests for this", "red green refactor", or adding a regression test./webapp-testingDrives a running web app in a browser to prove it works — real user flows, console and network evidence, failure paths, saved proof. Use for "test my app in the browser", "does this actually work", "check the page loads", or "verify the signup flow".npx claudepluginhub rubenhassid1/howtoai-skills --plugin howtoai-builderOther plugins' skills for the same job