root-cause-tracing

Trace errors backward through call stacks to identify original triggers.

4|Updated Dec 7, 2020
One-click install
npx skills add https://github.com/charly3pins/dotfiles --skill root-cause-tracing-charly3pins
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: root-cause-tracing
Source: https://github.com/charly3pins/dotfiles/tree/main/.config/opencode/skills/root-cause-tracing
Command: npx skills add https://github.com/charly3pins/dotfiles --skill root-cause-tracing-charly3pins

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Bugs often manifest deep in the call stack, leading to symptom-based fixes that don't address the original trigger, resulting in recurring or masked issues and wasted debugging time.

Core Features & Use Cases

  • Backward Call Stack Tracing: Systematically traces errors from symptom back to the original source of invalid data or incorrect behavior.
  • Diagnostic Instrumentation: Guides adding stack traces and logging to pinpoint elusive triggers and gather crucial evidence.
  • Polluter Identification: Provides a script (find-polluter.sh) to bisect and identify specific tests that pollute the environment.
  • Use Case: When an error occurs deep in a system (e.g., git init in the wrong directory), use this skill to trace back through the call stack, identify the exact origin of the problem, and fix it at the source.

Quick Start

I have an error occurring deep in the system. Help me trace back through the call stack to find its root cause.

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 root cause when the error occurs deep in the call stack?

Root-cause tracing systematically traces errors backward through the call stack to identify the original trigger rather than treating the symptom. Start by instrumenting your code with stack traces and logging at key points, then work upward through the call chain to find where invalid data or incorrect behavior originated.

What's the best way to find which test is polluting my environment?

Use diagnostic bisection to isolate the polluter test. Root-cause tracing provides a script to systematically narrow down which specific test is creating side effects—such as files in wrong locations or git repositories initialized incorrectly—that cascade into failures elsewhere.

Why does my error appear in one place but originate somewhere completely different?

Errors manifest deep in execution because invalid state propagates through long call chains. Root-cause tracing traces backward from the symptom to identify the actual source—such as a git init in the wrong directory or database opened with an incorrect path—rather than fixing the downstream manifestation.

How do I add instrumentation to capture the context I need for diagnosis?

Root-cause tracing guides pre-operation logging and stack trace capture across multiple layers. Log state and context before operations execute, then use those traces to connect symptoms back to their original trigger in the execution flow.

When should I use root-cause tracing instead of just fixing the error where it appears?

Use root-cause tracing when errors recur, symptoms mask the real problem, or debugging time is wasted chasing downstream effects. It's essential for complex systems with long call chains and test pollution where symptom-based fixes don't prevent future failures.

Can I apply root-cause tracing to errors caused by incorrect file paths or database connections?

Yes. Root-cause tracing handles scenarios like files created in wrong locations or databases opened with incorrect paths by tracing the call stack backward to find where the invalid path or connection string originated, then fixing it at the source.