systematic-debugging

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

Updated Aug 3, 2026
One-click install
npx skills add https://github.com/Yvesdefaria/GymLab --skill systematic-debugging-yvesdefaria
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/Yvesdefaria/GymLab/tree/main/.opencode/skills/systematic-debugging
Command: npx skills add https://github.com/Yvesdefaria/GymLab --skill systematic-debugging-yvesdefaria

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? When facing bugs, test failures, or unexpected behavior, it is tempting to apply quick symptom fixes that fail repeatedly and waste hours. This Skill enforces a disciplined four-phase debugging methodology that finds the actual root cause before any fix is attempted. ## Core Features & Use Cases - Four-Phase Process: Root cause investigation, pattern analysis, hypothesis testing, and verified implementation, with mandatory completion of each phase before proceeding. - Supporting Techniques: Includes 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 under time pressure, plus a rule to question the architecture after three failed fixes. - Use Case: A test suite has flaky failures caused by arbitrary sleep calls. Use this Skill to trace the root cause, replace timeouts with condition-based waiting, and add validation layers 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 find the root cause of a bug instead of fixing symptoms?

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

How to fix flaky tests caused by setTimeout and sleep calls?

Replace arbitrary timeouts with condition-based waiting that polls for the actual condition you care about, such as an event appearing or state changing. Poll every 10ms with a clear timeout error, which eliminates race conditions and typically speeds up test execution.

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

Stop and return to root cause investigation with the new information rather than stacking more fixes. If three or more fixes have failed, treat it as an architectural problem and discuss the fundamental design before attempting another fix.

How do I trace a bug that appears deep in the call stack?

Trace backward from the immediate cause by asking what called each function and what values were passed, continuing until you find the original trigger. Add stack trace instrumentation with console.error before the failing operation when manual tracing is not possible.

When is it acceptable to skip systematic debugging for simple bugs?

Never. Simple bugs have root causes too, and the process is fast for simple issues. Skipping investigation under time pressure leads to guess-and-check thrashing that is slower than systematic debugging.

What is defense-in-depth validation after fixing a bug?

It means adding validation at every layer data passes through: entry point checks, business logic validation, environment guards, and debug instrumentation. This makes the bug structurally impossible rather than fixed at a single bypassable point.