systematic-debugging

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

Updated Aug 13, 2026
One-click install
npx skills add https://github.com/Viranya2006/Lumen --skill systematic-debugging-viranya2006
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/Viranya2006/Lumen/tree/main/SKILLS/systematic-debugging
Command: npx skills add https://github.com/Viranya2006/Lumen --skill systematic-debugging-viranya2006

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Engineers under time pressure often apply quick symptom fixes that fail repeatedly, causing thrashing, regressions, and wasted hours. This Skill enforces a disciplined debugging methodology that finds the actual root cause before any fix is attempted. ## Core Features & Use Cases - Four-Phase Process: Structured workflow covering root cause investigation, pattern analysis, hypothesis testing, and verified implementation. - 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 during emergencies, plus escalation guidance when 3+ fixes fail (architectural problem signal). - Use Case: A test suite has flaky failures from race conditions. Instead of adding longer sleep delays, use this Skill to trace the data flow, find the actual timing dependency, and replace arbitrary timeouts with condition-based polling. ## Quick Start Use the systematic-debugging skill to investigate why this test fails intermittently instead of adding another timeout.

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 consistently, 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 race conditions?

Replace arbitrary setTimeout or sleep delays with condition-based waiting that polls for the actual state you need, such as waiting for a specific event count. This eliminates race conditions and typically makes tests faster and more reliable.

What should I do when multiple fix attempts keep failing?

Stop after three failed fixes and question the architecture rather than attempting a fourth fix. Repeated failures where each fix reveals new problems elsewhere indicate a fundamental design problem requiring architectural discussion, not another patch.

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

Trace backward from the error location 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 insufficient.

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

Never. Simple bugs have root causes too, and the systematic process is fast for simple issues. Skipping investigation even under time pressure leads to symptom fixes that cause rework and new bugs.

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

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.