agentleFS
Marnie0415Marnie0415/pi-skills/debug/SKILL.md

debug

Skill1 starsChanged 5 months agoMITView on GitHub

Systematically diagnose and fix bugs, unexpected behavior, or failing tests with scientific method approach. Use when something is broken and the cause is not immediately obvious.

192 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-discord, add-slack 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.
  • MicrosoftSkill

    add-discord

    Add Discord bot channel integration via Chat SDK.

    Also in 11 projects that use this

  • MicrosoftSkill

    add-slack

    Add Slack channel integration via Chat SDK.

    Also in 11 projects that use this

  • +10 more from microsoft

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 15

    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 guess. Work systematically: reproduce, isolate, hypothesize, verify.

    line 8
  2. Distinctive:

    Before touching any code, confirm you can reproduce the problem.

    line 12
  3. Distinctive:

    If you cannot reproduce it, stop and ask for more information.

    line 17
  4. Distinctive:

    If there is an error message or stack trace:

    line 21
  5. Distinctive:

    Read the full trace, not just the first line

    line 22
  6. Distinctive:

    Check what values were in scope at that point

    line 24
  7. Distinctive:

    Add temporary logging or assertions to confirm assumptions about state

    line 29
  8. Distinctive:

    Check: when did this last work?

    line 31
  9. Distinctive:

    Write one sentence: "I believe X is happening because Y." Do not skip this.

    line 35
  10. Distinctive:

    Do not skip this. It prevents you from randomly changing code and hoping it works.

    line 36
  11. Distinctive:

    Check the actual values at runtime if possible

    line 42
  12. Distinctive:

    Look for edge cases the author may have missed

    line 43
  13. Distinctive:

    If your hypothesis is wrong, return to step 3.

    line 45
  14. Distinctive:

    Do not refactor surrounding code while fixing a bug

    line 50
  15. Distinctive:

    Add a test that would have caught this bug

    line 51

“Common” is measured: kept by at least 6 in 10 of the 175 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 (Opus 级: 科学方法)

Do not guess. Work systematically: reproduce, isolate, hypothesize, verify.

Step 1: Reproduce

Before touching any code, confirm you can reproduce the problem.

  • What is the exact input or sequence of actions that triggers it?
  • Is it consistent or intermittent?
  • Does it happen in all environments or only some?

If you cannot reproduce it, stop and ask for more information.

Step 2: Read the error

If there is an error message or stack trace:

  • Read the full trace, not just the first line
  • Find the deepest frame in your own code (not library internals) — that is your starting point
  • Check what values were in scope at that point

Step 3: Isolate

Narrow down where the problem lives before reading more code.

  • Add temporary logging or assertions to confirm assumptions about state
  • Bisect: is the problem in the input, the transformation, or the output?
  • Check: when did this last work? Use git log and git blame to find recent changes

Step 4: Form a hypothesis

Write one sentence: "I believe X is happening because Y." Do not skip this. It prevents you from randomly changing code and hoping it works.

Step 5: Verify the hypothesis

Find the code that should implement the behavior you described.

  • Read it carefully
  • Check the actual values at runtime if possible
  • Look for edge cases the author may have missed

If your hypothesis is wrong, return to step 3. Do not guess-and-check.

Step 6: Fix

Make the smallest possible change that fixes the root cause.

  • Do not refactor surrounding code while fixing a bug
  • Add a test that would have caught this bug
  • Record the lesson in ~/pi_learnings.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.