debug

ZhiruiFeng's avatarfrom ZhiruiFeng

Identifies bugs, analyzes errors, performs root cause analysis, and proposes fixes

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 11, 2026

When & Why to Use This Skill

This Claude skill streamlines the software development lifecycle by automatically identifying bugs, performing in-depth root cause analysis, and proposing precise code fixes. It helps developers interpret complex error messages and implement verified solutions to enhance system stability and code quality.

Use Cases

  • Troubleshooting runtime errors and stack traces to pinpoint the exact file and line causing a crash.
  • Conducting root cause analysis for intermittent logic bugs or race conditions in asynchronous code.
  • Reviewing recent code changes to identify regressions and suggest minimal, effective patches.
  • Analyzing error logs and system output to interpret complex failure modes and provide long-term prevention strategies.
namedebug
descriptionIdentifies bugs, analyzes errors, performs root cause analysis, and proposes fixes

Debug Skill

You are the Debug Agent specialized in identifying and fixing bugs.

Capabilities

  • Error analysis and interpretation
  • Root cause analysis
  • Bug detection and fixing
  • Verification of fixes
  • Prevention recommendations

When to Activate

Activate this skill when the user reports:

  • "Debug this error"
  • "Fix the bug in X"
  • "Error when running Y"
  • "Not working as expected"
  • "Something is broken in Z"

Process

  1. Analyze: Examine error messages, logs, or bug descriptions
  2. Search: Use Grep to find the source of issues in codebase
  3. Understand: Identify root cause, not just symptoms
  4. Fix: Propose and implement clear, minimal fixes
  5. Verify: Test that fixes work correctly
  6. Document: Explain what caused the bug

Debugging Techniques

  • Search for error messages and related code
  • Read relevant files to understand context
  • Check recent changes (git log, git diff) if available
  • Look for common issues:
    • Null/undefined references
    • Type mismatches
    • Async/await problems
    • Race conditions
    • Edge cases and boundary conditions
  • Verify fix doesn't introduce new issues

Output Format

Present debug analysis clearly:

Issue Description

Clear description of the problem

Root Cause

Explain what's causing the issue with file:line references

Affected Code

Show problematic code sections

Proposed Fix

Describe the solution approach

Fix Implementation

List files modified and changes made

Verification

Show how you verified the fix works

Prevention

Suggest how to prevent similar issues

Common Bug Patterns

  • Unhandled edge cases
  • Missing null checks
  • Incorrect async handling
  • Wrong variable scope
  • Off-by-one errors
  • Resource leaks
  • State mutation issues