root-cause-tracing

Trace backward through call chains to identify original triggers of runtime errors.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Whaleylaw/llm-lawyer --skill root-cause-tracing-whaleylaw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: root-cause-tracing
Source: https://github.com/Whaleylaw/llm-lawyer/tree/main/.claude/skills.old/root-cause-tracing
Command: npx skills add https://github.com/Whaleylaw/llm-lawyer --skill root-cause-tracing-whaleylaw

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers and test authors locate the true origin of runtime errors and incorrect data by tracing backward through call chains and adding targeted instrumentation so fixes address the source rather than symptoms.

Core Features & Use Cases

  • Stepwise backward tracing of call chains to identify where invalid inputs or incorrect state originated.
  • Practical instrumentation guidance: capture stacks before dangerous operations, log environment and cwd, and add defensive validations at multiple layers.
  • A test bisection script to isolate polluting tests that create files or state in the repository during test runs.
  • Use Case: When a .git directory is created in the source tree during tests, use stack logging and the bisection script to find the test or initialization that passed an empty directory path.

Quick Start

Describe the observed error and stack trace and ask to trace backward to identify the original trigger and recommend instrumentation and fixes.

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 a complex call chain?

To trace a runtime error, you perform backward call-chain analysis to identify where invalid inputs or state originated. This approach provides stepwise tracing from the symptom back to the source, adding targeted instrumentation to capture the exact trigger.

What is the best way to debug a deep call stack where the symptom appears distant from the source?

Debugging a deep call stack requires stack-capture instrumentation before dangerous operations to record the execution path. By logging the environment and applying defensive validation at multiple layers, you can isolate the original trigger from the distant symptom.

How do I isolate polluting tests that create files or incorrect state during a CI pipeline run?

You isolate polluting tests by executing a test bisection script. This script systematically divides the test suite to pinpoint the specific test or initialization routine that creates repository files or invalid state during the CI run.

Can I use stack logging to find which test created an empty directory path in my source tree?

Yes, you can use stack logging to find which test created an empty directory path. By capturing stacks before file system operations and logging the current working directory, you identify the exact initialization logic passing the invalid path.

When do I need defensive validation recommendations for debugging unit tests?

You need defensive validation recommendations when unit tests fail due to incorrect data propagating through multiple layers. Adding validations at boundaries stops invalid inputs early, ensuring fixes address the source rather than just the surface symptoms.