root-cause-tracing
Systematically trace bugs backward through call stack to find original trigger. Use when errors occur deep in execution and you need to trace back to find the original trigger.
Profile →npx skills add majiayu000/claude-skill-registry --skill root-cause-tracing-secondsky-claude-skills-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Root Cause Tracing ## Overview Bugs often manifest deep in the call stack (git init in wrong directory, file created in wrong location, database opened with wrong path). Your instinct is to fix where the error appears, but that's treating a symptom. **Core principle:** Trace backward through the call chain until you find the original trigger, then fix at the source. ## When to Use **Use when:** - Error happens deep in execution (not at entry point) - Stack trace shows long call chain - Unclear where invalid data originated - Need to find which test/code triggers the problem ## The Tracing Process ### 1. Observe the Symptom ``` Error: git init failed in ~/project/packages/core ``` ### 2. Find Immediate Cause **What code directly causes this?** ```typescript await execFileAsync('git', ['init'], { cwd: projectDir }); ``` ### 3. Ask: What Called This? ```typescript WorktreeManager.createSessionWorktree(projectDir, sessionId) → called by Session.initializeWorkspace() → called by Session.create() → called by test at Project.create() ``` ### 4. Keep Tracing Up **What value was passed?** - `projectDir = ''` (empty string!) - Empty string as `cwd` resolves to `process.cwd()` - That's the
- Overview
- When to Use
- The Tracing Process
- 1. Observe the Symptom
- 2. Find Immediate Cause
- 3. Ask: What Called This?
- 4. Keep Tracing Up
- 5. Find Original Trigger
- Adding Stack Traces
- Finding Which Test Causes Pollution
- Real Example: Empty projectDir
- Key Principle
- Stack Trace Tips
- Real-World Impact
bun test 2>&1 | grep 'DEBUG git init' bun test --run --bail 2>&1 | tee test-output.log
What does the root-cause-tracing skill do?
Systematically trace bugs backward through call stack to find original trigger. Use when errors occur deep in execution and you need to trace back to find the original trigger.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill root-cause-tracing-secondsky-claude-skills-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.