/writing-blogging:systematic-debuggingfrom writing-blogging
Forces root cause investigation before any fix: four phases (investigate, compare, test one hypothesis, fix with failing test) for bugs, test failures, build/CI failures, crashes, and performance problems. Stops after three failed fixes to question the design.
Ships in writing-blogging. 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.
Guessing at fixes feels fast and is slow. Each guess that half-works hides the real cause a little deeper, and the third patch usually breaks something the first one touched. This skill makes you find out why before you change anything.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you have not finished Phase 1, you cannot propose a fix. Not a "quick one to try", not "while we investigate". Suggesting a fix in your reply counts as proposing one.
The process scales. For a simple bug the four phases take a minute: read the error, confirm the cause, write the failing check, fix it. You never skip them, you just move through them quickly.
Any technical problem: test failures, production bugs, unexpected behavior, performance regressions, build or CI failures, integration issues, flaky tests.
Use it especially when:
Before attempting ANY fix:
Read the error completely. The whole message and stack trace, not the first line. Note file paths, line numbers and error codes. Errors often state the exact problem.
Reproduce it. Find the exact steps or command that trigger it, and check whether it happens every time. If you cannot reproduce it, gather more data (logs, instrumentation); do not guess.
Check what changed. git diff, recent commits, new dependencies,
config and environment differences. If there is a known-good commit and
a command that shows the bug, let git find the culprit:
git bisect start <bad> <good> && git bisect run <repro-command>,
then git bisect reset to return to your branch before you change
anything.
Gather evidence across component boundaries. When the system has layers (CI → build → deploy, UI → API → database, CLI → config → child process), do not guess which layer breaks. Add temporary logging at each boundary, run once, and let the output show where good data turns bad:
# Layer 1: CI job
echo "API_TOKEN in job: $([ -n "${API_TOKEN:-}" ] && echo SET || echo UNSET)"
# Layer 2: build script
echo "config file: ${CONFIG_PATH:-<unset>}"; test -r "${CONFIG_PATH:-}" && echo readable
# Layer 3: the service at startup
node -e 'console.log("NODE_ENV=", process.env.NODE_ENV)'
Log whether a secret is set, never its value. Then investigate the one layer the evidence points at.
Trace the data backward. When the error surfaces deep in a call
stack, ask where the bad value came from, then what called that, and
keep going until you reach the source. Fix at the source, not where it
crashed. Full technique: references/root-cause-tracing.md.
Done when you can say what is wrong and why, backed by something you observed, not something you assumed.
test-driven-development skill is installed, follow it here.verification-before-completion skill is installed, follow it
before you claim success.references/defense-in-depth.md covers where to put them).Signs the problem is the design, not a bug:
Do not attempt fix number four. Tell the user what you tried, what each attempt revealed, and why you think the pattern itself is unsound, and decide together whether to refactor or keep patching.
If you catch yourself thinking or writing any of these:
And if the user says things like "Is that actually happening?", "Stop guessing", "Will that show us anything?" or "Are we stuck?", you skipped the evidence. Go back to Phase 1.
| Excuse | Reality |
|---|---|
| "It's simple, I don't need the process" | Simple bugs have root causes too, and the process is fast for them. |
| "It's an emergency, no time" | Systematic debugging is faster than guess-and-check thrashing. |
| "I'll try this first, then investigate" | The first guess sets the pattern for every attempt after it. |
| "I'll add the test after the fix works" | A fix you never saw fail proves nothing. |
| "Several fixes at once saves time" | Then you cannot tell which one worked or which one broke something. |
| "I can see the problem" | Seeing the symptom is not understanding the cause. |
If the investigation shows the issue really is environmental, timing dependent or external (a flaky network, a third-party outage):
Be suspicious of this conclusion: before accepting it, ask what you have
not checked yet, because an investigation that stopped early looks the
same from the inside. For flaky tests, check for race conditions first;
see references/condition-based-waiting.md.
When you finish, tell the user in a few lines:
references/root-cause-tracing.md: trace a bad value backward through
the call stack to the place it was created.references/defense-in-depth.md: add validation at several layers once
the cause is fixed, so the same bug cannot come back silently.references/condition-based-waiting.md and
references/condition-based-waiting-example.ts: replace arbitrary
sleeps in tests with polling for the real condition.scripts/find-polluter.sh: run test files one by one to find which
test creates an unwanted file or state. Run it from the project root
with the path to this skill's copy, for example
bash .claude/skills/systematic-debugging/scripts/find-polluter.sh packages/core/.git 'src/**/*.test.ts'
(TEST_CMD sets the runner; default npm test).ATTRIBUTION.md (opens in a new tab)LICENSE (opens in a new tab)references/condition-based-waiting-example.ts (opens in a new tab)references/condition-based-waiting.md (opens in a new tab)references/defense-in-depth.md (opens in a new tab)references/root-cause-tracing.md (opens in a new tab)scripts/find-polluter.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub hackernoon/cuttlefish-agent-skills --plugin writing-blogging706 skills in this plugin
/academic-cv-builderFormat CVs for academic positions, including publications, grants, teaching, and research experience. Use when the user mentions academic CV, faculty job, tenure-track, postdoc, PhD, research position, or needs to list publications, grants, conferences, or teaching./accessibilityAudit and improve web accessibility following WCAG 2.1 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible"./adaptyvCloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.Other plugins' skills for the same job