Guides four-phase systematic debugging: root cause → patterns → hypothesis → implement. For complex bugs, test failures, multi-component issues; not syntax errors.
From popkit-opsnpx claudepluginhub jrc1883/popkit-ai --plugin popkit-opsThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Implements structured self-debugging workflow for AI agent failures: capture errors, diagnose patterns like loops or context overflow, apply contained recoveries, and generate introspection reports.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Random fixes waste time. Quick patches mask issues.
Core principle: ALWAYS find root cause before fixes. Symptom fixes are failure.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION
ANY technical issue: test failures, bugs, unexpected behavior, performance, builds, integration.
ESPECIALLY when:
Don't skip when:
For test failures, check flakiness FIRST:
Test fails → Run 5x
├─ Passes 5/5: Not flaky, investigate as bug
├─ Fails 5/5: Consistent, investigate as bug
└─ Mixed (3/5): FLAKY TEST - fix test first
Flaky test checklist:
| Check | How | Fix |
|---|---|---|
| Isolated/connected? | Run single vs suite | State pollution |
| Timing-dependent? | Look for timeouts/sleeps | Condition-based waiting |
| Environment-specific? | CI vs local | Mock env vars |
| Order-dependent? | Different order | Setup/teardown |
| Race condition? | Async without waits | Proper async/await |
Then continue:
STOP if thinking:
ALL → Return to Phase 1
3+ failures → Question architecture
| Phase | Key Activities | Success |
|---|---|---|
| 1. Root Cause | Read errors, reproduce, gather evidence | Understand WHAT & WHY |
| 2. Pattern | Find working examples, compare | Identify differences |
| 3. Hypothesis | Form theory, test minimally | Confirmed or new |
| 4. Implement | Test, fix, verify | Resolved, tests pass |
See examples/ for:
flaky-test-patterns.md - Common flaky test causes & fixesdebugging-flowchart.pdf - Visual decision treemulti-component-diagnostic.md - Instrumentation strategy