kaizen:root-cause-tracing

Trace runtime errors backward through call-chain analysis to original triggers.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/luicabref97/sushi-jungle-web --skill kaizen-root-cause-tracing-luicabref97
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kaizen:root-cause-tracing
Source: https://github.com/luicabref97/sushi-jungle-web/tree/main/.agents/skills/kaizen-root-cause-tracing
Command: npx skills add https://github.com/luicabref97/sushi-jungle-web --skill kaizen-root-cause-tracing-luicabref97

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When errors surface deep in execution, symptoms are often fixed instead of the original cause; this Skill guides you to systematically trace backward through call chains, identify the first invalid input or state, and remediate at the source to prevent recurrence.

Core Features & Use Cases

  • Systematic backward tracing through call chains to locate the original trigger of a runtime error.
  • Instrumentation patterns and tips for tests, including pre-operation logging of directory, environment, and stack to reveal which test or code path produced pollution.
  • Defense-in-depth recommendations: input validation at layers, NODE_ENV guards, and pre-call stack logging to both prevent and rapidly diagnose regressions.
  • Use case: find which test created a repository in the source tree by tracing an empty cwd through session creation, adding a pre-git-init stack log, and then fixing the failing initializer.

Quick Start

Add a pre-operation console.error that logs the directory, process.cwd(), relevant environment variables, and new Error().stack before the failing operation to capture the call chain and identify the originating call.

Frequently Asked Questions about kaizen: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 stack?

Trace runtime errors to their original triggers by performing backward call-chain analysis. Systematically inspect the stack to locate the first invalid input or state that caused the downstream failure, rather than patching the surface symptom.

What is the best way to find which test polluted shared state or created invalid directories?

Find shared state pollution by adding pre-operation instrumentation. Log the directory, process.cwd(), environment variables, and new Error().stack before the failing operation to capture the call chain and identify the polluting test.

How does backward call-chain analysis help fix deep execution errors?

Backward call-chain analysis fixes deep execution errors by tracing from the symptom back to the source. It identifies the original invalid input, allowing you to remediate at the source and prevent recurrence instead of masking symptoms.

Does defense-in-depth prevent regressions when debugging complex call chains?

Defense-in-depth prevents regressions by adding input validation at layers, NODE_ENV guards, and pre-call stack logging. Layered validation and instrumentation rapidly diagnose regressions and stop invalid inputs from propagating deep into execution.

When should I use pre-operation instrumentation for root-cause analysis?

Use pre-operation instrumentation for root-cause analysis when errors appear deep in the call stack or tests pollute shared state. Logging the stack and environment before the failing operation captures the originating call chain to locate invalid inputs.