/syv-skills:systematic-debuggingfrom syv-skills
Root-cause debugging for bugs, test failures, flaky tests, build failures, performance regressions and unexpected behaviour. Builds a fast reproducible feedback loop before proposing fixes.
Ships in syv-skills. 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.
Find the cause before changing code. The core of this skill is the feedback loop: one command you can run yourself that says "bug present" or "bug gone". With it, hypotheses and bisection are mechanical. Draw conclusions only from output you have observed, never from how you expect the code to behave.
If the cause is already clear (the error names the line, the fix fits in one sentence) and a test covers the area, skip the steps: write or extend a test that fails, fix, watch it pass. Use the full process when the cause is unclear, the bug is intermittent, or a first fix didn't work.
For anything beyond a quick fix, keep a short notes file (or use the work item): the loop command and the exact symptom, each hypothesis with its status (open, ruled out, confirmed) and the evidence, and each fix tried. Re-read it after compaction or when resuming. At cleanup, delete it or fold the useful part into the commit or PR.
You will show commands, output and captured artifacts. Write <REDACTED> in place of every secret. Build loops against environment variables so credentials stay out of what you show. From HAR files, logs and request dumps, quote only the lines that carry the signal; they usually also carry auth headers. When instrumenting near credentials, log whether a value is set, never the value.
Spend real effort here: a failing test at the seam that reaches the bug, a script against a running server, a CLI run diffed against known-good output, a headless browser script, a replayed payload, a bisection script. Then make it faster, sharper and more deterministic. Options, flaky bugs and bisection: feedback-loops.md.
The step is done when you can name one command, have run it at least once, and can show the invocation and its redacted output. The command is:
If you catch yourself reading code to build a theory before this command exists, stop and go back to building it.
When only the user can trigger the bug (a UI flow, a device, production): give them exact repro steps, add tagged instrumentation that writes JSON lines to a file you can read, and have them run the steps while you read the file. Keep the instrumentation in until the user confirms the fix.
If no loop is possible at all, say so and list what you tried. Ask for access to an environment that reproduces it, a redacted captured artifact (logs, HAR file, core dump, recording), or permission to add temporary instrumentation where it happens.
Run the loop and watch it go red. Then:
If this needs a broad read of the codebase, delegate it to an exploration subagent with a fresh context if your harness has one.
Find similar code in the project that works, and list every difference from the broken path, including the configuration and environment each assumes.
Write 3–5 ranked hypotheses before testing any. Each makes a prediction: "if X is the cause, changing Y makes the bug disappear." A hypothesis without a prediction can't be tested; sharpen it or drop it. Show the list to the user if they're around; they often know which to test first or which are already ruled out. If they're away, proceed with your ranking.
For a hard bug, you can run parallel investigators, one per hypothesis, each trying to disprove the others. This is expensive and optional, and each one that edits code needs its own worktree.
Each probe tests one prediction and changes one variable. Pick the cheapest probe that tells the hypotheses apart:
Tag every line you add (for example [DEBUG-a4f2]) so cleanup is one search. Tools, CLIs and production sources: evidence-sources.md. Update the debug log after each probe.
Turn the minimised repro into a test at a seam that reproduces the real triggering pattern; use the tdd skill's red-green loop. A test too shallow to trigger the bug gives false confidence, and if no such seam exists, record that as a finding. Watch the test fail first. If you forced the red by changing code or a fixture, diff against a pristine copy to prove the change landed. Then apply one fix at the root cause, with no bundled refactoring.
Leave existing tests alone: don't weaken, skip, delete or edit a test to make it pass, and don't special-case test inputs in the code. If a test looks wrong, stop and ask the user. Flagging it for a human is always an acceptable way out; a test changed to go green is not.
If the fix doesn't hold, revert it, note it in the debug log, and return to step 4 with the new evidence (to step 2 if the repro itself was wrong). After two failed fixes, stop. Repeated failures usually mean the approach or the architecture is wrong, not the latest hypothesis. Talk it through with the user, and suggest continuing in a fresh session that starts from the debug log (the handoff skill writes that summary), because a context full of failed attempts steers the next attempt.
Show the evidence rather than claiming the fix:
Then remove the instrumentation (search for the tag; for a repro the user ran, only after they confirm the fix), delete throwaway harnesses, record the confirmed cause where the project records such things (commit, PR, work item), and delete the debug log. Ask what would have prevented the bug; if the answer is structural (no good seam, hidden coupling), suggest the improve-codebase-architecture skill, which looks for shallow modules to deepen.
If the evidence runs out, write down what you investigated and ruled out, add handling or monitoring at the symptom so the next occurrence leaves better evidence, and tell the user plainly that the cause is still unknown.
Several changes in one run, a fix you can't explain, a second fix stacked on one that didn't work, or "fixed" without rerunning the loop. Go back to the loop.
/goal or a Stop hook can act as a verification gate, for example "the repro command exits 0 and the full suite passes, with no test file modified".npx playwright trace to read a trace, gdb -batch or lldb --batch for stack and state, rr to record and replay, git bisect run for regressions.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub syv-ai/agentic-coding-playbook --plugin syv-skills20 skills in this plugin
/brainstormingThinks an idea through with the user before anything is built — new angles and radical alternatives, their thoughts organised and drawn, every open decision settled — and ends in an agreed design. Use when a feature or behaviour change is underspecified, when several approaches are plausible, when the user wants to explore an idea or think a design through, or wants their thinking organised or mapped. To only be questioned on a plan that already exists, use grill-me./executing-plansExecutes a written implementation plan task by task, verifying each step and reviewing the result against the plan before calling it done. Use when there is an existing plan to implement, in this session or one started fresh from a handoff./grill-meInterviews the user relentlessly about an idea, plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when the user wants to stress-test a plan, get grilled on an idea or design, or mentions "grill me". It is the interview inside brainstorming; when the idea also needs alternatives or a written design, use brainstorming./guardrailsReviews what a coding agent could damage in this repo, notes the controls already in place, and asks which remaining risks to cover./handoffCompacts the current conversation into a handoff document so another agent can pick up the work. Use when you want to hand off to a fresh session, or when continuing in a clean context would work better than carrying this one forward./improve-codebase-architectureFind deepening opportunities in a codebase — refactors that turn shallow modules into deep ones — and present them as a visual HTML report. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.Other plugins' skills for the same job