debug-root-cause
Skill9 starsChanged 5 months agoApache-2.0View on GitHub
Diagnoses a failing test, crash, exception, or wrong output by reproducing the failure, isolating the cause, and fixing at the root — never by suppressing the error or weakening assertions.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- RedGranite/smartskilltheir own version, first seen Sep 11, 2026
- turntuptechnologies-ai/skillstheir own version, first seen Aug 6, 2026
- HumanDealer/vibeprooftheir own version, first seen Jun 4, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- HumanDealer/vibeproof★ 2same name
- turntuptechnologies-ai/skills★ 1same name
- RedGranite/smartskill★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository147 other files it gives its agents.
- second-brain/AGENTS.mdAGENTS.md
- second-brain/CLAUDE.mdCLAUDE.md
- agent-tool-mcp-builderSkill
- api-design-reviewSkill
- async-concurrency-correctnessSkill
- audit-accessibility-wcagSkill
- audit-license-complianceSkill
- audit-technical-seoSkill
- auth-jwt-sessionSkill
- author-codemodSkill
- brainstorm-designSkill
- build-audit-loggingSkill
- build-cdc-streaming-pipelineSkill
- build-cli-toolSkill
- build-data-tableSkill
- build-etl-pipelineSkill
- build-form-validationSkill
- build-native-mobile-uiSkill
- build-office-docsSkill
- build-offline-first-syncSkill
- build-react-componentSkill
- build-realtime-channelSkill
- build-spreadsheetSkill
- build-vector-searchSkill
- caching-strategySkill
- cicd-pipeline-authorSkill
- cloud-cost-optimizeSkill
- code-commentsSkill
- code-reviewSkill
- compose-local-dev-stackSkill
- configure-bundler-buildSkill
- configure-dns-tlsSkill
- configure-reverse-proxy-lbSkill
- configure-security-headers-cspSkill
- contract-testingSkill
- datetime-timezone-correctnessSkill
- db-migration-safetySkill
- debug-ci-pipeline-failureSkill
- debug-flaky-testsSkill
- debug-frontend-browserSkill
- defend-llm-prompt-injectionSkill
- deliver-webhooksSkill
- dependency-upgradeSkill
- deploy-releaseSkill
- design-api-paginationSkill
- design-authorization-modelSkill
- design-backup-dr-recoverySkill
- design-event-sourcing-cqrsSkill
- design-multi-tenancySkill
- design-protobuf-grpc-serviceSkill
- design-relational-schemaSkill
- design-search-index-infraSkill
- design-state-machineSkill
- design-token-systemSkill
- diff-table-paritySkill
- distributed-locks-leasesSkill
- dockerfile-optimizeSkill
- encrypt-sensitive-dataSkill
- error-messageSkill
- estimate-workSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Do NOT use for: greenfield feature work, "make it faster", or vague "improve this" — those aren't failures with a reproducible signal.
- Very specific: line 43
Heisenbug warning: if adding a log makes it pass, suspect timing/ordering/concurrency — the log changed scheduling.
- Distinctive: line 54
If you cannot produce a failing-then-passing test, you have not found the root cause — keep going, do not ship.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
When to Use
Invoke when a failure already exists and you need to find why:
- A test or build fails (red CI, failing assertion, compile error).
- An exception / crash / stack trace appears at runtime.
- Output is wrong, behavior doesn't match the spec, or a regression appeared.
Do NOT use for: greenfield feature work, "make it faster", or vague "improve this" — those aren't failures with a reproducible signal.
Steps
- Capture the exact signal first. Run the failing command yourself and copy the verbatim error: full message, stack trace, exit code, failing assertion, expected-vs-actual. Do not paraphrase or work from the user's summary — the real text usually names the file/line/value. If you can't reproduce it, you cannot fix it: stop and gather repro steps.
- Write a minimal failing test that reproduces it. Before touching any production code, encode the bug as a test (or a tiny script) that FAILS for the right reason. Run it, confirm it goes red, confirm the failure message matches step 1. This is your oracle — without it, "fixed" is a guess. For a crash with no test harness, write the smallest standalone repro that triggers it.
- Isolate by narrowing, not guessing.
- Shrink the input: delete half the data/config/steps; if it still fails, the removed half was irrelevant. Binary-search down to the smallest trigger.
- Bisect history: if it worked before,
git bisect(or diff against last-good commit) to find the introducing change. - Narrow the code path: comment out / short-circuit branches until the failure flips, then you've bracketed the cause.
- Trace the actual values. At the suspected boundary, log or breakpoint the real runtime values (types, nulls, lengths, timestamps, the thing right before it breaks). Compare what you assumed vs what's actually there. The gap is almost always the bug.
- Form one hypothesis and state it explicitly. "X is null because Y returns early when Z" — a single, falsifiable claim that explains the entire observed symptom (not just part of it). If your hypothesis only explains some of the evidence, it's wrong; keep tracing.
- Fix at the root and verify. Change the cause, not the symptom. Re-run the step-2 test → it must now PASS. Re-run the full suite → no new failures. Keep the reproduction test in the codebase as a regression guard.
- Show evidence. Paste the command(s) you ran and their output: red before, green after. "Fixed it" without the before/after output is not a finished fix.
Common Errors / Gotchas
- Patching the symptom. Wrapping the call in
try/catchthat swallows the error, adding?./if (x) returnto dodge a null, or// eslint-disabledoes NOT fix anything — it hides the next failure and creates a silent prod bug. Find whyxwas null in the first place. - Weakening the test to go green. Loosening an assertion, deleting a case, adding
.skip, bumping a tolerance, or asserting the buggy output as "expected" defeats the entire point. Never edit the test to make a broken fix pass. - Fixing without reproducing. "It's probably the cache" → blind edit → suite still red, now with extra noise. No repro = no fix; you can't confirm a cause you never isolated.
- Stopping at the first plausible cause. A hypothesis that explains part of the symptom (e.g. one of three failing cases) is incomplete. Account for all the evidence.
- Usual root causes to check fast: null/undefined, off-by-one / boundary, async timing & race (await missed, unresolved promise, ordering), shared/mutated state, type coercion (
==, string vs number, truthy0/""), stale cache or memoization, env mismatch (versions, locale, timezone, missing env var), encoding, float precision. - Heisenbug warning: if adding a log makes it pass, suspect timing/ordering/concurrency — the log changed scheduling. Don't conclude "can't reproduce", change tactic to deterministic timing.
Verify
You are done only when ALL hold:
- The minimal repro test exists in the codebase and fails on the old code, passes on the fixed code (you ran both).
- The fix targets the cause named in your hypothesis — not a guard/catch/skip around the symptom.
- The full test suite passes with no new failures and no assertions were weakened.
- You pasted the before (red) and after (green) command output as evidence.
If you cannot produce a failing-then-passing test, you have not found the root cause — keep going, do not ship.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

