systematic-debugging

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

Updated Aug 20, 2026
One-click install
npx skills add https://github.com/Pega88/agy-superpowers --skill systematic-debugging-pega88
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/Pega88/agy-superpowers/tree/main/.agents/plugins/superpowers/skills/systematic-debugging
Command: npx skills add https://github.com/Pega88/agy-superpowers --skill systematic-debugging-pega88

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Developers under time pressure often apply quick symptom fixes that fail repeatedly, causing thrashing, flaky tests, and recurring production incidents. This Skill enforces a disciplined investigation workflow so bugs are fixed at their actual root cause instead of being patched superficially. ## Core Features & Use Cases - Four-Phase Debugging Process: Enforces Root Cause Investigation, Pattern Analysis, Hypothesis Testing, and Implementation in strict order, with explicit stop conditions when fixes fail. - Supporting Techniques: Includes references for root-cause tracing through call stacks, defense-in-depth validation at multiple layers, and condition-based waiting to replace flaky arbitrary timeouts in tests. - Pollution Bisection Script: Ships a find-polluter.sh script that runs test files one by one to identify which test creates unwanted files or state. - Use Case: A test suite fails intermittently in CI. Instead of adding longer sleep calls, follow the process to reproduce the failure, trace the data flow to the original trigger, form a single hypothesis, and verify the fix with a failing test first. ## Quick Start Ask the agent to debug a failing test or bug using the systematic-debugging skill and require root cause investigation before any fix is proposed.

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 verified by a failing test. Never propose fixes before completing the investigation phase.

How to fix flaky tests caused by arbitrary timeouts?

Replace setTimeout or sleep calls with condition-based waiting that polls for the actual condition you care about, such as an event appearing or state changing. The included reference provides waitForEvent and waitForEventCount helpers that eliminated flakiness in a real test suite.

What should I do when multiple fix attempts keep failing?

Stop after three failed fixes and question the architecture rather than attempting a fourth fix. Repeated failures where each fix reveals new problems elsewhere indicate a fundamentally wrong pattern, which should be discussed before continuing.

How do I find which test is polluting the filesystem or state?

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

When is it acceptable to skip root cause investigation for simple bugs?

Never. The skill explicitly states that simple bugs have root causes too and the process is fast for simple issues. Skipping investigation under time pressure leads to symptom fixes that guarantee rework and recurring failures.