agentleFS
viknesh20-20viknesh20-20/claude-code-tool-kit/.claude/skills/debug/SKILL.md

debug

Skill7 starsChanged 6 months agoMITView on GitHub

Systematically debugs issues using structured diagnosis — reproduce, isolate, identify root cause, and fix. Use when facing bugs, errors, unexpected behavior, or failing tests.

192 other projects use a version of this.

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

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

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 23

    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:

    If there's an error message or stack trace:

    line 25
  2. Distinctive:

    Read the full error message — don't skip parts

    line 26
  3. Distinctive:

    Check for root cause vs symptom — the first error in the chain is usually the cause

    line 29
  4. Distinctive:

    Use a binary search strategy:

    line 32
  5. Distinctive:

    Check dependency versions (lock file differences)

    line 44
  6. Distinctive:

    Check OS/runtime version differences

    line 45
  7. Distinctive:

    Check file path separators (Windows vs Unix)

    line 46
  8. Distinctive:

    Check timezone/locale differences

    line 47
  9. Distinctive:

    Check for dependency updates (lock file changes)

    line 51
  10. Distinctive:

    Check for infrastructure/config changes

    line 52
  11. Distinctive:

    Check for data changes in the database

    line 53
  12. Distinctive:

    Check for N+1 queries

    line 63
  13. Distinctive:

    Check for missing indexes

    line 64
  14. Distinctive:

    Check for synchronous blocking in async code

    line 65
  15. Distinctive:

    Check for unnecessary re-computation

    line 66
  16. Distinctive:

    Verify the fix resolves the original issue

    line 70
  17. Distinctive:

    Check for regressions — run related tests

    line 71
  18. Distinctive:

    Add a test that would have caught this bug

    line 72
  19. Distinctive:

    Document the root cause in the commit message

    line 73
  20. Distinctive:

    Should there be input validation to catch this earlier?

    line 76
  21. Distinctive:

    Should there be a test for this scenario?

    line 77
  22. Distinctive:

    Should there be monitoring/alerting for this condition?

    line 78
  23. Distinctive:

    Should the error message be improved for faster debugging next time?

    line 79

“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

Structured Debugging

Recent Changes

!git log --oneline -10 2>/dev/null !git diff --stat HEAD~3 2>/dev/null


Debugging Process

Step 1: Gather Information

  1. What is the symptom? — Error message, unexpected behavior, crash, performance issue
  2. When did it start? — Check recent commits: git log --oneline -20
  3. Is it reproducible? — Always, sometimes, only in certain environments?
  4. What changed? — Recent code changes, dependency updates, config changes

Step 2: Read the Error

If there's an error message or stack trace:

  1. Read the full error message — don't skip parts
  2. Identify the origin — which file and line threw the error?
  3. Trace the call stack — how did execution reach that point?
  4. Check for root cause vs symptom — the first error in the chain is usually the cause

Step 3: Isolate the Problem

Use a binary search strategy:

  1. Narrow the scope: Is the issue in the frontend, backend, database, or external service?
  2. Check inputs: Are the inputs to the failing function correct?
  3. Check dependencies: Are all required services/modules available?
  4. Check state: Is the application/database in the expected state?
  5. Check environment: Are env vars, configs, and versions correct?

Step 4: Common Debugging Patterns

"It works on my machine"

  • Check environment variables
  • Check dependency versions (lock file differences)
  • Check OS/runtime version differences
  • Check file path separators (Windows vs Unix)
  • Check timezone/locale differences

"It worked yesterday"

  • git bisect to find the breaking commit
  • Check for dependency updates (lock file changes)
  • Check for infrastructure/config changes
  • Check for data changes in the database

"It works sometimes"

  • Race condition — look for shared mutable state
  • Timing issue — look for missing awaits, unhandled promises
  • Resource exhaustion — connections, file handles, memory
  • External dependency flakiness — network, API rate limits

"It's slow"

  • Profile before guessing — use the project's profiling tools
  • Check for N+1 queries
  • Check for missing indexes
  • Check for synchronous blocking in async code
  • Check for unnecessary re-computation

Step 5: Fix and Verify

  1. Implement the minimal fix
  2. Verify the fix resolves the original issue
  3. Check for regressions — run related tests
  4. Add a test that would have caught this bug
  5. Document the root cause in the commit message

Step 6: Prevent Recurrence

  • Should there be input validation to catch this earlier?
  • Should there be a test for this scenario?
  • Should there be monitoring/alerting for this condition?
  • Should the error message be improved for faster debugging next time?

Rules

  • Don't guess and check randomly — use a systematic approach
  • Read the error message — it usually tells you exactly what's wrong
  • Check the obvious first — typos, missing imports, wrong file paths
  • One change at a time — so you know what fixed it
  • Always add a regression test for the bug you fixed

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.