agentleFS
brokspacebrokspace/brok/skills/engineering/diagnosing-bugs/SKILL.md

diagnosing-bugs

Skill12 starsChanged 28 days agoApache-2.0View on GitHub

Disciplined diagnosis of hard bugs and performance regressions. Use when a bug is not obvious after a first look, when a fix attempt already failed, when behavior is intermittent or environment-specific, or when something got slower.

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

8 rules. 0 are common, 6 are distinctive, and 2 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.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not guess fixes. Build a loop that shows the bug, shrink it, then change one thing at a time.

    line 8
  2. Distinctive:

    Use the reporter's exact steps and inputs first.

    line 16
  3. Distinctive:

    Remove inputs, config, steps and code paths until removing anything else makes the failure disappear.

    line 26
  4. Very specific:

    Search for the code paths involved: brok search "<behavior in question>" (or the brok_search tool), then read the hits around the reported …

    line 31
  5. Very specific:

    Check what changed: git log -p --since=...

    line 33
  6. Distinctive:

    Write down two or three hypotheses, each with a prediction you can check.

    line 38
  7. Distinctive:

    Test the cheapest first by adding logs, assertions or a debugger breakpoint, not by editing behavior.

    line 39
  8. Distinctive:

    Run the full suite. Remove temporary instrumentation.

    line 51

“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

Diagnosing bugs

Do not guess fixes. Build a loop that shows the bug, shrink it, then change one thing at a time. Each phase has an exit condition; do not skip ahead.

1. Make it red

Find a command that fails because of the bug, every time, in seconds: a failing test, a script, a curl, a benchmark with a threshold.

  • Use the reporter's exact steps and inputs first.
  • Intermittent? Loop it (for i in $(seq 50); do ...; done) and record the failure rate.
  • Performance? Measure before touching anything and write the number down.

Exit: you can run one command and watch it fail. If you cannot reproduce it, stop and report what you tried and what extra information would help.

2. Minimise

Remove inputs, config, steps and code paths until removing anything else makes the failure disappear. Note what turned out not to matter.

3. Locate

  • Search for the code paths involved: brok search "<behavior in question>" (or the brok_search tool), then read the hits around the reported symptom.
  • Check what changed: git log -p --since=... -- <paths>, or bisect with the red command (git bisect run <command>).

4. Hypothesise and instrument

Write down two or three hypotheses, each with a prediction you can check. Test the cheapest first by adding logs, assertions or a debugger breakpoint, not by editing behavior. Discard hypotheses the evidence rejects, out loud.

Exit: one hypothesis explains every observation, including the ones from step 2.

5. Fix and prove

  1. Turn the red command into a regression test at a public seam (call the Skill tool with "tdd" for what a good one looks like).
  2. Make the smallest fix that turns it green.
  3. Prove the test guards the bug: revert the fix, see red, restore it.
  4. Run the full suite. Remove temporary instrumentation.

Report

Root cause in one or two sentences, the evidence for it, the fix (paths), the regression test, and anything suspicious you noticed but did not fix.

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.