build-until-pass
Use 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…
Use when debugging any non-trivial bug — wrong output, crash, flaky test, performance regression, or "it works locally but not in CI." Forces a scientific-method loop (Observe → Hypothesize → Experiment → Conclude) so the agent stops guessing and starts reasoning. Prevents the
$ npx -y skills add lichamnesia/lich-skills --skill debug-hypothesis --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/debug-hypothesisContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when debugging any non-trivial bug — wrong output, crash, flaky test, performance regression, or "it works locally but not in CI." Forces a scientific-method loop (Observe → Hypothesize → Experiment → Conclude) so the agent stops guessing and starts reasoning. Prevents the
name: debug-hypothesis description: Use when debugging any non-trivial bug — wrong output, crash, flaky test, performance regression, or "it works locally but not in CI." Forces a scientific-method loop (Observe → Hypothesize → Experiment → Conclude) so the agent stops guessing and starts reasoning. Prevents the #1 AI debugging failure mode — bulldozing through a wrong idea instead of falsifying it.
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.mdHard rules:
1. Everything gets written to `DEBUG.md`. Context compaction will eat your reasoning if it only lives in the conversation. 2. You may not write fix code during Observe, Hypothesize, or Experiment. 3. You may not skip Hypothesize. "I think I know what it is" is a hypothesis — write it down and test it like the others. 4. Each experiment changes at most 5 lines. If your experiment needs more, your hypothesis is too vague — split it.
**Goal.** Collect raw facts. Reproduce the bug. Separate what you *know* from what you *assume*.
**Steps.**
1. Reproduce the bug. Get the exact error message, stack trace, or wrong output. If you cannot reproduce it, that is your first finding. 2. Find the minimal reproduction. Strip away unrelated code until the bug still appears. 3. Record the environment: OS, runtime version, dependencies, config. 4. Note what *does* work. The boundary between working and broken is where the bug lives. 5. Write all observations to `DEBUG.md` under `## Observations`.
**Exit criteria.**
**Common 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.**
1. List 3-5 hypotheses. Not 1. Not "I think it's X." Three minimum. Think across categories:
2. For each hypothesis, write:
3. Mark the **ROOT HYPOTHESIS** — the one with supporting evidence and no conflicting evidence. If multiple qualify, pick the easiest to test. 4. Write everything to `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.**
**Common 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 hypoth
Personal skill collection for Claude Code, Gemini CLI, and OpenAI Codex — by @LichAmnesia. Telegraph-style, opinionated, no filler. Engineering judgment skills plus high-leverage utility tools. 中文版:README-zh.md
Use 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…
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web…
Use BEFORE any spec, plan, or code exists — the Stage 0 gate that decides whether a project should start at all. NO-GO is the…
Analyze Google Analytics 4 data — review website performance, identify traffic patterns, diagnose high-bounce pages, compare time…
Generate or edit images with Google's Nano Banana 2 (`gemini-3.1-flash-image-preview`). Use when the user asks to generate an…
Use at the START of any task, or whenever you are unsure which lich-skill applies. The router for this collection — it maps every…