What problem does it solve?
Bugs often manifest deep in the call stack, leading to symptom-based fixes that don't address the original problem. This skill provides a systematic method to trace bugs backward through the execution chain, identifying the true source of invalid data or incorrect behavior for a permanent fix.
Core Features & Use Cases
- Backward Tracing: Systematically traces the call stack from the error symptom back to the original trigger.
- Instrumentation for Evidence: Guides you to add diagnostic logging and stack traces to pinpoint the exact origin of bad values.
- Polluter Identification: Includes a bisection script to efficiently find which test or code block introduces unwanted state.
- Use Case: If
git init fails in an unexpected directory, this skill helps you trace back through the cwd parameter's origin, revealing an empty string passed from a test setup, allowing you to fix the root cause.
Quick Start
1. Observe the Symptom: (e.g., Error: git init failed in /wrong/dir)
2. Find Immediate Cause: Identify the code directly causing the error.
3. Ask: What Called This? Trace up the call stack.
4. Keep Tracing Up: Identify the problematic value and its origin.
5. Find Original Trigger: Locate where the bad value was first introduced.
To find which test causes pollution:
./find-polluter.sh '.git' 'src/**/*.test.ts'