systematic-debugging

Diagnose software bugs through a four-phase root cause investigation process.

Updated Jan 2, 2025
One-click install
npx skills add https://github.com/mcinnisd/gymbro --skill systematic-debugging-mcinnisd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/mcinnisd/gymbro/tree/main/.agents/skills/systematic-debugging
Command: npx skills add https://github.com/mcinnisd/gymbro --skill systematic-debugging-mcinnisd

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Developers under time pressure often apply quick symptom fixes that fail repeatedly, causing hours of thrashing and recurring bugs. This Skill enforces a disciplined four-phase debugging methodology that finds root causes before any fix is attempted. ## Core Features & Use Cases - Four-Phase Process: Root cause investigation, pattern analysis, hypothesis testing, and verified implementation with explicit gates between phases. - 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. - Failure Escalation: After three failed fixes, the process mandates questioning the architecture rather than attempting a fourth fix. - Use Case: When a test fails intermittently in CI, use this Skill to trace the bad value back through the call chain, form a single hypothesis, create a failing test, and fix the source instead of adding another sleep timeout. ## Quick Start Use the systematic-debugging skill to investigate why my payment processing test fails intermittently and find 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 find the root cause of a bug instead of fixing symptoms?

Follow the four-phase process: read error messages completely, reproduce the issue consistently, check recent changes, then trace the bad value backward through the call stack to its origin. Only form a fix hypothesis after this investigation completes.

How to fix flaky tests caused by arbitrary timeouts?

Replace setTimeout and sleep calls with condition-based waiting that polls for the actual condition you need, such as an event appearing or state changing. The included waitForEvent helpers poll every 10ms with a timeout, which raised one test suite's pass rate from 60% to 100%.

What should I do when my first bug fix doesn't work?

Stop and return to Phase 1 investigation with the new information rather than stacking more fixes. If three fixes have failed, stop entirely and question whether the underlying architecture is the real problem before attempting a fourth fix.

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

Never, according to the skill's iron law: no fixes without root cause investigation first. Simple bugs have root causes too, and the process is fast for simple issues while guess-and-check thrashing wastes more time even in emergencies.

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

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.