systematic-debugging

Diagnose bugs through a four-phase root cause investigation process before proposing fixes.

7|Updated May 13, 2026
One-click install
npx skills add https://github.com/DawnMoon1542/agents-skills --skill systematic-debugging-dawnmoon1542
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/DawnMoon1542/agents-skills/tree/main/workflow/systematic-debugging
Command: npx skills add https://github.com/DawnMoon1542/agents-skills --skill systematic-debugging-dawnmoon1542

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Random fixes and quick patches waste hours and introduce new bugs by masking underlying problems. This Skill enforces a disciplined debugging methodology that finds the actual root cause before any fix is attempted, even under time pressure, authority pressure, or fatigue. ## Core Features & Use Cases - Four-Phase Framework: Root cause investigation, pattern analysis, hypothesis testing, and implementation, with explicit gates preventing skipped steps. - Pressure-Resistant Rules: Anti-patterns, red-flag signals, and rationalization tables that stop shortcut fixes like arbitrary timeouts, shotgun changes, and symptom patching. - Supporting Techniques: Root cause tracing through call stacks, defense-in-depth validation across layers, condition-based waiting to replace flaky test timeouts, and a bisection script to find polluting tests. - Use Case: A test fails intermittently in CI. Instead of adding sleep calls, you trace the data flow backward, find the empty variable causing the failure, fix it at the source, and add validation at every layer so the bug cannot recur. ## Quick Start Use the systematic-debugging skill to investigate this failing test and find its root cause before suggesting any fix.

Frequently Asked Questions about systematic-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a failing test without guessing?

Follow the four-phase process: read the full error and stack trace, reproduce the failure reliably, check recent changes, then form one hypothesis and test it with a minimal change. Never propose a fix before completing root cause investigation.

How to find the root cause of a bug deep in the call stack?

Trace backward from the error location by asking what called each layer and what values were passed. Add stack trace logging with console.error before the failing operation, then fix at the original trigger point rather than where the symptom appears.

How do I fix flaky tests caused by timing issues?

Replace arbitrary setTimeout or sleep calls with condition-based waiting that polls for the actual state you need, such as an event arriving or a count being reached. This eliminates race conditions and typically makes tests faster and deterministic.

What should I do when my first fix does not work?

Stop and return to root cause investigation with the new information instead of stacking more fixes. If three or more fixes fail, treat it as an architecture problem and question the underlying pattern before attempting further changes.

When is it acceptable to skip systematic debugging?

Never, according to the methodology. Simple bugs still have root causes, emergencies favor systematic investigation over guess-and-check cycles, and apparent quick fixes typically cause rework that costs more time overall.

How do I find which test is polluting shared state?

Use the find-polluter.sh bisection script, which runs each test file individually and checks whether the polluting file or directory appears. It stops at the first test that creates the unwanted state, identifying the culprit directly.