agentleFS
divik-09divik-09/claude-skills-collection/skills/debugging-playbook/SKILL.md

debugging-playbook

Skill1 starsChanged 8 days agoMITView on GitHub

Systematic method for diagnosing bugs, crashes, flaky tests, and unexpected behavior. Use whenever the user pastes an error, stack trace, or log, says something 'doesn't work', 'is broken', 'randomly fails', or asks why code behaves a certain way, even if they only paste the error with no question.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 2

    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:

    Prevent recurrence: Add a regression test that fails before the fix and passes after.

    line 18
  2. Distinctive:

    Look for: time or ordering dependence, shared state between tests, real network or clock, unseeded randomness, resource leaks, parallelism …

    line 41

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

Debugging Playbook

Resist the urge to guess a fix. Find the cause, then fix it.

Steps

  1. Capture the symptom precisely. Exact error text, expected vs actual behavior, environment (OS, versions), and whether it is deterministic. If key facts are missing, ask for at most three, most diagnostic first.
  2. Reproduce. Shrink to the smallest input and code that still fails. If it cannot be reproduced, say what additional logging or data would catch it.
  3. Read the evidence. For stack traces, start at the first frame in the user's own code, not the top of the trace. Note the actual exception type and message before theorizing.
  4. List hypotheses ranked by likelihood and cost to test. Typical culprits: wrong assumption about input shape, null/undefined, async ordering, stale cache, version mismatch, environment/config difference, shared mutable state, timezone/locale/encoding.
  5. Test one hypothesis at a time with a print, assertion, debugger breakpoint, or git bisect between a known-good and known-bad commit.
  6. Fix the root cause, not the symptom. Avoid blanket try/except or sleep() "fixes".
  7. Prevent recurrence. Add a regression test that fails before the fix and passes after.

Output format

## Most likely cause
<one paragraph, with the evidence pointing to it>

## How to confirm
<specific command, log line, or experiment>

## Fix
<code or steps>

## Other possibilities
<ranked, only if confidence is not high>

## Regression test
<small test>

Flaky tests

Look for: time or ordering dependence, shared state between tests, real network or clock, unseeded randomness, resource leaks, parallelism races. Make the flake reproducible (loop it, add jitter, fix the seed) before fixing.

State your confidence honestly. If the evidence is thin, say "probably" and give the experiment that would settle it.

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.