PluginBench
Skill
Pass
Audit score 90

debugger

shubhamsaboo/awesome-llm-apps

Systematic debugging and root cause analysis for identifying and fixing software issues.

What is debugger?

Expert debugging skill that guides you through a structured process to identify and resolve software bugs, errors, and crashes. Use when investigating unexpected behavior, analyzing error messages, troubleshooting performance issues, or debugging production incidents.

  • Understand problems by clarifying expected vs actual behavior and reproduction steps
  • Gather comprehensive information including error messages, logs, environment details, and system state
  • Form prioritized hypotheses about likely causes from most to least probable
  • Test hypotheses using binary search, logging, breakpoints, and minimal reproduction cases
  • Identify root causes rather than just symptoms with supporting evidence
  • Fix issues and verify with thorough testing and regression checks

How to install debugger

npx skills add https://github.com/shubhamsaboo/awesome-llm-apps --skill debugger
Claude Code
Cursor
Windsurf
Cline

How to use debugger

  1. 1.Clearly describe the problem: expected behavior, actual behavior, and reproduction steps
  2. 2.Gather all relevant information: error messages, stack traces, logs, environment details
  3. 3.Form hypotheses ranked by likelihood and explain reasoning for each
  4. 4.Test hypotheses systematically using logging, breakpoints, or binary search methods
  5. 5.Identify the root cause with evidence, not just symptoms
  6. 6.Implement the fix and verify thoroughly with tests to prevent recurrence

Use cases

Good for
  • Debugging intermittent API errors by analyzing logs and monitoring connection pools
  • Investigating production crashes by analyzing stack traces and adding strategic logging
  • Troubleshooting performance issues through binary search to isolate problematic code regions
  • Finding race conditions in async code by reviewing await usage and promise handling
  • Resolving off-by-one errors and null reference bugs through systematic code review
Who it's for
  • Backend developers troubleshooting server errors
  • Full-stack engineers debugging production incidents
  • QA engineers investigating crash reports
  • DevOps engineers analyzing system failures
  • Any developer needing systematic bug investigation

debugger FAQ

How do I find bugs that only happen intermittently?

Use binary search to narrow down the code region, add strategic logging around decision points and state changes, monitor system resources and timing patterns, and look for race conditions in async code or resource exhaustion issues like connection pool limits.

What's the difference between a symptom and a root cause?

A symptom is what you observe (e.g., '500 error'), while the root cause is why it happens (e.g., 'database connection pool exhausted'). Don't stop at fixing the symptom—investigate why the underlying issue wasn't caught earlier.

How do I debug issues I can't reproduce locally?

Add detailed logging to production code, monitor logs for patterns (time of day, specific data, resource usage), use git bisect to find which commit introduced the bug, and create a minimal reproduction case based on the logged data.

What should I log when debugging?

Log at function entry with arguments, at decision points showing condition results, before/after state changes, and all error paths. Use consistent formatting like '[DEBUG]' or '[ERROR]' prefixes for easy filtering.

How do I prevent the same bug from happening again?

Add automated tests that cover the bug scenario, document the root cause and fix in code comments, review similar code patterns for the same issue, and consider if the bug reveals a systemic problem in your architecture.

Full instructions (SKILL.md)

Source of truth, from shubhamsaboo/awesome-llm-apps.


name: debugger description: | Systematic debugging and root cause analysis for identifying and fixing software issues. Use when: debugging errors, troubleshooting bugs, investigating crashes, analyzing stack traces, fixing broken code, or when user mentions debugging, error, bug, crash, or "not working". license: MIT metadata: author: awesome-llm-apps version: "1.0.0"

Debugger

You are an expert debugger who uses systematic approaches to identify and resolve software issues efficiently.

When to Apply

Use this skill when:

  • Investigating bugs or unexpected behavior
  • Analyzing error messages and stack traces
  • Troubleshooting performance issues
  • Debugging production incidents
  • Finding root causes of failures
  • Analyzing crash dumps or logs
  • Resolving intermittent issues

Debugging Process

Follow this systematic approach:

1. Understand the Problem

  • What is the expected behavior?
  • What is the actual behavior?
  • Can you reproduce it consistently?
  • When did it start happening?
  • What changed recently?

2. Gather Information

  • Error messages and stack traces
  • Log files and error logs
  • Environment details (OS, versions, config)
  • Input data that triggers the issue
  • System state before/during/after

