root-cause-tracing

Solid

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.

DevOps & Infrastructure 162 stars 25 forks Updated 2 weeks ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
74
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# 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 source code directory! ### 5. Find Original Trigger **Where did empty string come from?** ```typescript const context = setupCoreTest(); // Returns { tempDir: '' } Project.create('name', context.tempDir); // Accessed before beforeEach! ``` ## Adding Stack Traces When you can't tra...

Details

Author
secondsky
Repository
secondsky/claude-skills
Created
6 months ago
Last Updated
2 weeks ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category