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

diagnosing-bugs

Skill0 starsChanged 32 days agoMITView on GitHub

Diagnoses a hard <app> bug or performance regression with a red-capable feedback loop, a minimised repro, ranked falsifiable hypotheses, targeted instrumentation, and a regression test.

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

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

  • 1

    Common

    Most of the 182 edited versions we read keep these.

  • 5

    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:

    Do NOT activate this skill when the cause is already known and the work is the fix itself (go straight to /tdd), or when the request is a …

    line 24
  2. Distinctive:

    Tighten the loop: Treat it as a product: faster (cache setup, narrow scope), sharper (assert the exact symptom, not "did not crash"), more …

    line 34
  3. Distinctive:

    One variable at a time: Every probe maps to one prediction.

    line 45
  4. Distinctive:

    Never proceed to hypothesis without a loop.

    line 57
  5. Distinctive:

    Prefer a debugger or REPL inspection over logs.

    line 64
  6. Common:

    Write the regression test before the fix, but only at a correct seam: one where the test exercises the real bug pattern as it occurs at the …

    line 68
  7. Distinctive:

    No fabricated data: never invent a stack trace, a log line, a timing, a file path or a command output that was not actually observed.

    line 72

“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 diagnosis loop for hard bugs and performance regressions in <app>. An agent invokes this skill; the agent supplies domain judgement, the skill supplies the phase discipline.

When to Activate

Activate this skill when a bug in <app> is hard to pin down: a wrong result, a crash, a hang, or a performance regression. Typical triggers:

  • The request says "diagnose", "debug this", "why does this fail", or reports something broken, throwing, failing or slow.
  • A test fails intermittently, or only in CI, or only under load.
  • A regression appeared between two known states (a commit, a migration, a dependency bump) and the cause is not obvious.

Do NOT activate this skill when the cause is already known and the work is the fix itself (go straight to /tdd), or when the request is a code review of a known diff (use /review).

Core Principles

  • The feedback loop is the skill. Everything else consumes it. Build one command that goes red on this bug and green once fixed, before forming any theory. Reading code to build a theory first is the failure this skill prevents.
  • Tighten the loop. Treat it as a product: faster (cache setup, narrow scope), sharper (assert the exact symptom, not "did not crash"), more deterministic (pin time, seed randomness, isolate the filesystem, freeze the network). A 30-second flaky loop is barely better than no loop.
  • Reproduce, then minimise. Cut inputs, callers, config, data and steps one at a time, re-running the loop after each cut, until every remaining element is load-bearing (removing any one turns the loop green). The minimised repro is the regression test later.
  • Rank before testing. Generate 3 to 5 hypotheses and make each falsifiable ("if X is the cause, then changing Y makes the bug disappear"). A hypothesis whose prediction cannot be stated is a vibe.
  • One variable at a time. Every probe maps to one prediction. For performance regressions, measure a baseline first (timing, profiler, query plan) and bisect; logs are usually the wrong tool.
  • The symptom, not a neighbour. The loop must reproduce what the user described. Catching a different nearby failure means fixing the wrong bug.

Rules

  • Redact every secret before showing commands, output or captured artifacts: write <REDACTED> in place of the value, build loops against environment variables so credentials stay in the environment, and quote only the lines carrying the signal (captured traces carry auth headers).
  • Never proceed to hypothesis without a loop. If no loop can be built, say so explicitly, list what you tried, and ask for access to the reproducing environment, a redacted captured artifact (HAR, log dump, core dump, timestamped recording), or permission to add temporary instrumentation.
  • For non-deterministic bugs, aim for a higher reproduction rate, not a clean repro: loop the trigger, parallelise, add stress, narrow timing windows. A 50% flake is debuggable, 1% is not.
  • Prefer a debugger or REPL inspection over logs; one breakpoint beats ten log lines. Never "log everything and grep".
  • Tag every temporary debug log with a unique prefix such as [DEBUG-a4f2] so cleanup is one grep. Untagged logs survive.
  • Write the regression test before the fix, but only at a correct seam: one where the test exercises the real bug pattern as it occurs at the call site. If no correct seam exists, that absence is the finding and must be reported, not worked around with a shallow test.
  • No fabricated data: never invent a stack trace, a log line, a timing, a file path or a command output that was not actually observed.

Research References

ClaimSourceYearLink
Diagnosis phases, loop-first discipline and falsifiable-hypothesis ruleskills/engineering/diagnosing-bugs/SKILL.md (upstream, MIT)2026local file
Node test runner selection for a single failing casenode --test --test-name-patternn/alocal tool

Output Format

Raw structured prose, not a code fence:

### <app> diagnosis, <symptom in one line>

Loop: <one command>, red: <observed failure> | green after fix: <expected>
Minimised repro: <the smallest failing scenario>
Hypotheses (ranked): 1. <hypothesis>, predicts: <prediction>
Probes run: <probe> → <result> (supports/refutes <hypothesis n>)
Root cause: <the hypothesis that survived>
Fix: <what changed, where>
Regression test: <file>:<test> at seam <seam> | no correct seam exists: <why>
Cleanup: [DEBUG-*] logs removed: <yes/no> | throwaway harnesses removed: <yes/no>

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.