systematic-debugging

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

Updated Nov 1, 2024
One-click install
npx skills add https://github.com/mlorentedev/dotfiles --skill systematic-debugging-mlorentedev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/mlorentedev/dotfiles/tree/main/harness/skills/systematic-debugging
Command: npx skills add https://github.com/mlorentedev/dotfiles --skill systematic-debugging-mlorentedev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Random fixes and guess-and-check patching waste hours, mask underlying issues, and introduce new bugs. This Skill enforces a disciplined debugging process that finds the root cause before any fix is attempted. ## Core Features & Use Cases - Four-Phase Process: Root cause investigation, pattern analysis, hypothesis falsification with an evidence matrix, and tested implementation. - Supporting Techniques: Reference guides for root-cause tracing through call stacks, defense-in-depth validation at multiple layers, and condition-based waiting to fix flaky tests. - Polluter Bisection Script: A bash script that runs tests one-by-one to identify which test creates unwanted files or state. - Use Case: When a CI pipeline fails intermittently, apply the hypothesis tree with 60-second discriminator commands to isolate whether the cause is environmental, logical, or a race condition before writing any fix. ## Quick Start Ask the AI to systematically debug a failing test or bug using root cause investigation instead of guessing at fixes.

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 guessing fixes?

Follow a four-phase process: read error messages and reproduce the issue consistently, compare against working examples, form falsifiable hypotheses tested with discriminator commands, then implement one fix verified by a failing test. Never propose fixes before completing root cause investigation.

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 care about, such as an event appearing or state changing. Poll every 10ms with a clear timeout error, which eliminated 15 flaky tests and raised pass rates from 60% to 100% in documented sessions.

How do I find which test is polluting shared state?

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

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

Stop attempting fixes and question the architecture. Repeated failures where each fix reveals new problems elsewhere indicate a structural issue, not a wrong hypothesis. Discuss refactoring the pattern with your team before attempting another fix.

Why add validation at multiple layers after fixing a bug?

Single-point validation can be bypassed by different code paths, mocks, or refactoring. Defense-in-depth adds checks at entry points, business logic, environment guards, and debug instrumentation, making the bug structurally impossible rather than merely patched.