agentleFS
Facta-DevFacta-Dev/beautifulqt/.claude/skills/diagnosing-bugs/SKILL.md

diagnosing-bugs

Skill0 starsChanged 20 days agoMITView on GitHub

Diagnoses a hard bug or performance regression in <app> by building a red-capable feedback loop first, then minimising, ranking hypotheses, instrumenting one variable at a time and fixing the root cause.

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-ts-deep-modules, loop-me 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.
  • liufeng1976Skill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 54 projects that use this

  • RoentekSkill

    loop-me

    Grill me about specs for the workflows I want to build, within this workspace.

    Also in 66 projects that use this

  • LesaniSkill

    writing-beats

    Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.

    Also in 71 projects that use this

  • AWSSkill

    wizard

    Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.

    Also in 149 projects that use this

  • LesaniSkill

    writing-shape

    Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.

    Also in 68 projects that use this

  • richard12511Skill

    claude-handoff

    Hand the current conversation off to a fresh background agent that picks up the work immediately.

    Also in 51 projects that use this

  • +1 more from Lesani

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

    Do NOT activate this skill when:

    line 20
  2. Distinctive:

    If the bug is non-deterministic, raise the reproduction rate (loop the trigger, parallelise, narrow the timing window, add stress) until it …

    line 49
  3. Distinctive:

    Write the regression test before the fix, and only at a seam that exercises the real bug pattern.

    line 59
  4. Distinctive:

    After applying the fix, re-run the original, un-minimised scenario.

    line 62
  5. Distinctive:

    Never claim a fix works without a passing run of the original loop.

    line 63
  6. Distinctive:

    If no loop can be built, stop and say so: list what was tried and ask for access to a reproducing environment, a redacted capture, or …

    line 64

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

<app> Diagnosing Bugs skill

Reusable workflow for finding the cause of a hard bug or performance regression. An agent invokes this skill; the requester supplies the symptom, the skill supplies the loop.

When to Activate

Activate this skill when something in <app> is broken and the cause is not already visible: a stack trace nobody has read, a wrong value, a test that fails for no clear reason, a request that takes too long, a regression that appeared between two known states.

Do NOT activate this skill when:

  • The cause is known and the task is the fix (go straight to the change).
  • The request is feature work rather than a defect (use plan).
  • The request is to review a diff (use review).

Core Principles

  • The feedback loop is the skill. A tight pass/fail signal that goes red on THIS bug is what finds the cause; staring at code is not.
  • Red before theory. No hypothesis is allowed before one command exists that can fail on this exact symptom, and that command has been run at least once.
  • Minimise, then hypothesise. A minimal repro shrinks the suspect set and becomes the regression test.
  • Hypotheses come as a ranked list of three to five, each stating the prediction it makes. A hypothesis with no prediction is a vibe.
  • One variable per probe. Each probe maps to one stated prediction.
  • Fix the root cause where all callers route through it, not the path the report happened to name.
  • Measure first for performance work: a baseline before a change, a bisect before a guess.
  • Redact secrets before showing commands, output or captured artifacts.

Rules

  • The loop must be red-capable (it asserts the requester's exact symptom, not "did not crash"), deterministic, fast (seconds, not minutes) and agent-runnable. Show the invocation and its output before moving on.
  • If the bug is non-deterministic, raise the reproduction rate (loop the trigger, parallelise, narrow the timing window, add stress) until it is debuggable. A one-percent flake is not a loop.
  • Minimise by cutting inputs, callers, config and data one at a time, re-running after each cut. Every remaining element must be load-bearing: removing any one of them turns the loop green.
  • List the ranked hypotheses and show them to the requester before testing. Proceed with the ranking if the requester is away.
  • Change one variable at a time. Never "log everything and grep".
  • Tag every debug log with a unique prefix so cleanup is one grep.
  • Write the regression test before the fix, and only at a seam that exercises the real bug pattern. If no such seam exists, that absence is the finding: report it instead of writing a shallow test.
  • After applying the fix, re-run the original, un-minimised scenario. Never claim a fix works without a passing run of the original loop.
  • If no loop can be built, stop and say so: list what was tried and ask for access to a reproducing environment, a redacted capture, or permission to add temporary instrumentation. Do not hypothesise without a loop.
  • Redact every secret in the commands, outputs and artifacts shown: replace it in place and quote only the lines that carry the signal.
  • State the confirmed cause in the commit message, so the next debugger starts from the truth.

Research References

ClaimSourceYearLink
The red-loop sequence: feedback loop, minimise, hypothesise, instrument, fix, cleanupmattpocock/skills, skills/engineering/diagnosing-bugs/SKILL.md2026skills/engineering/diagnosing-bugs/SKILL.md
A seam must exercise the real bug pattern or the regression test gives false confidencemattpocock/skills, skills/engineering/diagnosing-bugs/SKILL.md2026skills/engineering/diagnosing-bugs/SKILL.md
The gate ladder that has to be green before a change landsPLAYBOOK_TESTS.md-PLAYBOOK_TESTS.md
Secrets never enter the repository, the logs or the settings filesPLAYBOOK_SECURITY.md-PLAYBOOK_SECURITY.md

Output Format

Deliver, in order:

  1. The feedback loop: the exact command, its redacted output, and why it is red-capable for this symptom.
  2. The minimised repro: the smallest scenario that still goes red.
  3. The ranked hypotheses, each with its prediction.
  4. The probe results, one variable per probe, and which hypothesis was confirmed or eliminated.
  5. The root cause in one sentence, then the fix.
  6. The regression test at the chosen seam, or the missing-seam finding.
  7. The cleanup status: original repro green, regression test green, debug instrumentation removed.

Example:

diagnosing-bugs: loop = `ctest -R note_sync --output-on-failure`
(red: expected 1 sync call, got 0) | hypothesis 1 confirmed | fix: the sync
port dispatches on the committed event, not the request | regression test
added at the use-case seam

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.