systematic-debugging

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

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/SleyiW/iWana-neXt --skill systematic-debugging-sleyiw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/SleyiW/iWana-neXt/tree/main/.agents/skills/systematic-debugging
Command: npx skills add https://github.com/SleyiW/iWana-neXt --skill systematic-debugging-sleyiw

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 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 shortcut behavior like "just one quick fix" or stacking multiple changes at once. - Supporting Techniques: 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: When a test fails intermittently or a production bug appears deep in the call stack, follow the phases to reproduce the issue, 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 test failure systematically instead of guessing?

Follow the four phases: investigate the root cause by reading errors and reproducing the issue, analyze patterns against working examples, form one hypothesis and test it minimally, then implement a single fix with a failing test first. Never stack multiple fixes at once.

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

Trace backward through the call chain from the immediate cause to the original trigger, asking what called each level and what value was passed. Add stack trace instrumentation with console.error before the failing operation, then fix at the source rather than the symptom.

Should I apply a quick fix during a production emergency?

No. The skill mandates root cause investigation first, arguing systematic debugging is faster than guess-and-check thrashing. Quick symptom fixes set a bad pattern, mask the real issue, and frequently introduce new bugs.

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 care about, such as an event appearing or state changing. Poll every 10ms with a timeout, and only use fixed delays for documented timing behavior.

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

Stop attempting more fixes and question the architecture. Repeated failures where each fix reveals new problems elsewhere indicate a fundamentally wrong pattern, so discuss refactoring the architecture with your team instead of attempting a fourth fix.

How can 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 the file for investigation.