agentleFS
jmolzjmolz/m0lz.01/.agents/skills/debug/SKILL.md

debug

Skill0 starsChanged 6 months agoMITView on GitHub

Use this skill when diagnosing bugs, errors, test failures, or unexpected behavior. Triggers: 'debug', 'fix bug', 'not working', 'error', 'failing test', 'broken', 'unexpected behavior', 'investigate issue', 'stack trace', 'crash'. Provides a systematic debugging methodology to find root causes efficiently.

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

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 9

    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:

    Before fixing anything, confirm you can see the problem:

    line 14
  2. Distinctive:

    If you can't reproduce it, you don't understand it yet.

    line 28
  3. Distinctive:

    Use binary search — don't change 10 things at once:

    line 56
  4. Distinctive:

    Don't add a try/catch to hide an error — understand why it happens

    line 75
  5. Distinctive:

    If the fix is in one place but the same pattern exists elsewhere, check those too

    line 76
  6. Distinctive:

    If the bug came from a missing guard, consider if other callers have the same gap

    line 77
  7. Distinctive:

    Add a test that would have caught this bug

    line 83
  8. Distinctive:

    Check if AGENTS.md or rules should be updated to prevent this pattern

    line 84
  9. Distinctive:

    Run full validation to ensure no regressions

    line 85

“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

Debug Skill

When to Use

The agent should read this skill when troubleshooting any bug, error, or unexpected behavior.

Debugging Methodology

Step 1: Reproduce

Before fixing anything, confirm you can see the problem:

# Run the failing test
{test command} -- --grep "test name"

# Start the app and trigger the error
{dev command}
# Then reproduce the exact steps

# Check logs
tail -f logs/*.log 2>/dev/null

If you can't reproduce it, you don't understand it yet. Gather more information.

Step 2: Read the Error

Actually read the full error:

  • Error message: What does it literally say?
  • Stack trace: Which file and line threw? Trace the call chain.
  • Error type: TypeError? NetworkError? ValidationError? Each means something different.
  • Context: What was the input? What state was the app in?

Step 3: Form a Hypothesis

Based on the error, hypothesize the root cause. Common patterns:

SymptomLikely Cause
undefined is not a functionWrong import, missing method, typo
null referenceAsync timing, optional field not checked
connection refusedService not running, wrong port/host
401/403Auth token expired, wrong credentials, missing header
404Wrong URL, route not registered, typo in path
500Unhandled exception in handler, DB query failure
Test passes alone, fails in suiteShared state, mock pollution, test ordering
Works locally, fails in CIEnvironment difference, missing env var, different DB state
Intermittent failureRace condition, timing dependency, flaky external service

Step 4: Narrow Down

Use binary search — don't change 10 things at once:

# Check if the issue is in a specific file
git stash           # Remove your changes
# Test — does the bug exist in clean state?
git stash pop       # Bring changes back

# Check when it broke
git log --oneline -20
git bisect start
git bisect bad      # Current commit is broken
git bisect good abc123  # This commit was working
# Git walks you to the breaking commit

Step 5: Fix the Root Cause

  • Fix the actual problem, not the symptom
  • Don't add a try/catch to hide an error — understand why it happens
  • If the fix is in one place but the same pattern exists elsewhere, check those too
  • If the bug came from a missing guard, consider if other callers have the same gap

Step 6: Verify and Prevent

After fixing:

  1. Confirm the original reproduction case now passes
  2. Add a test that would have caught this bug
  3. Check if AGENTS.md or rules should be updated to prevent this pattern
  4. Run full validation to ensure no regressions

Anti-Patterns

  • ❌ Changing random things until it works (shotgun debugging)
  • ❌ Adding console.log everywhere without a hypothesis
  • ❌ Fixing the symptom without understanding the cause
  • ❌ Disabling a test that fails instead of fixing the code
  • ❌ Catching and swallowing exceptions to make errors disappear

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.