root-cause-tracing

Trace errors backward through call stacks to identify original triggers.

Updated Oct 28, 2025
One-click install
npx skills add https://github.com/AlabamaMike/copilot-agents --skill root-cause-tracing-alabamamike
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: root-cause-tracing
Source: https://github.com/AlabamaMike/copilot-agents/tree/main/.codex/superpowers/skills/root-cause-tracing
Command: npx skills add https://github.com/AlabamaMike/copilot-agents --skill root-cause-tracing-alabamamike

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bugs often manifest deep in the call stack, leading developers to fix symptoms rather than the original trigger. This results in recurring issues or new bugs. This skill provides a systematic method to trace errors backward through the call chain, adding instrumentation when needed, to identify the true source of invalid data or incorrect behavior, making bugs structurally impossible.

Core Features & Use Cases

  • Backward Tracing: Systematically traces errors up the call stack to find the original trigger.
  • Instrumentation Guidance: Provides patterns for adding diagnostic logging and stack traces to gather evidence.
  • Polluter Identification: Includes a bisection script to find which specific test or code introduces unwanted state.
  • Use Case: When an error occurs deep in a complex system, use this skill to trace back through the execution flow, pinpointing where the bad data originated and fixing it at the source.

Quick Start

Use the root-cause-tracing skill to find the source of the 'file not found' error occurring in the 'data-processor' module.

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 through the call stack to find where it started?

Root-cause tracing systematically traces errors backward through the call chain by examining stack traces and adding instrumentation to identify the original trigger. Start by capturing the full stack trace at the error point, then work upward through each function call, adding diagnostic logging at key boundaries to pinpoint where invalid data or incorrect behavior first entered the system.

What's the best way to find which test is polluting shared state and causing failures?

Use bisection techniques to isolate the specific test or code introducing unwanted state. Root-cause tracing includes bisection scripts that narrow down which test execution leaves behind pollution affecting subsequent tests, enabling you to fix the isolation issue at its source rather than masking symptoms.

When should I add defensive logging instead of just reading the stack trace?

Add instrumentation when the stack trace alone doesn't explain why data became invalid—especially across module boundaries, incorrect working directories, or test pollution scenarios. Defensive logging captures intermediate values and state transitions that a static stack trace cannot reveal, making the causal path visible.

How do I prevent the same bug from recurring after I think I've fixed it?

Root-cause tracing fixes bugs structurally by identifying the original trigger rather than surface symptoms. Once you've traced to the source and understand why invalid data or incorrect behavior entered the system, you can eliminate the root cause, making recurrence impossible and preventing new related bugs.

Can I use root-cause tracing across multiple services and modules?

Yes, root-cause tracing applies to deep-stack bugs across modules, tests, and services. It requires access to runtime stack traces and a controlled execution context where you can add instrumentation, but it works wherever you can capture the full call chain and correlate behavior across system boundaries.

What environment setup do I need before starting to trace an error?

You need instrumentation capabilities to inject diagnostic logging, access to complete runtime stack traces from your runtime or framework, and a controlled execution context—such as isolated test runs or reproducible scenarios—where you can modify code and observe behavior without affecting production.