agentleFS
requierequie/endostack/skills/principle-fix-root-causes/SKILL.md

principle-fix-root-causes

Skill4 starsChanged 15 days agoMITView on GitHub

Use for any debugging or bug fix. Repair the earliest point where the system decided wrongly, rather than where the bad state showed up. A guard is a real fix only for a state the system is permitted to reach.

48 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-pstack, poteto-help and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • bnemaSkill

    setup-pstack

    Configure which Pi models pstack uses per role. Detects available provider/model specs and writes pstack's user configuration. Use for /setup-pstack, "configure pstack models", or changing pstack model choices.

    Also in 25 projects that use this

  • ianclearySkill

    poteto-help

    Guides users through pstack setup, /poteto-mode, and picking the skill, playbook, or principle for a task. Type /poteto-help with a question.

    Also in 14 projects that use this

  • tristanphvnSkill

    ketchup-video

    Catch the user up like /keel:ketchup, with a short silent video of slides for what happened and the waiting calls as text under it. Use for /keel:ketchup-video.

    Also in 10 projects that use this

  • JoshueOsunaSkill

    Poteto Mode

    poteto's agent style for concise, detailed responses, deliberate subagents, unslopped prose, simple code, and verified work. Use for poteto, /poteto-mode, or requests to work in this style.

    Also in 3 projects that use this

  • instructureSkill

    ketchup

    Rebuild context after /clear by analyzing uncommitted changes across Canvas LMS and all plugin repositories

    Also in 17 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 48 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All debugging and bug-fix work.

    line 13
  2. Distinctive:

    Keep asking why until you reach a decision in code that was itself wrong, as opposed to one that followed correctly from an earlier mistake.

    line 18
  3. Distinctive:

    When you are stuck, instrument.

    line 19
  4. Distinctive:

    When a failure shows up just after restarts, look at persisted state before anything else: serialized sessions, caches, lock files, and …

    line 21
  5. Distinctive:

    If finding the deciding fact took deep digging, propose a cheap always-on signal (a log line, a metric, an assertion) that would have shown …

    line 24

“Common” is measured: kept by at least 6 in 10 of the 48 edited versions of this file we could read. “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

Fix root causes

Locate the earliest wrong decision the system made and repair it there, rather than at the spot where the damage became visible. Adding a guard counts as a fix only if the state it catches is a legitimate one for the system to be in.

When it applies

All debugging and bug-fix work. If several fixes resting on one assumption have already failed, combine this with principle-attack-the-premise.

What to do

  1. Reproduce the failure before changing anything.
  2. Keep asking why until you reach a decision in code that was itself wrong, as opposed to one that followed correctly from an earlier mistake.
  3. When you are stuck, instrument. Read the real error and the real state. Do not guess.
  4. Classify the triggering state. If it is legitimate, the code that failed on it is at fault, and handling it in that code is the right fix. If the state should never occur, testing for it where it showed up only conceals the bug, so follow it back to whatever created it. Be suspicious of guards, retries, swallowed exceptions, clamped values, and discarded state.
  5. When a failure shows up just after restarts, look at persisted state before anything else: serialized sessions, caches, lock files, and configuration on disk.
  6. Fix the pattern: search for all other sites that share the fault and repair each one.
  7. A workaround that needs a long comment to justify itself signals broken code, so change the code instead.
  8. If finding the deciding fact took deep digging, propose a cheap always-on signal (a log line, a metric, an assertion) that would have shown it immediately.

A security example. An agent's file tool crashes on a path containing ../. Adding if ".." in path: return at the crash site looks like a fix, but a path that escapes the workspace should never have reached the tool. The root cause is the boundary that accepted it without resolving and checking it against the workspace root. Fix it there, then search for every other tool that takes a path from model output, because each one has the same traversal hole.

The failure it prevents

Symptom patches hide evidence and let the fault resurface elsewhere. Unnamed workarounds pile up. A single-instance fix leaves sibling defects in place, and for security bugs those siblings are the next finding.

Done when

You traced the failure to a decision the code got wrong, repaired it at that spot, and repaired its siblings as well.

The comment-auditor agent flags justification comments as evidence of this failure. The how and why skills help trace a symptom back to its origin.

Related: principle-attack-the-premise, principle-prove-it-works, principle-boundary-discipline.

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.