root-cause-before-fixes
Skill8 starsChanged 38 days agoApache-2.0View on GitHub
Use when encountering any bug, test failure, hook misbehavior, or unexpected output — BEFORE proposing or applying any fix, even a one-liner that looks obvious. Also use when a fix you tried didn't work, and especially after a third failed attempt.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/akashic-memory.mdcCursor rule
- akashic-memorySkill
- plan-with-the-corpusSkill
- verified-doneSkill
- akashic-memorySkill
- deconstructSkill
- plan-with-the-corpusSkill
- reverse-engineeringSkill
- root-cause-before-fixesSkill
- shader-craftSkill
- verified-doneSkill
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 23
If you cannot say Y, you are not done investigating.
- Distinctive: line 34
After three failed fix attempts on the same target: stop patching and question the architecture.
- Very specific: line 45
If the fix generalizes, record it while the context is loaded — the hook's pre-filled learn command is one edit away from done.
≈ “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 before fixes
Iron Law: no fixes without root-cause investigation first. A fix applied to a symptom costs three later sessions; five minutes of tracing costs five minutes.
Phases (in order, no skipping)
- Reproduce and READ the actual error. The real message, the real exit code, the real line — not your memory of similar errors. On this repo the transcript keeps every failure; quote it to yourself before theorizing.
- Pull what's known.
py agent_cli.py recall-at --path <file>(or--command "...") surfaces prior lessons and anti-patterns for this exact target — someone may have paid for this bug already. (Hooks do this automatically before Edit/shell actions; pull manually when investigating.) - Trace to the cause, not the site. Compare against the nearest WORKING analog (a passing test, a sibling module) and diff the assumptions.
- State a single hypothesis out loud: "I think X is the root cause because Y." If you cannot say Y, you are not done investigating.
- Fix with evidence. Failing test (or failing command) first, watch it fail, apply the fix, watch it pass. An Edit that "should" fix it is a hypothesis, not a fix.
Red-flag rationalizations (stop when you hear yourself think these)
- "Just try this first, then investigate if it doesn't work"
- "I don't fully understand it, but this might work"
- "It's probably the same issue as before" (verify — this repo's history rewrote SHAs once)
- "The error is misleading" (errors are evidence; your model of the code is the suspect)
The 3-strikes escalation
After three failed fix attempts on the same target: stop patching and question the architecture. State what invariant the design assumed that reality violated. Record it — that insight is an anti-pattern lesson:
py agent_cli.py learn <id> --experiment <slug> --anti-pattern <slug> \
--tried "3 fixes that failed: ..." --result "the design assumption that was wrong" \
--recommend "Use when <symptom> recurs: question <assumption> before patching."When the fix lands
The FAIL→SUCCESS flip auto-credits whatever lessons were surfaced (the funnel is watching).
If the fix generalizes, record it while the context is loaded — the hook's pre-filled
learn command is one edit away from done.
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.

