root-cause-tracing

Trace backward through call chains to locate original bug triggers in code and tests.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/withmartian-sandbox/ghrc-x-3126672651424eddb640ecc81321a665 --skill root-cause-tracing-withmartian-sandbox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: root-cause-tracing
Source: https://github.com/withmartian-sandbox/ghrc-x-3126672651424eddb640ecc81321a665/tree/main/default/skills/root-cause-tracing
Command: npx skills add https://github.com/withmartian-sandbox/ghrc-x-3126672651424eddb640ecc81321a665 --skill root-cause-tracing-withmartian-sandbox

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Trace bugs that manifest deep in the call stack to find the original trigger rather than treating symptoms at the error site. This prevents incorrect fixes, test pollution, and recurring failures by locating and remediating the true source of invalid data or side effects.

Core Features & Use Cases

  • Backward Call-Chain Tracing: Systematically walk the call stack from the failing operation back to the initial trigger to identify where invalid state or arguments originated.
  • Instrumentation Guidance: Recommend targeted logging and stack capture (for example, log cwd, arguments, and stack frames before risky operations) so tests and runtime runs reveal provenance information.
  • Test Bisection Support: Use targeted test bisection to find polluting tests that create unexpected files or state during test runs.
  • Use Case: When a test causes a repository or file to appear in the source tree, use this Skill to trace the chain from the failing operation to the test that accessed or initialized shared state prematurely.

Quick Start

Trace the failing git init error backward through the call chain, identify the original trigger, and list the minimal instrumentation and validation checks to add.

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 runtime error back to its original trigger in the call chain?

To trace a runtime error, systematically walk backward through the call stack from the failing operation to locate the initial trigger. This identifies where invalid state or arguments originated, preventing symptom-level fixes.

What is the best way to find polluting tests that cause unexpected files or state during CI runs?

The best way to find polluting tests is using test bisection. This targeted approach isolates the specific test that prematurely accessed or initialized shared state, revealing the origin of unexpected files or side effects.

How do I fix deep-stack data origin errors without treating the symptoms at the error site?

To fix deep-stack data origin errors, trace backward through the call chain to locate the original bug trigger. This method targets the true source of invalid data, preventing incorrect fixes and recurring failures.

What instrumentation should I add to capture stack traces and context for debugging?

Add targeted logging and stack capture instrumentation before risky operations. Log the current working directory, arguments, and stack frames to reveal provenance information and clarify unclear data origins during tests.

When should I use test bisection instead of standard stack trace analysis for debugging?

Use test bisection instead of standard stack trace analysis when debugging test pollution scenarios. Bisection specifically isolates tests that create unexpected files or shared state during CI runs, whereas stack traces show call sequence errors.

Why does my test cause a repository or file to appear in the source tree during a test run?

This happens when a test accesses or initializes shared state prematurely, creating unexpected files. Trace the failing operation backward through the call chain to identify the exact test trigger and add minimal validation checks.