From kernel
Systematic debugging methodology using Zeller's scientific method: reproduce, hypothesize, isolate via binary search, fix root cause, and add regression tests.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kernel:debugThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<skill id="debug">
AgentDB read-start has run; check past failures, you may have seen this pattern. Reference on demand: skills/debug/reference/debug-research.md.
1. **REPRODUCE**: get specific before touching code. - Document: exact input, expected output, actual output (full stack trace), environment, frequency. - "Sometimes fails" is not a reproduction. Get deterministic. - (gate: can reproduce consistently, OR have added targeted logging to wait for next occurrence)HYPOTHESIZE: list 3 causes before pursuing any.
ISOLATE: binary search, O(log n) not O(n).
git bisect between known-good and known-bad commit. ~10 tests for 1000 commits.ROOT CAUSE: the error line is the FAILURE. The DEFECT is upstream.
FIX: root cause, not symptom.
<anti_patterns> Shotgun (random changes until it works) · fix-and-pray (never re-run the original case) · symptom fixing (null check at the crash site) · printf flooding (binary search first, then targeted logging) · blame-the-framework (it's almost never the library) · unscoped "investigate" (scope narrowly or use a subagent so the file reads don't fill context). </anti_patterns>
<when_stuck> Explain the problem in writing · re-read the error message (the answer is there most of the time) · reduce to a minimal reproduction · ask "what changed?" (git log/diff, deps, env) · search the exact error message in quotes · step away, bias accumulates. Re-run the EXACT original failing case before declaring victory; "seems to work" is not evidence. </when_stuck>
30+ min on one hypothesis with no evidence → abandon it. 3+ hypotheses rejected → step back, re-examine assumptions. 2 failed fix attempts → invoke tearitapart; it may be a design problem. Repeated failed corrections in one session → /clear with a minimal reproduction. Bug only in production → add targeted monitoring, document, move on. For 3+ plausible causes, spawn one fresh-context agent per hypothesis (evidence_for / evidence_against / confidence); fresh context catches what a long session anchors past.<on_complete> agentdb write-end '{"skill":"debug","bug":"","root_cause":"<what_broke>","fix":"<what_fixed>","test":"<regression_test_name>","learned":"<pattern_for_future>"}' </on_complete>
npx claudepluginhub ariaxhan/kernel-claude --plugin kernelDisciplined methodology to isolate bugs through hypothesis-driven testing. Form hypotheses, test them with minimal changes, narrow scope systematically. Use when bugs are unclear or reproduce intermittently.
Step-by-step debugging methodology: reproduce, read, hypothesize, bisect, fix, regression-test. Trigger for any bug, test failure, crash, or unexpected behavior.
Debugs systematically with hypothesis preflight, single-change iterations, and regression tests. Use for bugs, errors, exceptions, regressions, test failures, or production outages.