Loading...
Loading...
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 skill4agent add shubhamsaboo/awesome-llm-apps debugger1. 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 foundi < ni <= narr[len(arr)]arr[len(arr)-1]## 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]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 });
}
});db.on('acquire', () => {
console.log(`[POOL] Connection acquired (${db.pool.size}/${db.pool.max})`);
});process.on('unhandledRejection', (reason, promise) => {
console.error('[FATAL] Unhandled Promise Rejection:', reason);
});