agentleFS
balanced7balanced7/akashic-aurora/.claude/skills/root-cause-before-fixes/SKILL.md

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.

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
  1. Distinctive:

    If you cannot say Y, you are not done investigating.

    line 23
  2. Distinctive:

    After three failed fix attempts on the same target: stop patching and question the architecture.

    line 34
  3. Very specific:

    If the fix generalizes, record it while the context is loaded — the hook's pre-filled learn command is one edit away from done.

    line 45

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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)

  1. 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.
  2. 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.)
  3. Trace to the cause, not the site. Compare against the nearest WORKING analog (a passing test, a sibling module) and diff the assumptions.
  4. 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.
  5. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.