agentleFS
LegendAppLegendApp/legend-skills/diagnose-fix-loop/SKILL.md

diagnose-fix-loop

Skill38 starsChanged 41 days agoMITView on GitHub

Use only when explicitly asked to run diagnose-fix-loop: repeat diagnosis, scoped fixes, and verification.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 1

    1. CherryHQ/cherry-studio-app★ 4.1k79% same

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository9 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to drive a complete improvement loop, not a single debugging pass.

    line 8
  2. Very specific:

    Before starting, load and follow $diagnose.

    line 10
  3. Very specific:

    Run a $diagnose pass. Record the causal evidence and exact validation signal to rerun after the fix.

    line 27
  4. Distinctive:

    If the user asked for delegation, use it only for bounded evidence collection inside this pass.

    line 29
  5. Distinctive:

    Prefer one smallest credible fix at a time.

    line 32
  6. Distinctive:

    Keep the edit scoped to the supported causal boundary.

    line 39
  7. Distinctive:

    Verify with the original signal.

    line 41
  8. Distinctive:

    Keep a short running log while working:

    line 57
  9. Distinctive:

    If an experiment fails, revert it unless it is independently useful and intentionally kept.

    line 65
  10. Distinctive:

    If two iterations produce no measurable improvement and no sharper evidence, pause implementation and re-diagnose the feedback loop itself …

    line 67
  11. Distinctive:

    Stop only when one of these is true:

    line 71
  12. Distinctive:

    When stopping, report the final state, the validation evidence, remaining known risk, and the smallest user action or artifact needed if …

    line 79

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

Diagnose Fix Loop

Use this skill to drive a complete improvement loop, not a single debugging pass.

Before starting, load and follow $diagnose. Treat $diagnose as the evidence engine for each pass; this skill only adds the outer loop that plans, implements, re-runs diagnosis, and decides whether to continue.

Explicit invocation opts in to $diagnose and authorizes scoped local fixes and verification. This skill owns implementation once evidence supports a credible cause and fix.

Selected installs do not install dependencies automatically. If $diagnose is not installed or available, stop before making changes. Tell the user to install it with:

npx skills add LegendApp/legend-skills --skill diagnose

Then ask them to retry after installation.

Loop

  1. State the target outcome. Anchor the loop to the user's symptom, performance goal, failing test, UX defect, regression, or code quality concern. If the user gave no concrete anchor, create the fastest observable feedback loop first.
  2. Run a $diagnose pass. Record the causal evidence and exact validation signal to rerun after the fix. Proceed on Proven or Supported evidence that justifies a scoped fix. If evidence remains Incomplete, continue useful available probes; stop when unavailable evidence prevents a credible fix, and report the gap. If the user asked for delegation, use it only for bounded evidence collection inside this pass; keep bottleneck ranking, fix selection, code edits, and final interpretation in the main loop.
  3. Make a ranked fix plan. Prefer one smallest credible fix at a time. The plan must include:
    • what evidence supports the change
    • what file or boundary will change
    • what validation should improve
    • what would make the plan wrong
  4. Implement only the top plan item. Keep the edit scoped to the supported causal boundary. Avoid stacking speculative cleanup, broad refactors, or adjacent improvements unless the diagnosis showed they are part of the same fault.
  5. Verify with the original signal. Re-run the reproduction path or measurement from step 2, then focused regression coverage, then broader checks when the touched surface warrants them.
  6. Re-run $diagnose. Diagnose the new state from evidence, not from the intent of the change. Look for:
    • the original symptom still failing
    • a nearby remaining fault
    • a regression introduced by the fix
    • a stronger next bottleneck revealed by the first fix
    • missing coverage at the real seam
  7. Decide whether to continue. Continue when evidence identifies a credible next fix and the next action is safe to take. Each new iteration should have a sharper target than the previous one.

Iteration Discipline

Keep a short running log while working:

  • iteration number
  • current evidence
  • chosen fix
  • validation result
  • next remaining issue or stop reason

If an experiment fails, revert it unless it is independently useful and intentionally kept. Do not count a failed experiment as progress unless it narrowed the diagnosis.

If two iterations produce no measurable improvement and no sharper evidence, pause implementation and re-diagnose the feedback loop itself before making more edits.

Stop Rules

Stop only when one of these is true:

  • $diagnose cannot build or run a credible feedback loop with available code, tools, or artifacts
  • the next action requires user input, inaccessible external state, credentials, production access, or a destructive operation
  • the user requested read-only diagnosis and the next useful step would edit files
  • validation is clean and a fresh $diagnose pass finds no remaining credible fault to fix
  • remaining improvements are speculative, cosmetic, or outside the user's target outcome

When stopping, report the final state, the validation evidence, remaining known risk, and the smallest user action or artifact needed if work is blocked.

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.