agentleFS
Adit-Jain-srmAdit-Jain-srm/skill-forge/skills/diagnose/SKILL.md

diagnose

Skill2 starsChanged 6 months agoMITView on GitHub

Disciplined diagnosis loop for hard bugs and unexpected behavior. Forces reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when something is broken and you don't know why, when a bug seems intermittent, when a fix didn't work, or when user says diagnose, debug, investigate, or "why is this broken".

126 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use to-issues, to-prd and 9 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.
  • 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

  • AWSSkill

    setup-matt-pocock-skills

    Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

    Also in 27 projects that use this

  • +2 more from kayaman

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 114 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:

    Do NOT guess. Follow the loop.

    line 17
  2. Distinctive:

    Never skip REPRODUCE. "I think it fails when..." is not reproducing.

    line 35
  3. Distinctive:

    Never fix without a hypothesis.

    line 36

“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

Overview

Systematic debugging that produces evidence at every step — not guesswork, not shotgun fixes.

Process

Do NOT guess. Follow the loop. Every step produces evidence.

The Loop

1. REPRODUCE — make it fail on demand. If you can't reproduce, you can't fix.
2. MINIMISE — strip everything until only the bug remains. Smallest failing case.
3. HYPOTHESISE — ONE theory. Not three. One. State it clearly.
4. INSTRUMENT — add the ONE measurement that proves/disproves your hypothesis.
5. EVALUATE — run it. Was hypothesis correct?
   YES → go to step 6
   NO  → back to step 3 with new information
6. FIX — minimal change that addresses root cause (not symptoms)
7. REGRESSION TEST — write a test that would have caught this. Run it red then green.

Rules

  • Never skip REPRODUCE. "I think it fails when..." is not reproducing.
  • Never fix without a hypothesis. Shotgun debugging = wasted time.
  • One hypothesis at a time. Changing two things = you learn nothing.
  • The fix must address ROOT CAUSE. If you're fixing symptoms, you're not done.
  • The regression test must FAIL without the fix applied.

Anti-Patterns (stop yourself)

  • "Let me try adding a null check here" → NO. Where's your hypothesis? What evidence?
  • "It's probably a timing issue" → Probably? REPRODUCE it. PROVE it's timing.
  • "I'll add some console.logs" → WHICH log proves WHICH hypothesis? Be specific.
  • "Fixed! (without running the test)" → NO. Prove it. Run it. Evidence.

Common Mistakes

  • Changing two things at once — you learn nothing about which fixed it
  • "Probably" without evidence — reproduce it or it's speculation
  • Fixing symptoms (adding null checks) instead of root causes (why was it null?)
  • Declaring "fixed" without a regression test proving it

Example

Bug: "Login button sometimes doesn't respond"

1. REPRODUCE: Click login 20 times → fails on attempts 7, 14, 19 (pattern?)
2. MINIMISE: Remove all other UI. Just the button + handler. Still fails.
3. HYPOTHESISE: "Event listener is being attached multiple times on re-render"
4. INSTRUMENT: Add counter in useEffect → logs show 3 listeners after 3 renders
5. EVALUATE: Hypothesis confirmed. Missing cleanup in useEffect.
6. FIX: Add return () => btn.removeEventListener(...) in useEffect
7. REGRESSION TEST: test('login handler attaches exactly once after re-renders')

Persistence

ACTIVE whenever debugging. Stay in the loop until the regression test is green. Don't exit early. Don't declare "fixed" without step 7.

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.