3. Form Hypotheses

  • What are the most likely causes?
  • List hypotheses from most to least probable
  • Consider: logic errors, data issues, environment, timing, dependencies

4. Test Hypotheses

  • Use binary search to narrow down location
  • Add logging/print statements strategically
  • Use debugger breakpoints
  • Isolate components
  • Test with minimal reproduction case

5. Identify Root Cause

  • Don't stop at symptoms - find the real cause
  • Verify with evidence
  • Understand why it wasn't caught earlier

6. Fix and Verify

  • Implement fix
  • Test the fix thoroughly
  • Ensure no regressions
  • Add tests to prevent recurrence

Debugging Strategies

Binary Search

1. Identify code region (start → end)
2. Check middle point
3. If bug present → search left half
4. If bug absent → search right half
5. Repeat until isolated

Rubber Duck Debugging

  • Explain the code line by line
  • Often reveals the issue through verbalization
  • Clarifies assumptions

Add Strategic Logging

# At function entry
print(f"[DEBUG] function_name called with: {args}")

# At decision points
print(f"[DEBUG] Condition X is {condition_result}")

# Before/after state changes
print(f"[DEBUG] Before: {state}, After: {new_state}")

Bisect Method (for regressions)

# Find which commit introduced the bug
git bisect start
git bisect bad HEAD
git bisect good <last-known-good-commit>
# Test each revision until found

Common Bug Patterns

Off-by-One Errors

  • Loop indices (i < n vs i <= n)
  • Array bounds (arr[len(arr)] instead of arr[len(arr)-1])

Null/Undefined References

  • Check variables before use
  • Verify API responses have expected fields

Race Conditions

  • Async operations completing in unexpected order
  • Shared state without proper locking

Type Mismatches

  • String vs number comparisons
  • Implicit type coercion issues

Stale State

  • Cached values not updated
  • Closure capturing old variables

Output Format

Structure debugging analysis as:

## Problem Statement
[Clear description of the issue]

## Environment
- [Relevant version/config info]

## Error Analysis
[Error message/stack trace analysis]

## Hypotheses (Priority Order)
1. **[Most Likely]**: [Reasoning]
2. **[Second Most Likely]**: [Reasoning]
3. **[Less Likely]**: [Reasoning]

## Investigation Steps
1. [What to check first]
2. [How to verify hypothesis]
3. [Next steps based on results]

## Root Cause
[Once identified, explain the underlying issue]

## Fix
[Specific code changes needed]

## Prevention
[How to avoid this in the future]

Example

User Report: "My API returns 500 errors randomly"

Debugging Response:

Problem Statement

API endpoint returns HTTP 500 errors intermittently. Not all requests fail - some succeed.

Environment

  • Node.js version?
  • Database type?
  • Request rate/concurrency?

Error Analysis

Need to see:

  1. Full error stack trace
  2. Server logs around failure time
  3. Example request that fails

Hypotheses (Priority Order)

  1. Database Connection Pool Exhausted: Intermittent nature suggests resource contention

    • Check if failures correlate with high traffic
    • Verify connection pool size vs concurrent requests
  2. Async Operation Not Awaited: Race condition in code

    • Review async/await usage
    • Check for missing await keywords
  3. Unhandled Promise Rejection: Some error paths not caught

    • Search for promises without .catch() or try/catch

Investigation Steps

  1. Add Detailed Logging

    app.post('/api/endpoint', async (req, res) => {
      console.log('[DEBUG] Request received:', req.body);
      try {
        const result = await someOperation();
        console.log('[DEBUG] Operation succeeded');
        res.json(result);
      } catch (error) {
        console.error('[ERROR] Operation failed:', error.stack);
        res.status(500).json({ error: error.message });
      }
    });
    
  2. Monitor Connection Pool

    db.on('acquire', () => {
      console.log(`[POOL] Connection acquired (${db.pool.size}/${db.pool.max})`);
    });
    
  3. Check for Unhandled Rejections

    process.on('unhandledRejection', (reason, promise) => {
      console.error('[FATAL] Unhandled Promise Rejection:', reason);
    });
    

Next Steps

Deploy logging changes and monitor for patterns in:

  • Time of day
  • Specific user data
  • Server resource usage (CPU, memory, connections)