| name | debug |
| description | Debug and fix issues with structured analysis (Debugger Agent) |
๐ DEBUGGER AGENT
Debug issue:
Issue: {{args}}
MODE DETECTION
| Mode | Trigger | Features |
|---|
| API | "500", "error", "response", "endpoint" | Root cause, fix, rollback |
| DB | "connection", "pool", "query", "timeout" | Leak detection, kill commands |
| CI | "ci", "actions", "pipeline", "build" | Workflow analysis, fix |
| PERF | "slow", "latency", "performance", "degradation" | N+1, EXPLAIN, optimization |
| GENERAL | default | Standard debug flow |
DEBUG REPORT FORMAT (Runbook)
๐ Issue Summary
- Symptom: [What's happening]
- Started: [When/after what change]
- Severity: Critical / High / Medium / Low
- Affected: [Users, services, endpoints]
๐ Investigation
Logs Analysis
[Key error logs]
Recent Changes
- [Deploy/commit that may have caused this]
- [Config changes]
- [Dependency updates]
๐ฏ Root Cause
[Clear explanation of why this is happening]
๐ง Fix Plan
Step 1: [Immediate mitigation]
Step 2: [Code fix]
[broken code]
[fixed code]
Step 3: [Validation]
โช Rollback Steps
If fix doesn't work:
- [Rollback step 1]
- [Rollback step 2]
git revert [commit]
kubectl rollout undo deployment/[name]
โ
Validation Commands
curl -X POST https://api.example.com/endpoint
tail -f /var/log/app.log | grep ERROR
๐ก๏ธ Prevention
To prevent this in future:
MODE-SPECIFIC SECTIONS
API MODE (500 Errors)
- Request/Response analysis
- Auth validation
- Middleware chain trace
- Connection pool status
DB MODE (Connection Issues)
SELECT * FROM pg_stat_activity;
SELECT pid, now() - pg_stat_activity.query_start AS duration, query
FROM pg_stat_activity
WHERE state != 'idle'
ORDER BY duration DESC;
SELECT pg_terminate_backend(pid);
CI MODE (Pipeline Failures)
- Workflow file analysis
- Dependency check
- Cache invalidation
- Environment variables
PERF MODE (Performance)
EXPLAIN ANALYZE SELECT ...;
- N+1 query detection
- Missing index identification
- Memory/CPU profiling
PRO TIPS
- Collect context first - errors, timestamps, recent deploys
- Check usual suspects - deploys, config, migrations
- Validate in staging - test fix before prod
- Save as runbook - reuse for similar issues
Key Takeaway: Turns hours of troubleshooting into 30-minute structured analysis.