systematic-debugging

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

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/MaiconGambini/opencode-harness-guide --skill systematic-debugging-maicongambini
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/MaiconGambini/opencode-harness-guide/tree/main/skills/systematic-debugging
Command: npx skills add https://github.com/MaiconGambini/opencode-harness-guide --skill systematic-debugging-maicongambini

SYSTEM DOCUMENTATION & REQUIREMENTS

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

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 actual 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. - Pressure-Resistant Rules: Explicit red flags, rationalization tables, and anti-patterns that stop symptom-fixing behavior during emergencies, exhaustion, or authority pressure. - Supporting Techniques: Includes root-cause tracing through call stacks, defense-in-depth validation at multiple layers, condition-based waiting to replace flaky timeouts, and a bisection script to find test polluters. - Use Case: A test fails intermittently in CI. Instead of adding arbitrary sleep delays, follow Phase 1 to reproduce and gather evidence, trace the bad value to its source, form a single hypothesis, and implement one verified fix with a failing test first. ## 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 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 first. Never propose fixes before completing Phase 1.

How to fix flaky tests caused by timing issues?

Replace arbitrary setTimeout or sleep delays with condition-based waiting that polls for the actual condition you need, such as an event appearing or state changing. The included condition-based-waiting technique fixed 15 flaky tests, raising pass rates from 60% to 100%.

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

Stop and form a new hypothesis rather than stacking more fixes. If three or more fixes have failed, treat it as an architectural problem and discuss the fundamental design with your team before attempting another fix.

How do I find which test is polluting shared state?

Use the included find-polluter.sh bisection script, which runs test files one by one and stops at the first test that creates the unwanted file or state. Run it with the pollution path and a test file glob pattern.

When is it acceptable to skip root cause investigation for simple bugs?

Never. The skill states that simple bugs have root causes too, and the systematic process is fast for simple issues. Skipping investigation leads to symptom fixes that mask problems and create new bugs.

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

Trace backward through the call chain from the immediate cause to the original trigger, adding stack trace instrumentation with console.error before the failing operation if needed. Fix at the source, then add defense-in-depth validation at each layer the data passes through.