Resolve software bugs, flaky tests, and production failures through disciplined four-phase root-cause investigation, isolated code review, and evidence-before-completion verification. Use for debugging, triage, and QA fixes.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Systematic Debugging?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/johnson-durui-systematic-debugging)
---
name: systematic-debugging
description: Resolve software bugs, flaky tests, and production failures through disciplined four-phase root-cause investigation, isolated code review, and evidence-before-completion verification. Use for debugging, triage, and QA fixes.
license: MIT
source: obra/superpowers
---
# Systematic Debugging & Verification Discipline
Adapted for ApexCluster from `obra/superpowers` (`skills/systematic-debugging`, `skills/requesting-code-review`, and `skills/verification-before-completion`, MIT).
## Purpose
Eliminate guess-and-patch debugging loops by enforcing scientific root-cause isolation, minimal targeted fixes, independent diff review, and fresh verification evidence before declaring any issue solved.
## Phase 1: Reproduce & Gather Evidence First
Never propose a code edit until you have directly observed the failure:
1. **Read the Exact Failure**: Capture the full error message, stack trace, failing assertion, HTTP status, or exit code—do not paraphrase from intuition.
2. **Minimal Reproduction**: Identify the smallest deterministic command or test case that triggers the bug reliably.
3. **Trace Recent Changes & Boundaries**: Inspect recent git diffs, data boundaries, config/env inputs, and cross-module contracts around the failing path.
## Phase 2: Pattern Analysis & Single-Hypothesis Testing
1. **Compare Working vs. Failing Paths**: Find a similar working code path or passing test in the repository and diff every assumption (types, encoding, async timing, path resolution, permissions, state initialization).
2. **Form One Falsifiable Hypothesis**: State explicitly: *"I believe root cause X produces symptom Y because of code path Z."*
3. **Verify the Hypothesis**: Confirm X with targeted inspection, logging, or a minimal test—never stack three speculative edits at once. If three consecutive hypotheses fail, step back and question the underlying architectural assumption.
## Phase 3: Minimal Fix & Regression Test
1. **Write a Failing Regression Test First**: Capture the exact bug in an automated test and confirm it fails for the expected reason.
2. **Apply the Smallest Clean Root-Cause Fix**: Fix the cause at the true boundary rather than adding brittle downstream band-aids or swallowing errors.
3. **Audit Scope & Side Effects**: Review the full diff (`git diff`) for unintended edits, edge cases, concurrency/cleanup leaks, and security regressions.
## Phase 4: Verification Before Completion (Iron Law)
- **No Claims Without Fresh Evidence**: Run the full relevant test suite, typecheck, and build *after* the final edit and inspect real command exit codes and outputs.
- **Request Independent Review (When Multi-Agent)**: Hand off a clean diff summary (intent, root cause, changed files, test commands run) to an independent reviewer seat without polluting their context with noisy trial logs.
- **Honest Failure Reporting**: If a check cannot be run (for example, missing optional service or offline constraint), report exactly what was verified and what remains unverified.