systematic-debugging

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Random fixes and symptom patches waste hours and introduce new bugs. This Skill enforces a disciplined four-phase debugging process 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, each with mandatory completion criteria. - Supporting Techniques: Root cause tracing through call stacks, defense-in-depth validation at multiple layers, and condition-based waiting to replace flaky arbitrary timeouts. - Pressure Resistance: Explicit anti-patterns, red flags, and rationalization tables that stop shortcut fixes during emergencies. - 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 each layer so the bug cannot recur. ## Quick Start Ask the AI to debug your failing test or bug using the systematic-debugging skill and require root cause analysis before 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?

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 case. Never propose fixes before completing the investigation phase.

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

Trace backward through the call chain from the error point to the original trigger, asking what called each function and what value was passed. Add stack trace instrumentation with console.error before the failing operation if manual tracing is not possible.

How do I 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. Poll every 10ms with a timeout, and only use fixed delays when testing documented timing behavior.

Should I apply a quick fix during a production emergency?

No. The skill mandates root cause investigation first because systematic debugging is faster than guess-and-check thrashing, and symptom fixes mask underlying issues. Quick patches set a bad pattern and typically cause rework.

What should I do when three or more fix attempts have failed?

Stop attempting fixes and question the architecture. Repeated failures where each fix reveals new problems elsewhere indicate a fundamentally wrong pattern, so discuss architectural refactoring with your team before trying another fix.

When is it acceptable to skip the systematic debugging process?

Never. The skill explicitly rejects skipping for simple bugs, time pressure, or manager demands, since simple issues still have root causes and rushing guarantees rework. The process is fast for simple bugs.