systematic-debugging

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

Updated Jul 22, 2026
One-click install
npx skills add https://github.com/johnstegeman/pi-packages --skill systematic-debugging-johnstegeman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/johnstegeman/pi-packages/tree/main/packages/pi-superpowers-plus/skills/systematic-debugging
Command: npx skills add https://github.com/johnstegeman/pi-packages --skill systematic-debugging-johnstegeman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers under time pressure often guess at fixes, patch symptoms instead of root causes, and stack multiple changes that introduce new bugs. This Skill enforces a disciplined investigation-first process so every fix is grounded in evidence. ## Core Features & Use Cases - Four-Phase Debugging Process: Root cause investigation, pattern analysis, single-hypothesis testing, and verified implementation, with mandatory phase gates. - Root Cause Tracing: Techniques for tracing bad values backward through the call stack, plus a find-polluter.sh bisection script that identifies which test creates unwanted files or state. - Defense-in-Depth Validation: Guidance for adding validation at entry, business logic, environment, and debug layers so fixed bugs become structurally impossible. - Flaky Test Remediation: Condition-based waiting patterns that replace arbitrary timeouts with polling on actual conditions. - Use Case: A test suite intermittently creates a .git directory in source code. Use this Skill to trace the empty projectDir through five call levels, fix the source, and add layered validation. ## Quick Start Use the systematic-debugging skill to investigate why my test suite is failing before suggesting 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-phase process: investigate the root cause by reading errors and reproducing consistently, compare against working examples, test one minimal hypothesis at a time, then implement a single fix with a failing test. Never propose fixes before completing root cause investigation.

How to find which test creates unwanted files or state?

Use the find-polluter.sh bisection script with the polluted path and a test file pattern, for example ./find-polluter.sh '.git' 'src/**/*.test.ts'. It runs each test individually and stops at the first one that creates the pollution.

How do I fix flaky tests caused by timing issues?

Replace arbitrary setTimeout or sleep calls with condition-based waiting that polls for the actual condition you need, such as an event appearing or a state changing. Poll every 10ms with a timeout, and only use fixed delays for documented timing behavior.

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 fundamentally wrong pattern, not a failed hypothesis. Discuss refactoring the architecture before trying another fix.

When should I not use a systematic debugging process?

The process applies to any technical issue including simple bugs, since simple issues have root causes too. The only exception is truly environmental or timing-dependent issues, which should be documented and handled with retries, timeouts, and monitoring.