All skills
jeffallan avatar

/debugging-wizard

@efebc44
by jeffallanjeffallan/claude-skills12k stars
1,124

Parses error messages, traces execution flow through stack traces, correlates log entries to identify failure points, and applies systematic hypothesis-driven methodology to isolate and resolve bugs. Use when investigating errors, analyzing stack traces, finding root causes of unexpected behavior, troubleshooting crashes, or performing log analysis, error investigation, or root cause analysis.

Use this Skill: https://skilld.dev/gh/jeffallan/claude-skills/debugging-wizard

This session only. Nothing lands on disk.

referencesstrategies.md

≈740 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Debugging Strategies

Binary Search

Divide and conquer to find the bug location.

1. Comment out/disable half the code
2. Test if bug still occurs
3. If yes: bug is in remaining half
4. If no: bug is in disabled half
5. Repeat until isolated
// Example: Bug in data processing pipeline
async function process(data) {
  const step1 = await transform(data);
  // Bug somewhere below?

  const step2 = await validate(step1);
  console.log('After step2:', step2); // Check here

  const step3 = await enrich(step2);
  const step4 = await save(step3);
  return step4;
}

Minimal Reproduction

Strip away everything until only the bug remains.

1. Create new minimal project
2. Add only code needed to reproduce
3. Remove dependencies one by one
4. Simplify inputs to smallest failing case
5. Document exact reproduction steps
// Instead of debugging full app
// Create minimal test case:
const input = { id: null }; // Minimal failing input
const result = processUser(input);
console.log(result); // Isolate the exact failure

Git Bisect

Find the commit that introduced the bug.

# Start bisect
git bisect start

# Mark current commit as bad
git bisect bad

# Mark known good commit
git bisect good v1.0.0

# Git checks out middle commit
# Test and mark:
git bisect good  # or
git bisect bad

# Repeat until found
# Git will say: "abc123 is the first bad commit"

# End bisect
git bisect reset
# Automated bisect with test script
git bisect start HEAD v1.0.0
git bisect run npm test

Time Travel Debugging

Work backwards from the failure.

1. Start at the error/failure point
2. What value caused it? Where did that come from?
3. Trace backwards through the code
4. Find where the value diverged from expected
// Error: Cannot read 'name' of undefined at line 45

// Line 45: const name = user.name;
// Q: Why is user undefined?

// Line 40: const user = users.find(u => u.id === id);
// Q: Why didn't find() return a user?

// Check: Is the id correct? Are users populated?
console.log({ id, users, user });

Rubber Duck Debugging

Explain the problem step by step.

1. State what the code should do
2. Explain what it actually does
3. Walk through the code line by line
4. Describe what each line does
5. The discrepancy often becomes obvious

Delta Debugging

When something recently broke.

# Check what changed
git diff HEAD~5..HEAD

# Check specific file history
git log -p --follow -- src/problematic-file.ts

# Find when file last worked
git log --oneline -- src/problematic-file.ts

Quick Reference

Strategy Best For
Binary Search Unknown bug location
Minimal Repro Complex bugs, reporting
Git Bisect Regression bugs
Time Travel Known error location
Rubber Duck Logic errors
Delta Debug Recent breakage

Source: SKILL.md on GitHub

1 alert17d5 checks · Risk CRITICAL
  • Gen Agent Trust Hub17d

    The skill provides comprehensive instructions, guides, and workflows for debugging applications. All references and commands are educational and standard development practices. The documentation links belong to the skill author and present no security risks.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer6mo

    1/6 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at efebc44. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 5 months ago
Other metadata
metadata
{
  "author": "https://github.com/Jeffallan",
  "version": "1.1.0",
  "domain": "quality",
  "triggers": "debug, error, bug, exception, traceback, stack trace, troubleshoot, not working, crash, fix issue",
  "role": "specialist",
  "scope": "analysis",
  "output-format": "analysis",
  "related-skills": "test-master, fullstack-guardian, monitoring-expert"
}

README badge

README badge for jeffallan/claude-skills/debugging-wizard