agentleFS
openwizdevopenwizdev/WizSkills/skills/diagnose/SKILL.md

diagnose

Skill2 starsChanged 3 days agoApache-2.0View on GitHub

Find the cause of a hard bug or regression. Use when stuck on a known bug, unexplained test failure, flaky CI or performance regression.

195 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 66 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 63 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 56 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 49 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

  • kennethkeimSkill

    ubiquitous-language

    Extract a DDD-style ubiquitous language glossary from the current conversation, flagging ambiguities and proposing canonical terms. Saves to UBIQUITOUS_LANGUAGE.md. Use when user wants to define domain terms, build a glossary, harden terminology, create a ubiquitous language, or mentions "domain model" or "DDD".

    Also in 17 projects that use this

  • +4 more from simo97
  • +1 more from google

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 178 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the project's AGENTS.md or CLAUDE.md, its glossary and the ADRs for the area.

    line 14
  2. Distinctive:

    Scope: keep the caller's role, owned paths, approval gates and the 1 + 1 review limit.

    line 19
  3. Distinctive:

    Write 3–5 ranked hypotheses, each with a prediction: "if X, changing Y removes it." Discard any you cannot falsify.

    line 69
  4. Distinctive:

    Run it red. If red needed a mutation, diff against a pristine copy.

    line 86
  5. Distinctive:

    Follow the project's proof-first commits and state the cause in the commit or pull request.

    line 91

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

No theory without a loop. First run one command that goes red on the reported bug. Then minimise it, rank hypotheses, test one prediction at a time, and fix with a regression test. Skip a later phase only with a stated reason; the red loop cannot be skipped.

Read the project's AGENTS.md or CLAUDE.md, its glossary and the ADRs for the area. Run the helper as python3 -I <this skill's folder>/scripts/loop.py.

Guards

  • Scope: keep the caller's role, owned paths, approval gates and the 1 + 1 review limit. Diagnosis grants no permission to edit elsewhere, run against a live system, merge or start agents. The orchestrator's diagnosis only supplies a cause and direction for its decision; it never resets 1 + 1.
  • Privacy: replace every secret with <REDACTED> before showing commands, outputs or artifacts. Keep credentials in environment variables, never in arguments. Quote only diagnostic lines; headers can be secrets. Public records carry synthetic reproducers and technical facts: no thread ids, exact user words, real identifiers or links into private files. Keep private captures in the configured private repository. Record a user decision in your own words with its date and the open-development private-record pointer. If redaction removes the signal, say so and ask; never expose it.

1. Build the red loop

Reading code to build a reproducer is fine; explaining the cause first is not. Prefer, in order: a failing test at the seam that reaches the bug; an HTTP script; a CLI run on fixture input against a known-good snapshot; a headless browser assertion; a redacted trace replayed through the isolated path; a throwaway harness; a seeded fuzz loop; git bisect run in an isolated copy; or old against new on the same input. Assert the exact symptom, pin time and seeds, isolate files and network, and aim for seconds.

Last resort, a human loop: bash <this skill's folder>/scripts/hitl-loop.template.sh '<step>' '<symptom question>'. Exit 1 means the symptom is present, 0 absent, 2 inconclusive; map 2 to 125 under git bisect run. The human signs in themselves and answers only y or n. Without a terminal they can answer, ask; never invent the answer.

Flaky: set the effort first (the ticket's budget, if given), then amplify with repeats, stress or injected delays until loop.py rate --runs N [--timeout S] -- <command> shows a high failure rate. Record its line, the seed and configuration before and after amplification. A lucky pass proves nothing; never retry until green.

Done when you have run one fast, agent-runnable command on the real bug path and can show its redacted red output and the symptom it asserts. If you cannot build it, stop and ask for the missing environment, a redacted capture or permission for temporary instrumentation: on the ticket with build-ticket's needs-info procedure, otherwise to the caller. Do not hypothesise or instrument production while waiting.

2. Minimise

Confirm the loop catches the reported failure, not a nearby one. Cut inputs, callers, configuration, data and steps one at a time, rerunning after each. Done when removing any remaining element loses the failure.

3. Rank hypotheses

Write 3–5 ranked hypotheses, each with a prediction: "if X, changing Y removes it." Discard any you cannot falsify. Show the ranking on the ticket (or to the caller) and carry on without waiting.

4. Probe one prediction at a time

Change one variable per run and update the ranking. Prefer a debugger, then boundary logs tagged with one prefix from loop.py tag; never log everything and look for a story. For a performance regression, measure a baseline with a timer, profiler or query plan, then bisect; logs are not a measurement. Done when one probe has distinguished the cause.

5. Fix with a regression test

  1. Turn the minimised loop into a test at a seam that exercises the real call pattern. No correct seam: record that gap and ask; an untested fix is not done.
  2. Run it red. If red needed a mutation, diff against a pristine copy.
  3. Apply the smallest fix for the established cause, and run the test green.
  4. Rerun the original loop. For a flake, rerun loop.py rate with the same command and runs; retries never erase failures.

Follow the project's proof-first commits and state the cause in the commit or pull request. Fixture tests prove fixture behaviour, never live behaviour.

6. Clean up and report

loop.py clean '<prefix>' must print clean:; remove every leftover it names and any throwaway harness. Then leave a diagnosis comment on the ticket or issue: the loop command, symptom and redacted red output; the cause and the probe that showed it, or "unsolved"; the regression test and original loop results; any rate lines and effort spent; and every open gap. If the effort ran out unsolved, list what you tried and ask for the next step.

Credit: adapted from Matt Pocock's skills under the MIT License; the notice and sources are in NOTICE.md.

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.