root-cause-first
Skill15 starsChanged 5 months agoMITView on GitHub
Root-cause-first debugging and repair workflow. Use when asked to fix a bug, runtime error, failing test, broken tool/agent behavior, unexpected logs, regression, flaky behavior, architecture issue, or any request that says "fix", "debug", "solve from the root", "no band-aids", "no fallback", or "understand what is happening before changing code". Do not use for greenfield feature work, mechanical edits, or cleanup without an observed failure.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- Tcuzzo/backs-aios-skillstheir own version, first seen Nov 3, 2026
- benjaminard/fable-skillstheir own version, first seen Jul 2, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- benjaminard/fable-skills★ 30same name
- Tcuzzo/backs-aios-skills★ 2same 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 repositoryOne other file it gives its agents.
- ssot-enforcerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 15 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill to prevent premature patches.
- Very specific: line 25
If the root cause is duplicated constants, scattered policy, parallel calculations, copied parsing, or multiple modules answering the same …
- Distinctive: line 29
Do not use this skill for:
- Distinctive: line 45
Read the code that produces the failure and the code that consumes its output.
- Distinctive: line 46
Prefer logs, tests, traces, raw API responses, local reproduction, and call sites over assumptions.
- Distinctive: line 51
If there are multiple plausible causes, list what evidence confirms or eliminates each one.
- Distinctive: line 52
Do not implement until there is one primary cause or a clearly bounded uncertainty.
- Distinctive: line 55
Do not add fallback, retry, catch-and-continue, synthetic success, timeout inflation, broad parsing, or error suppression unless the root …
- Distinctive: line 56
If such handling is truly needed, state why it is not masking the failure and what invariant it preserves.
- Distinctive: line 60
Keep the patch scoped to the root cause.
- Very specific: line 61
If the source of the bad state is duplicated or scattered truth, consolidate it through ssot-enforcer instead of adding a local workaround.
- Distinctive: line 62
Add diagnostics when future failures would otherwise be ambiguous.
- Distinctive: line 64
Verify against the original failure.
- Distinctive: line 65
Add or update a regression test that fails on the old behavior.
- Distinctive: line 66
Run the narrow test first, then broader typecheck/test coverage as risk requires.
- Very specific: line 67
If the fix cannot be fully verified in-environment (visual/UI/device-only behavior, or unavailable services), say so explicitly and name …
- Very specific: line 83
Root-cause trace: Follow where user is built.
- Very specific: line 97
Verification: Add a regression test: loadUser() for a pre-backfill account returns a non-null profile.
- Distinctive: line 101
Stop and ask or report a blocker when:
- Distinctive: line 108
Keep the close-out short:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Root Cause First
Use this skill to prevent premature patches. The goal is to make the smallest correct change only after the failure mechanism is understood.
Red Flags — Stop If You Catch Yourself Thinking
These thoughts mean you are about to ship a band-aid. Stop and find the mechanism first.
| Thought | Reality |
"I'll add a ?. or null-check so it stops crashing" | You are hiding the signal. Ask why it is null and fix that. |
| "Wrapping it in try/catch makes the error go away" | Catch-and-continue turns a loud bug into a silent one. |
| "The test is flaky, let me add a retry or a longer timeout" | Flaky means a real race or order dependency. Retry hides it. |
| "I'll widen the parser to accept the weird input too" | The weird input is the clue. Find who produced it. |
| "I'll return a default on error so the flow continues" | Synthetic success masks the failure from everyone downstream. |
| "It works now, I am not sure why" | Then it is not fixed. You moved the bug. |
Relationship To SSOT Enforcer
If the root cause is duplicated constants, scattered policy, parallel calculations, copied parsing, or multiple modules answering the same question, switch to ssot-enforcer for the consolidation step. After consolidation, return here to verify the fix against the original failure.
When Not To Use
Do not use this skill for:
- New features or design work where there is no failure to explain.
- Mechanical edits such as renames, formatting, dependency bumps, or documentation cleanup.
- Broad architecture cleanup unless it is tied to a concrete symptom, failing test, bad runtime behavior, or user-reported regression.
Required Workflow
- State the observed failure in concrete terms.
- Quote the exact error, log line, failed assertion, bad behavior, or user-visible symptom.
- Identify where in the execution path the failure happens.
- Reconstruct the intended contract.
- Determine what the component is supposed to guarantee.
- Identify upstream inputs, downstream consumers, and invariants that must hold.
- Trace the real path before editing.
- Read the code that produces the failure and the code that consumes its output.
- Prefer logs, tests, traces, raw API responses, local reproduction, and call sites over assumptions.
- Distinguish provider/tool behavior from adapter/parser/orchestrator behavior.
- Name the root cause.
- Explain the mechanism that makes the observed failure inevitable or likely.
- If there are multiple plausible causes, list what evidence confirms or eliminates each one.
- Do not implement until there is one primary cause or a clearly bounded uncertainty.
- Reject band-aids explicitly.
- Do not add fallback, retry, catch-and-continue, synthetic success, timeout inflation, broad parsing, or error suppression unless the root cause proves that behavior is the correct product contract.
- If such handling is truly needed, state why it is not masking the failure and what invariant it preserves.
- Implement the root fix.
- Change the source of the bad state or the incorrect contract boundary.
- Keep the patch scoped to the root cause.
- If the source of the bad state is duplicated or scattered truth, consolidate it through
ssot-enforcerinstead of adding a local workaround. - Add diagnostics when future failures would otherwise be ambiguous.
- Verify against the original failure.
- Add or update a regression test that fails on the old behavior.
- Run the narrow test first, then broader typecheck/test coverage as risk requires.
- If the fix cannot be fully verified in-environment (visual/UI/device-only behavior, or unavailable services), say so explicitly and name exactly what a human must check. Do not claim success you could not observe.
- In the final answer, report root cause, fix, and verification.
Worked Example
Symptom. TypeError: cannot read 'email' of undefined thrown in renderProfile() for ~2% of users.
Band-aid (what to avoid).
// Crash disappears, but those users now silently render a blank email.
const email = user.profile?.email ?? "";The optional chain suppresses the only signal that something upstream is wrong.
Root-cause trace. Follow where user is built. loadUser() returns the record before profile is hydrated for accounts created before the profile backfill. The invariant "every user has a profile" is violated at the data layer, not in the view.
Root fix. Enforce the invariant at the source so every consumer can trust it:
// loadUser() now owns the invariant: it always returns a non-null profile.
function loadUser(id) {
const row = db.fetchUser(id);
return { ...row, profile: row.profile ?? defaultProfile(row.id) };
}Now renderProfile() can trust its input and the ?. is unnecessary. (The invariant has exactly one owner — see ssot-enforcer.)
Verification. Add a regression test: loadUser() for a pre-backfill account returns a non-null profile; renderProfile() renders without optional chaining and the old input reproduces the original crash on the unpatched code.
Stop Conditions
Stop and ask or report a blocker when:
- The failure cannot be reproduced or located after reading the relevant path.
- Required credentials, services, logs, or artifacts are unavailable.
- Fixing the real cause requires a product decision rather than an engineering correction.
Final Answer Shape
Keep the close-out short:
Root cause:one concrete mechanism.Fix:what changed and where.Verification:commands/tests run and any remaining risk.
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.

