root-cause-tracing

Trace deep call stack bugs using backward tracing and instrumentation.

4|1|Updated Jun 7, 2025
One-click install
npx skills add https://github.com/alexanderop/MarkVim --skill root-cause-tracing-alexanderop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: root-cause-tracing
Source: https://github.com/alexanderop/MarkVim/tree/main/.claude/skills/root-cause-tracing
Command: npx skills add https://github.com/alexanderop/MarkVim --skill root-cause-tracing-alexanderop

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you efficiently pinpoint the original trigger of bugs that manifest deep within the call stack, preventing superficial fixes and ensuring lasting solutions. It guides you to trace invalid data or incorrect behavior back to its source.

Core Features & Use Cases

  • Backward Tracing: Systematically guides you through the call chain, asking 'What called this?' until the original trigger is found.
  • Instrumentation Guidance: Advises on adding diagnostic logging and stack traces to uncover hidden data flows and execution paths.
  • Pollution Detection: Provides a script to bisect tests and identify which specific test file causes unwanted side effects or state pollution.
  • Defense-in-Depth: Encourages adding validation at multiple layers to prevent recurrence of the same bug.
  • Use Case: When a test unexpectedly creates a .git directory in the wrong location, use this skill to trace back through the execution flow, identify the exact line of code causing the misconfiguration, and implement a robust fix.

Quick Start

I have an error deep in the call stack, and I suspect an invalid parameter is being passed. Use the root-cause-tracing skill to help me find where the bad value originates.

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 appears deep in the call stack?

Root-cause tracing systematically guides you backward through the call chain, asking 'What called this?' at each level until you identify the original trigger. This approach prevents superficial fixes by finding where invalid data or incorrect behavior actually originates, not where it manifests.

What's the best way to find which test is causing pollution or unwanted side effects?

Use a bisection workflow to isolate the specific test file creating state pollution. Root-cause tracing provides instrumentation guidance and structured steps to identify which test introduces the unwanted behavior, enabling targeted remediation rather than masking symptoms.

How do I instrument my code to uncover hidden data flows when debugging?

Root-cause tracing advises adding diagnostic logging and stack traces at key execution points to reveal how data moves through your system. This instrumentation exposes the execution paths and data transformations that lead to the bug's root cause.

Can I prevent the same bug from happening again after I fix the root cause?

Yes. Root-cause tracing encourages defense-in-depth by adding validation at multiple layers in your call stack. This multi-layer approach stops the same invalid data or behavior at its source and at intermediate checkpoints, ensuring lasting solutions.

When should I use backward tracing instead of just adding more error handling?

Use backward tracing when errors originate from invalid parameters or corrupted state deep in execution, not from recent code changes. Tracing finds the true source and prevents recurring bugs, while error handling alone masks the underlying problem without addressing where bad data entered the system.