agentleFS
pbans-agentpbans-agent/skillpack/skills/debug-helper/SKILL.md

debug-helper

Skill0 starsChanged 7 months agoMITView on GitHub

Systematically diagnoses and resolves software bugs through structured debugging. Use when the user reports an error, asks to fix a bug, needs help understanding a crash, wants to trace through code execution, or needs to identify the root cause of unexpected behavior.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. inbharatai/claude-skills★ 37same name
    2. agentsdance/agentskills★ 3same name
    3. mosaic-platform/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository6 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    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:

    Create a minimal reproduction case

    line 36
  2. Distinctive:

    Check one hypothesis at a time

    line 51
  3. Distinctive:

    Use logging/print statements strategically

    line 52
  4. Distinctive:

    Verify assumptions with evidence

    line 54
  5. Distinctive:

    Verify the original issue is resolved

    line 58
  6. Distinctive:

    Check for side effects

    line 59
  7. Distinctive:

    Add a test to prevent regression

    line 60
  8. Distinctive:

    When you don't know where the bug is:

    line 110
  9. Distinctive:

    Place a checkpoint in the middle of the execution

    line 111
  10. Distinctive:

    If yes: bug is after the checkpoint

    line 113
  11. Distinctive:

    If no: bug is before the checkpoint

    line 114
  12. Distinctive:

    When reporting a debug finding:

    line 130

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “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 Helper

Purpose

Provide a systematic approach to diagnosing and fixing software bugs. Turn "it doesn't work" into "here's the root cause and the fix."

When to Use

  • An error message needs interpretation
  • Unexpected behavior needs tracing
  • A crash needs root-cause analysis
  • Performance needs profiling
  • A flaky test needs stabilization
  • A regression needs bisecting

Debugging Process

1. Reproduce the Issue

  • Get the exact steps to reproduce
  • Identify the environment (OS, version, config)
  • Determine if it's consistent or intermittent
  • Create a minimal reproduction case

2. Read the Error

  • Full error message including traceback
  • Error type and what it means
  • Line number and surrounding code
  • Stack trace showing the call path

3. Form Hypotheses

  • What could cause this symptom?
  • What changed recently?
  • What are the common causes for this error type?
  • Rank hypotheses by likelihood

4. Test Hypotheses

  • Check one hypothesis at a time
  • Use logging/print statements strategically
  • Inspect variables at each level
  • Verify assumptions with evidence

5. Fix and Verify

  • Make the minimal fix
  • Verify the original issue is resolved
  • Check for side effects
  • Add a test to prevent regression

Common Error Patterns

Python

ErrorCommon CauseFirst Check
NameErrorUndefined variableTypo or missing import
TypeErrorWrong type operationType of operands
KeyErrorMissing dict keyKey existence / .get()
IndexErrorOut of range indexList length
AttributeErrorMissing attributeObject type and available attrs
ImportErrorModule not foundPackage installed? Correct path?
FileNotFoundErrorMissing fileAbsolute vs relative path
RecursionErrorInfinite recursionBase case logic

JavaScript/TypeScript

ErrorCommon CauseFirst Check
TypeError: undefined is not a functionAccessing property on null/undefinedOptional chaining
ReferenceErrorUndeclared variableScope and spelling
SyntaxErrorParse errorBracket/paren matching
RangeErrorInvalid length/valueArray size or recursion
ENOENTFile not foundWorking directory

General

SymptomCommon Cause
Works locally, fails in CIEnvironment differences, missing env vars
Works once, fails on retryState not properly cleaned up
Slow over timeMemory leak, growing data structure
Random failuresRace condition, timing dependency
Fails only on large inputOff-by-one, integer overflow, OOM

Debugging Tools

Logging Strategy

# BAD: too vague
print("here")

# GOOD: structured and specific
import logging
logger.debug(f"Processing user_id={user_id}, items={len(items)}, stage=validate")

Binary Search Debugging

When you don't know where the bug is:

  1. Place a checkpoint in the middle of the execution
  2. Is the state correct at that point?
  3. If yes: bug is after the checkpoint
  4. If no: bug is before the checkpoint
  5. Repeat in the relevant half

Git Bisect

git bisect start
git bisect bad HEAD
git bisect good <last-known-good-commit>
# Git checks out middle commit; test it
git bisect good  # or git bisect bad
# Repeat until found
git bisect reset

Output Format

When reporting a debug finding:

## Issue
<one-sentence description of the bug>

## Root Cause
<what is actually wrong>

## Evidence
- <traceback, logs, or test output showing the issue>
- <specific line(s) of code involved>

## Fix
<what to change and why>

## Prevention
<how to prevent this class of bug in the future>

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.