Root Cause Tracing

Trace bugs backward through the call stack to identify the original trigger.

Updated Sep 16, 2023
One-click install
npx skills add https://github.com/paopp2/dotfiles --skill root-cause-tracing-paopp2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Root Cause Tracing
Source: https://github.com/paopp2/dotfiles/tree/main/.claude/skills/debugging/root-cause-tracing
Command: npx skills add https://github.com/paopp2/dotfiles --skill root-cause-tracing-paopp2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solves? This skill helps you efficiently pinpoint the original trigger of bugs that manifest deep in the call stack, preventing superficial fixes and ensuring lasting solutions.

Core Features & Use Cases:

  • Backward Tracing Process: Provides a step-by-step method to trace errors up the call stack from symptom to original trigger.
  • Instrumentation Guidance: Teaches how to add diagnostic logging and stack traces to pinpoint the exact point of failure in complex systems.
  • Pollution Detection: Includes a script (find-polluter.sh) to identify which specific test or code is introducing unwanted state or files.

Quick Start: I have an error deep in the call stack. Use the Root Cause Tracing skill to guide me through the tracing process.

Frequently Asked Questions about Root Cause Tracing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I trace a bug back to its source when the error occurs deep in the call stack?

Root cause tracing involves working backward through the call stack from where the error manifests to identify the original trigger. Use stack-trace instrumentation, contextual logging, and validation checks across layers to observe symptoms and pinpoint the exact failure point rather than fixing symptoms at the surface.

What's the best way to add instrumentation to debug complex, long call chains?

Instrumentation guidance teaches you to add diagnostic logging and stack traces at strategic points in your code. This reveals the exact sequence of calls and state changes leading to failure, making it easier to identify where the root cause originates rather than where it manifests.

How can I identify which test or code is introducing unwanted state or files?

Root cause tracing includes pollution detection through a dedicated script that identifies the specific test or code responsible for introducing unwanted state or files into your system, helping you isolate and fix the actual source of contamination.

Why does fixing symptoms in the error location often fail to prevent recurrence?

Superficial fixes address where an error appears, not where it originates. Root cause tracing ensures lasting solutions by enforcing fixes at the original trigger point, preventing the bug from recurring when conditions change or new code paths are added.

When should I use backward tracing instead of forward debugging?

Backward tracing is essential when errors occur deep in execution with unclear origins during testing or runtime. It's more efficient than forward debugging for complex systems because you start from the known failure point and work backward to the root cause.