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

diagnose

Skill1 starsChanged 54 days agoMITView on GitHub

Use when something fails or behaves wrongly and the cause is unknown, such as an error, a failing test, wrong output, flaky behavior, or a fix that did not work. Finds the root cause instead of patching the symptom.

126 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use zoom-out, to-issues 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.
  • Hollis36Skill

    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 38 projects that use this

  • ninehillsSkill

    to-issues

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

    Also in 34 projects that use this

  • Hollis36Skill

    to-prd

    Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.

    Also in 38 projects that use this

  • kayamanSkill

    edit-article

    Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

    Also in 11 projects that use this

  • kayamanSkill

    request-refactor-plan

    Guides creating a detailed refactor plan with tiny commits via user interview, then files it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.

    Also in 9 projects that use this

  • AnasX7Skill

    scaffold-exercises

    Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.

    Also in 13 projects that use this

  • +2 more from kayaman

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 114 edited versions we read keep these.

  • 6

    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:

    Reproduce: Read the whole error, trace or output.

    line 13
  3. Distinctive:

    Prove it: Run the same reproduction.

    line 19
  4. Distinctive:

    If a restart makes the symptom go away, you have contained it.

    line 24
  5. Distinctive:

    If the live system is risky to test on, use a copy, staging, read-only access, or old logs.

    line 25
  6. Distinctive:

    After three different failed approaches, stop.

    line 26

“Common” is measured: kept by at least 6 in 10 of the 114 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. Reproduce. Read the whole error, trace or output. Make a command that fails, and run it. If it does not fail every time, measure the rate and the conditions. If you cannot reproduce it, add instrumentation and say so.
    • 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 a case, 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. Test one hypothesis. State it with a prediction and what would disprove it. Run a check that tells it apart from the other causes.
  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 same reproduction. It must now pass. Explain why the cause is gone, not just the symptom.

Rules

  • A spec is needed before the fix, as for any change. Criterion 1 is the reproduction, and it fails before the fix.
  • If a restart makes the symptom go away, you have contained it. You have not fixed it.
  • If the live system is risky to test on, 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.