systematic-debugging

Diagnose root causes of bugs and test failures before applying fixes.

Updated Aug 3, 2026
One-click install
npx skills add https://github.com/m-de-graaff/skills --skill systematic-debugging-m-de-graaff
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/m-de-graaff/skills/tree/main/skills/systematic-debugging
Command: npx skills add https://github.com/m-de-graaff/skills --skill systematic-debugging-m-de-graaff

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Debugging under pressure often turns into guess-and-check: quick fixes that don't hold, stacked patches that add new variables, and hours lost investigating the wrong component. This Skill enforces a root-cause-first process so fixes address the actual source of a bug instead of its symptom. ## Core Features & Use Cases - Four-phase debugging process: reproduce the failure, trace the bad value backward to its origin, state one testable hypothesis, then write a failing test before applying a single targeted fix. - Architecture escalation rule: after three failed fix attempts, stop patching and question the design, with explicit red flags and rationalization tables to catch thrashing early. - Supporting techniques and tooling: reference guides for root-cause tracing, defense-in-depth validation, and condition-based waiting for flaky tests, plus a script that bisects test files to find which one pollutes shared state. - Use Case: A CI suite fails intermittently and a stray .git directory keeps appearing. Run the find-polluter script to identify the offending test file, trace where the empty path value originated, fix it at the source, and add validation so it cannot recur. ## Quick Start Use the systematic-debugging skill to investigate why this test fails intermittently 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?▼

Reproduce the failure reliably, then trace the bad value backward through the call chain to where it originated rather than where it surfaced. State one specific hypothesis, test it with the smallest possible change, and write a failing test before applying the fix.

How do I find which test file creates unwanted state?▼

Use the find-polluter.sh script with the path that should not appear and a test file glob, for example find-polluter.sh '.git' 'src/**/*.test.ts'. It runs each test file individually and stops at the first one that makes the path appear.

How do I fix flaky tests that fail intermittently in CI?▼

Replace arbitrary sleep calls with condition-based waiting that polls for the actual state you need, with a required description and a timeout. Fixed delays are only acceptable when the timing itself is the behavior under test.

When should I stop trying fixes and question the architecture?▼

After three failed fix attempts, stop patching and raise the design concern with the user. Repeated failures, especially when each fix reveals a new problem elsewhere, signal that the design is wrong rather than that the right patch has not been found.

What is defense in depth after fixing a bug?▼

Defense in depth adds validation at every layer the bad data passes through: entry-point checks, business-logic validation, environment guards, and instrumentation. Each layer should be tested independently by deliberately bypassing the layers above it.