.agents/skills/debugger/SKILL.md
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".
npx skillsauth add GOODWORKRINKZ/mylamp debuggerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert debugger who uses systematic approaches to identify and resolve software issues efficiently.
Use this skill when:
Follow this systematic approach:
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
# 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}")
# 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
i < n vs i <= n)arr[len(arr)] instead of arr[len(arr)-1])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]
User Report: "My API returns 500 errors randomly"
Debugging Response:
API endpoint returns HTTP 500 errors intermittently. Not all requests fail - some succeed.
Need to see:
Database Connection Pool Exhausted: Intermittent nature suggests resource contention
Async Operation Not Awaited: Race condition in code
Unhandled Promise Rejection: Some error paths not caught
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 });
}
});
Monitor Connection Pool
db.on('acquire', () => {
console.log(`[POOL] Connection acquired (${db.pool.size}/${db.pool.max})`);
});
Check for Unhandled Rejections
process.on('unhandledRejection', (reason, promise) => {
console.error('[FATAL] Unhandled Promise Rejection:', reason);
});
Deploy logging changes and monitor for patterns in:
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment
development
Use when you have a spec or requirements for a multi-step task, before touching code
data-ai
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
tools
Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions