systematic-debugging

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

Updated May 19, 2026
One-click install
npx skills add https://github.com/davidsunglee/pi-flow --skill systematic-debugging-davidsunglee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/davidsunglee/pi-flow/tree/main/packages/pi-flow-core/skills/systematic-debugging
Command: npx skills add https://github.com/davidsunglee/pi-flow --skill systematic-debugging-davidsunglee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Random fixes and guess-and-check patches waste time, mask underlying issues, and create 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 testing, and verified implementation, each gated before proceeding. - Multi-Component Evidence Gathering: Instrument component boundaries with logging to identify exactly which layer fails in pipelines like CI to build to signing. - Architectural Escalation: After three failed fixes, stop and question the architecture instead of attempting a fourth patch. - Supporting Techniques: Includes root-cause tracing through call stacks, defense-in-depth validation at four layers, and condition-based waiting to replace flaky arbitrary timeouts. - Use Case: A test fails intermittently in CI. Instead of adding a sleep, trace the data flow backward, form a single hypothesis, test it minimally, and fix the source with a failing test proving the resolution. ## Quick Start Use the systematic-debugging skill to investigate this failing test and find its 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 test failure systematically?▼

Start with root cause investigation: read the full error and stack trace, reproduce the failure consistently, and check recent changes via git diff. Then form one specific hypothesis, test it with the smallest possible change, and only implement a fix after confirming the cause.

How to find root cause of bugs in multi-component systems?▼

Add diagnostic logging at each component boundary, recording what data enters and exits every layer. Run once to gather evidence showing where the chain breaks, then investigate only that failing component instead of guessing across the whole system.

Why are my tests flaky with setTimeout delays?▼

Arbitrary delays create race conditions that pass on fast machines but fail under load or in CI. Replace them with condition-based waiting that polls for the actual expected state, such as an event firing or a value changing, with a timeout and clear error message.

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

Stop after three failed fix attempts, especially when each fix reveals a new problem in a different place or requires massive refactoring. This pattern indicates an architectural problem, so discuss the design fundamentals before attempting any further patches.

What is defense-in-depth validation for bug fixes?▼

Defense-in-depth adds validation at every layer data passes through: entry point checks, business logic validation, environment guards, and debug instrumentation. This makes the bug structurally impossible rather than relying on a single check that other code paths can bypass.