systematic-debugging

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

Updated Jan 12, 2025
One-click install
npx skills add https://github.com/rinbarpen/NeuroTrain --skill systematic-debugging-rinbarpen
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: systematic-debugging
Source: https://github.com/rinbarpen/NeuroTrain/tree/main/.cursor/commands/systematic-debugging
Command: npx skills add https://github.com/rinbarpen/NeuroTrain --skill systematic-debugging-rinbarpen

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 true root cause before any fix is attempted, even under time pressure or social pressure to take shortcuts. ## Core Features & Use Cases - Four-Phase Process: Structured workflow covering root cause investigation, pattern analysis, hypothesis testing, and verified implementation. - Supporting Techniques: Includes root-cause tracing through call stacks, defense-in-depth validation at multiple layers, and condition-based waiting to replace flaky arbitrary timeouts. - Pressure Resistance: Explicit anti-patterns, red flags, and rationalization tables that stop shortcut behavior during emergencies, exhaustion, or authority pressure. - Use Case: When a test fails intermittently or a production bug appears deep in the call stack, follow the phases to trace the bad value to its origin, form a single hypothesis, create a failing test, and fix at the source rather than the symptom. ## Quick Start Ask the AI to debug a failing test or bug using the systematic-debugging process, starting with root cause investigation 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 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 against working examples, form a single hypothesis, test it minimally, and implement one verified fix with a failing test case.

How to find the root cause of a bug deep in the call stack?▼

Trace backward through the call chain from the immediate cause to the original trigger, asking what called each level and what value was passed. Add stack trace instrumentation with console.error before the failing operation, and fix at the source rather than where the error appears.

How do I fix flaky tests caused by timing issues?▼

Replace arbitrary setTimeout or sleep delays 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, which eliminates race conditions and typically speeds up test execution.

Should I skip root cause investigation during a production emergency?▼

No. Systematic debugging is faster than guess-and-check thrashing even under time pressure, because random fixes mask symptoms and create new bugs. The process scales to the issue: simple bugs move through the phases quickly.

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

Stop attempting more fixes and question the architecture. Repeated failures where each fix reveals new problems elsewhere indicate a fundamentally wrong pattern, so discuss architectural refactoring with your team instead of attempting a fourth fix.

When is it acceptable to use an arbitrary timeout in tests?▼

Only when testing actual timing behavior like debounce intervals, and only after first waiting for the triggering condition. The timeout must be based on known timing rather than guessing, with a comment documenting why it is needed.