ct-systematic-debugging

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

1|Updated Sep 8, 2026
One-click install
npx skills add https://github.com/mercadona/control-tower --skill ct-systematic-debugging-mercadona
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ct-systematic-debugging
Source: https://github.com/mercadona/control-tower/tree/main/plugin/skills/ct-systematic-debugging
Command: npx skills add https://github.com/mercadona/control-tower --skill ct-systematic-debugging-mercadona

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Random fixes and quick patches waste time, mask underlying issues, and introduce new bugs. This Skill enforces a disciplined debugging methodology that finds the actual root cause before any fix is attempted, even under time pressure or social pressure to apply a quick patch. ## Core Features & Use Cases - Four-Phase Process: Root cause investigation, pattern analysis, hypothesis testing, and implementation, with mandatory completion of each phase before proceeding. - Pressure-Resistant Rules: Explicit red flags, rationalization tables, and anti-patterns that stop shortcut behavior like "just one quick fix" or stacking multiple changes at once. - Supporting Techniques: Includes root-cause tracing through call stacks, defense-in-depth validation across layers, condition-based waiting to replace flaky timeouts, and a bisection script to find test polluters. - Use Case: When a test fails intermittently or a production bug appears deep in the call stack, follow Phase 1 to gather evidence at each component boundary, trace the bad value to its source, then fix at the origin with a failing test first. ## Quick Start Use the systematic debugging skill to investigate this failing test and find its root cause before suggesting any fix.

Frequently Asked Questions about ct-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: first investigate the root cause by reading errors fully, reproducing consistently, and checking recent changes. Then analyze patterns, form one hypothesis, test it minimally, and only then implement a fix with a failing test first.

What should I do when a quick fix seems obvious under time pressure?▼

Still complete root cause investigation first. The skill states that systematic debugging is faster than guess-and-check thrashing, and symptom fixes are classified as failure regardless of urgency or pressure from others.

How do I find which test is polluting shared state or creating files?▼

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

How do I 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 reference docs include waitForEvent and waitForEventCount implementations.

What should I do after three fix attempts have all failed?▼

Stop attempting more fixes and question the architecture. Three or more failures indicate a structural problem, so discuss whether the pattern is fundamentally sound with your team before trying another fix.

When is it acceptable to skip the systematic debugging process?▼

Never, according to the skill. Simple bugs have root causes too, emergencies make guessing more costly, and skipping investigation guarantees rework. The process is designed to be fast for simple issues.