
Systematic Debugging
Replace shotgun debugging with a four-phase root-cause workflow before any fix lands in your repo.
Overview
Systematic Debugging is a journey-wide agent skill that enforces four-phase root cause analysis—usable whenever a solo builder needs to prove why a bug exists before committing a fix.
Install
npx skills add https://github.com/itallstartedwithaidea/agent-skills --skill systematic-debuggingWhat is this skill?
- Four-phase root cause analysis: reproduce, hypothesize, test minimally, then fix
- Blocks fixes until root cause is stated in plain language
- One-variable-at-a-time hypothesis testing with observable evidence
- Defense-in-depth hardening after the targeted fix
- Session ends with post-mortem: root cause, fix, and preventive measures
- Four-phase root cause analysis process
- Defense-in-depth hardening step after targeted fix
- Post-mortem documentation required at session end
Adoption & trust: 1 installs on skills.sh; 18 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
You are tempted to change several things at once and hope the failure disappears, which hides the real defect and creates new regressions.
Who is it for?
Solo developers and agent users facing flaky tests, production-only bugs, or stack traces who want scientific debugging discipline.
Skip if: Greenfield feature work with no failure signal, or situations where you only need lint formatting without a defect to analyze.
When should I use this skill?
A test fails unexpectedly or intermittently; a user reports a bug with a stack trace or reproduction steps; or code behaves differently across environments.
What do I get? / Deliverables
You get a reproduced failure, a validated root cause, a minimal fix, defense-in-depth guards, and a post-mortem note instead of unexplained green tests.
- Documented root cause in plain language before the fix
- Targeted code fix with hypothesis evidence trail
- Defense-in-depth guards and a post-mortem note
Recommended Skills
Journey fit
Useful at every journey phase - explore requirements and options before committing to a direction.
Where it fits
A CI test fails intermittently and you need reproduction and ranked hypotheses before merging.
Production logs show a stack trace and you instrument minimally to confirm one causal hypothesis.
A third-party API works locally but fails in staging, so you compare environments one variable at a time.
A user-reported bug arrives with repro steps and you run the four-phase flow before shipping a hotfix.
How it compares
Use instead of ad-hoc chat “try this patch” loops when you need evidence-backed root cause before code changes.
Common Questions / FAQ
Who is systematic-debugging for?
Indie builders and agent operators who debug their own SaaS, APIs, and scripts and want one enforced process instead of shotgun edits.
When should I use systematic-debugging?
In Ship when tests fail or behavior is wrong before release; in Operate when incidents need reproduction and root cause; in Build when implementation bugs appear during integration—any time you have a concrete failure to investigate.
Is systematic-debugging safe to install?
The skill encourages minimal instrumentation rather than destructive commands, but review the Security Audits panel on this page and constrain agent shell access when testing hypotheses.
SKILL.md
READMESKILL.md - Systematic Debugging
# Systematic Debugging Part of [Agent Skills™](https://github.com/itallstartedwithaidea/agent-skills) by [googleadsagent.ai™](https://googleadsagent.ai) ## Description Systematic Debugging replaces trial-and-error fixes with a disciplined four-phase root cause analysis process. The agent reproduces the bug reliably, generates ranked hypotheses, tests each hypothesis with minimal instrumentation, and applies a targeted fix with defense-in-depth hardening. No fix is applied without first understanding why the bug exists. Agents are prone to "shotgun debugging"—changing multiple things simultaneously and hoping the problem disappears. This skill enforces scientific rigor: one variable at a time, observable evidence at each step, and a clear causal chain from root cause to fix. The agent must articulate the root cause in plain language before writing any corrective code. After the immediate fix, the agent applies defense-in-depth: adding assertions, input validation, or monitoring that would catch the same class of bug in the future. The debugging session concludes with a post-mortem note documenting the root cause, the fix, and the preventive measures added. ## Use When - A test fails unexpectedly or intermittently - A user reports a bug with a stack trace or reproduction steps - Code behaves differently in production than in development - An error message is unclear or misleading - Multiple potential causes exist and guessing would waste time - A previous fix attempt did not resolve the issue ## How It Works ```mermaid graph TD A[Bug Report] --> B[Phase 1: Reproduce] B --> C{Reproducible?} C -->|No| D[Gather More Context] D --> B C -->|Yes| E[Phase 2: Hypothesize] E --> F[Rank Hypotheses by Likelihood] F --> G[Phase 3: Test Top Hypothesis] G --> H{Root Cause Found?} H -->|No| I[Eliminate Hypothesis] I --> F H -->|Yes| J[Phase 4: Fix + Harden] J --> K[Write Regression Test] K --> L[Apply Defense-in-Depth] L --> M[Document Post-Mortem] ``` The four phases enforce a strict progression: you cannot fix what you cannot reproduce, you should not fix what you do not understand, and you must not close a bug without preventing its recurrence. ## Implementation ```python class DebuggingSession: def __init__(self, bug_report): self.report = bug_report self.hypotheses = [] self.evidence = [] self.root_cause = None def phase_reproduce(self): """Create a minimal, reliable reproduction.""" minimal_input = self.minimize_reproduction(self.report.steps) result = self.execute(minimal_input) assert result.matches(self.report.expected_failure), \ "Cannot proceed without reliable reproduction" return ReproductionCase(minimal_input, result) def phase_hypothesize(self, repro): """Generate ranked hypotheses from evidence.""" self.hypotheses = [ Hypothesis("Race condition in async handler", likelihood=0.7), Hypothesis("Null reference from cache miss", likelihood=0.5), Hypothesis("Stale closure over mutable state", likelihood=0.3), ] return sorted(self.hypotheses, key=lambda h: -h.likelihood) def phase_test(self, hypothesis, repro): """Test one hypothesis with minimal instrumentation.""" probe = self.instrument(hypothesis.target_area) result = self.execute_with_probe(repro, probe) if result.confirms(hypothesis): self.root_cause = hypothesis else: hypothesis.eliminated = True self.evidence.append(result) def phase_fix(self): """Apply targeted fix with defense-in-depth.""" fix = self.root_cause.generate_fix() regression_test = self.root_cause.generate_regress