systematic-debugging

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

Updated Jul 23, 2025
One-click install
npx skills add https://github.com/derrik-fleming/dotfiles --skill systematic-debugging-derrik-fleming
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/derrik-fleming/dotfiles/tree/main/private_dot_agents/skills/systematic-debugging
Command: npx skills add https://github.com/derrik-fleming/dotfiles --skill systematic-debugging-derrik-fleming

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 debugging methodology that finds root causes instead of treating symptoms, even under time pressure or social pressure to apply quick fixes. ## Core Features & Use Cases - Four-Phase Process: Root cause investigation, pattern analysis, hypothesis testing, and 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. - Pressure Resistance: Anti-patterns, red flags, and rationalization tables that stop shortcut behavior during emergencies, plus a bisection script to find test pollution. - Use Case: When a test fails intermittently or a production bug appears deep in the call stack, follow the phases to trace the bad value to its source, form a single hypothesis, create a failing test, and fix at the origin rather than the symptom. ## Quick Start Ask the AI to debug your failing test or bug using the systematic-debugging skill 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 test failure systematically instead of guessing?▼

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. 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 immediate cause 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, then fix at the source rather than where the error appears.

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. Quick patches mask underlying issues and create new bugs, and the first fix sets the pattern for everything after.

How do I fix flaky tests caused by arbitrary timeouts?▼

Replace setTimeout and sleep calls with condition-based waiting that polls for the actual condition you care about, such as an event appearing or state changing. Use a 10ms polling interval with a timeout, and only keep arbitrary delays when testing actual timing behavior with documented justification.

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

Stop and question the architecture rather than attempting a fourth fix. Repeated failures where each fix reveals new problems elsewhere indicate a fundamentally wrong pattern, so discuss refactoring the architecture with your team before continuing.

How do I find which test is polluting shared state or creating 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.