systematic-debugging

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

Updated May 22, 2026
One-click install
npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill systematic-debugging-viniciuscs84
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/viniciuscs84/sdd-toolkit/tree/main/skills/systematic-debugging
Command: npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill systematic-debugging-viniciuscs84

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Random fixes and quick patches waste time, mask underlying issues, and introduce new bugs. This Skill enforces a disciplined debugging methodology that finds the root cause before any fix is attempted, even under time pressure or social pressure to apply a quick patch. ## Core Features & Use Cases - Four-Phase Process: Root cause investigation, pattern analysis, hypothesis testing, and implementation, with mandatory completion of each phase before proceeding. - Supporting Techniques: Root cause tracing through call stacks, defense-in-depth validation at multiple layers, and condition-based waiting to replace flaky arbitrary timeouts in tests. - Pressure Resistance: Explicit anti-patterns, red flags, and rationalization tables that stop shortcut fixes during emergencies, plus escalation to architectural review after three failed fixes. - Use Case: A test fails intermittently in CI. Instead of adding sleep delays, you trace the data flow backward, find the actual race condition, write a failing test, fix the source, and add validation at each layer. ## 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 test failure systematically instead of guessing?

Follow the four phases: investigate the root cause by reading errors and reproducing consistently, analyze patterns against working examples, form and test a single hypothesis, then implement one fix with a failing test. Never propose fixes before completing the investigation phase.

How to fix flaky tests caused by race conditions?

Replace arbitrary setTimeout or sleep delays with condition-based waiting that polls for the actual expected state, such as waiting for a specific event or count. This eliminates timing guesses and typically raises pass rates while speeding up execution.

What should I do when a bug appears deep in the call stack?

Trace backward through the call chain to find where the bad value originated, then fix at the source rather than where the error appears. Add stack trace instrumentation with console.error before the failing operation if manual tracing is not possible.

Should I apply a quick fix during a production emergency?

No. The skill mandates root cause investigation even under time pressure, because systematic debugging is faster than guess-and-check thrashing. Quick symptom patches mask the real issue and typically cause repeat incidents.

What does it mean when three or more fix attempts have failed?

Three failed fixes indicate a likely architectural problem rather than a wrong hypothesis. Stop attempting more fixes and question whether the underlying pattern or design is fundamentally sound, discussing it with your team before continuing.

How do I find which test is polluting shared state or the filesystem?

Use the included find-polluter.sh bisection script, which runs test files one by one and checks whether the unwanted file or directory appears after each run. It stops at the first polluting test and reports it for investigation.