agentleFS
MagicJoshMagicJosh/ras/skills/diagnose/SKILL.md

diagnose

Skill1 starsChanged 9 days agoMITView on GitHub

Use when the cause of a failure is unknown, such as a failing test, wrong output, flaky behavior or a fix that did not work. Not when the cause is known. Finds the root cause instead of patching the symptom.

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use zoom-out, to-prd and 10 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.
  • victorgarciaesgiSkill

    zoom-out

    Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.

    Also in 61 projects that use this

  • GoogleSkill

    to-prd

    Turn the current conversation into a PRD and publish it to the project issue tracker — no interview, just synthesis of what you've already discussed.

    Also in 56 projects that use this

  • GoogleSkill

    to-issues

    Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices.

    Also in 53 projects that use this

  • simo97Skill

    edit-article

    The user will invoke this skill to help them edit an article.

    Also in 17 projects that use this

  • simo97Skill

    write-a-skill

    Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.

    Also in 44 projects that use this

  • AnasX7Skill

    setup-pre-commit

    Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

    Also in 27 projects that use this

  • +4 more from simo97

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 174 edited versions we read keep these.

  • 3

    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:

    Keep the evidence: Before any restart, cache clear, delete or config change, record the time, revision, environment, inputs, logs and state.

    line 12
  2. Distinctive:

    If testing live is risky, use a copy, staging, read-only access, or old logs.

    line 26
  3. Distinctive:

    After three different failed approaches, stop.

    line 27

“Common” is measured: kept by at least 6 in 10 of the 174 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

Diagnose

Find the root cause. Do not patch before you understand.

Steps

  1. Keep the evidence. Before any restart, cache clear, delete or config change, record the time, revision, environment, inputs, logs and state. If something is still doing harm, make the smallest reversible containment first. Containment is not a fix.
  2. Build the loop first. Read the whole error. Make one command that fails on this bug, and run it. The loop is ready when it shows the user's exact symptom, gives the same verdict every run, and takes seconds. Form no theory before it exists. Raise the rate of a flaky failure (repeat, add load, narrow the timing) until it is workable. If you cannot build any loop, stop. Say what you tried, and ask for access or a redacted log.
    • If the report gives no failing case, write the invariant the symptom breaks in one sentence, for example "a paid order always has an invoice". Build the failing case from what the report leaves out: who acts (no user, another role), when (two actions at once, a retry, a timeout, a different order), and what state or input (empty, stale, duplicate). If you cannot run one of these cases, name it in the report, for example "concurrency: not tested".
    • If the symptom depends on state you cannot see, such as production data, another user's screen or a setting, and the code alone does not explain it, ask the user for that state before you change code. Ask for observations, not guesses: what they see, what changed and when, the exact records.
  3. Isolate. Cut the case down to the smallest one that still fails. Follow the data flow to the place where an invariant breaks.
  4. Rank the causes. List 2 to 4 causes, most likely first, each with a prediction: if it is the cause, changing X removes the failure. Show the list, but do not wait for an answer. Test the top cause first, one change at a time.
  5. Fix once. Find every caller of the broken code, and every writer of the broken state, not only the path in the report. Fix it where all of them pass through, with the smallest change that removes the cause.
  6. Prove it. Run the loop again. It must now pass. Make the reduced case a regression test where the bug really happens. Undo the fix, see the test fail, then restore the fix. If no test can reach that place, report it as a design finding. Explain why the cause is gone.

Rules

  • Once the cause is known, fix it like any other change. If the fix touches a risky path, the hook asks for a spec first. Then criterion 1 is the reproduction, and it fails before the fix.
  • Tag every temporary debug line with one prefix, such as [DEBUG-a4f2], and remove them all before you report.
  • Redact secrets in all output that you show.
  • If testing live is risky, use a copy, staging, read-only access, or old logs.
  • After three different failed approaches, stop. Report what you tried, what the evidence shows, and the structural options. Do not try a fourth guess.
  • Report: the cause, the evidence, the fix, the proof, and what is still uncertain.

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.