systematic-debugging

Diagnose bugs through four-phase root-cause investigation before proposing any fix.

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

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 root-cause investigation process so every fix addresses the actual source of a problem instead of its symptoms. ## Core Features & Use Cases - Four-Phase Debugging Process: Enforces root-cause investigation, pattern analysis, hypothesis testing, and verified implementation in strict order. - 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. - Pollution Bisection Script: Ships a bash script that runs tests one-by-one to identify which test creates unwanted files or state. - Use Case: When a CI build fails or a test suite is flaky, apply the process to gather evidence at each component boundary, form a single hypothesis, and verify a minimal fix with a failing test first. ## Quick Start Ask the AI to systematically debug your failing test or bug by finding the root cause before proposing 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?▼

Start by reading the full error message and stack trace, then reproduce the failure consistently. Check recent changes, gather evidence at each component boundary, form one hypothesis, and test it with the smallest possible change before implementing a fix.

How to fix flaky tests caused by timing issues?▼

Replace arbitrary setTimeout or sleep delays with condition-based waiting that polls for the actual expected state, such as an event appearing or a count being reached. Poll every 10ms with a clear timeout error message.

What is root cause tracing in debugging?▼

Root cause tracing follows a bug backward through the call stack from where the error appears to where the bad value originated. You fix the source rather than the symptom, then add validation at each layer the data passes through.

When should I question the architecture instead of fixing a bug?▼

After three or more failed fix attempts, stop and question the architecture. Signals include each fix revealing new problems elsewhere, fixes requiring massive refactoring, or fixes creating new symptoms in different places.

How do I find which test pollutes shared state?▼

Use the included find-polluter.sh bisection script with the polluted path and a test file pattern. It runs each test individually and stops at the first one that creates the unwanted file or directory.