/lich-skills:debug-hypothesisfrom lich-skills
Forces a scientific-method debugging loop (Observe → Hypothesize → Experiment → Conclude) to stop guessing and start reasoning. Use for crashes, flaky tests, performance regressions, or CI-only failures.
Ships in lich-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.
None: SKILL.md is the whole skill.
A four-phase loop that turns debugging from "try random fixes and hope" into a disciplined investigation. Each phase has a goal, hard rules, and a rationalization table for the excuses an agent will invent to skip it.
The core principle: you may not write a fix until you have evidence that your hypothesis is correct. Guessing is not debugging.
If the bug survived one fix attempt, switch to this skill immediately.
OBSERVE ──▶ HYPOTHESIZE ──▶ EXPERIMENT ──▶ CONCLUDE
│ │ │ │
▼ ▼ ▼ ▼
Gather List 3-5 One minimal Root cause
symptoms, possible test per confirmed
reproduce causes + hypothesis, or loop
reliably evidence max 5 lines back
│ │ │ │
└──────────────┴──────────────────┴───────────────┘
write everything to DEBUG.md
Hard rules:
DEBUG.md. Context compaction will eat your
reasoning if it only lives in the conversation.Goal. Collect raw facts. Reproduce the bug. Separate what you know from what you assume.
Steps.
DEBUG.md under ## Observations.Exit criteria.
DEBUG.mdCommon Rationalizations
| Excuse | Reality |
|---|---|
| "I already know what's wrong" | Then write it as a hypothesis and prove it. If you're right, it takes 2 minutes. |
| "Let me just try this quick fix first" | That's how you end up 45 minutes deep with 6 failed attempts. |
| "The error message is clear enough" | Error messages describe symptoms, not causes. NullPointerException tells you what died, not why. |
| "I don't need to reproduce it, I can see the bug in the code" | Can you? Then why hasn't it been fixed yet? |
Goal. Generate 3-5 possible root causes. For each, list supporting and conflicting evidence from Phase 1. Rank by likelihood.
Steps.
DEBUG.md under ## Hypotheses.Example format in DEBUG.md:
## Hypotheses
### H1: Race condition in session middleware (ROOT HYPOTHESIS)
- Supports: only happens under concurrent requests, timing-dependent
- Conflicts: none yet
- Test: add mutex lock around session read, check if bug disappears
### H2: Stale cache returning expired token
- Supports: works after restart (cache cleared)
- Conflicts: cache TTL is 5min, bug appears within 30s
- Test: disable cache, reproduce
### H3: Wrong env variable in CI
- Supports: works locally, fails in CI
- Conflicts: env diff shows identical values
- Test: print actual runtime value in CI logs
Exit criteria.
DEBUG.mdCommon Rationalizations
| Excuse | Reality |
|---|---|
| "I only have one theory" | You have one favorite theory. Think harder. What if it's not that? |
| "Writing this down is slow" | Debugging without writing is slower. You'll forget hypothesis 2 after compaction eats it. |
| "The first hypothesis is obviously right" | Then proving it takes 2 minutes. If you skip proof, you'll spend 30 minutes when it turns out wrong. |
| "I don't have conflicting evidence" | That means you haven't looked hard enough, or it really is the root cause. Either way, test it. |
Goal. Test the ROOT HYPOTHESIS with the smallest possible change. You are a scientist — you are trying to falsify, not confirm.
Steps.
DEBUG.md under ## Experiments.Experiment rules.
Exit criteria.
DEBUG.mdCommon Rationalizations
| Excuse | Reality |
|---|---|
| "Let me just fix it instead of testing" | Fixing without confirming the cause is how you ship a wrong fix that breaks something else. |
| "I'll test two things at once to save time" | When both change and the bug disappears, which one fixed it? Now you have to test again. |
| "5 lines isn't enough" | 5 lines is enough to add a log, an assertion, a hardcoded value, or a short-circuit. If it isn't, your hypothesis is "something is wrong somewhere" — not a hypothesis. |
| "I don't need to revert, the fix is basically the experiment" | The experiment is diagnostic. The fix is production code. They have different quality bars. |
Goal. Confirm root cause, write the real fix, and add a regression test.
Steps.
DEBUG.md.DEBUG.md.DEBUG.md with the final ## Root Cause and ## Fix sections.Exit criteria.
DEBUG.md complete with full investigation trailCommon Rationalizations
| Excuse | Reality |
|---|---|
| "I don't need a regression test, it's a simple fix" | Simple fixes for simple bugs don't need this skill. You're here because it wasn't simple. Add the test. |
| "The DEBUG.md is just for debugging, I'll delete it" | Keep it. Future-you debugging the same area will thank present-you. |
| "All hypotheses failed, I'm stuck" | Go back to Observe. You missed something. The bug exists, therefore a cause exists. |
The #1 failure mode of AI debugging: the agent forms a theory, writes 150 lines of "fix" code, it doesn't work, so it writes another 150 lines going deeper into the same wrong theory.
This skill exists to prevent that. If you catch yourself or the agent:
Write it down. Test it. Prove it. Then fix it.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
debugging, hypothesis-driven, scientific-method, bug-fixing, debug-loop
12 skills in this plugin
/build-until-passUse when a build, typecheck, lint, or test command is failing and you want the agent to drive it to green on its own — run the check, read the errors, apply the smallest fix, re-run, repeat until exit code 0. Stops the human from being the while-loop (run → read error → fix one line → run again) and stops the agent from bulldozing huge speculative rewrites between checks./frontend-designCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics./go-no-goUse BEFORE any spec, plan, or code exists — the Stage 0 gate that decides whether a project should start at all. NO-GO is the default. GO requires passing five framework checks (Differentiation · Audience–Market Fit · Acquisition Channel · Capacity · 7-Factor Wedge), a memory check against your own prior attempts, and a 24-hour pattern-interrupt if enthusiasm-high is detected. Output is a public commitment artifact with pre-mortemed kill criteria (D14/D30/D60/D90 review gates). Triggered by "/go-no-go [project]", any "I want to build / start / take on X" intent, or before opening any new repo or signing any new contract. Pairs with spec-driven-dev (this is Stage 0, that is Stage 1)./google-analyticsAnalyze Google Analytics 4 data — review website performance, identify traffic patterns, diagnose high-bounce pages, compare time periods, and suggest data-driven improvements. Use when the user asks about analytics, website metrics, traffic analysis, conversion rates, user behavior, or performance optimization./nano-bananaGenerate or edit images with Google's Nano Banana 2 (`gemini-3.1-flash-image-preview`). Use when the user asks to generate an image, edit an image, or create a picture. Supports 512 / 1K / 2K / 4K resolutions./skills-mapUse at the START of any task, or whenever you are unsure which lich-skill applies. The router for this collection — it maps every lich-skill to the phase of work it belongs to (Decide → Spec → Plan → Build → Debug → Fan-out → Research → Media → Analyze) and walks a decision tree to pick the right one. Prevents the two failure modes of a skill collection: forgetting a skill exists, and reaching for the wrong skill at the wrong phase. Triggered by "/skills-map", "which skill should I use", "what skills do I have", or any moment of skill-selection doubt.npx claudepluginhub lichamnesia/lich-skills --plugin lich-skillsOther plugins' skills for the same job