root-cause-tracing · neolabhq — Claude Code skill: trace bugs to the source
A skill that walks the agent backward through the call stack until it finds the original trigger, then fixes there instead of at the crash site.
npx skills add NeoLabHQ/context-engineering-kit --skill root-cause-tracing -a claude-codeWhat root-cause-tracing does
The bug shows up deep in the stack: git init in the wrong directory, a file in the wrong place, a database opened with a bad path. The skill lays out the order of work. Observe the symptom, find the code that directly caused it, then ask what called that code. Keep going until you reach the value that started it all — an empty string, a stale variable.
When manual tracing stalls, the skill tells you to add instrumentation: new Error().stack before the risky operation, printed with console.error() because a logger may be suppressed in tests. Then run the suite with a grep on your debug tag and read the stacks for file names, line numbers, a repeated parameter. To find which test pollutes shared state, the kit ships find-polluter.sh, which runs tests one by one and stops at the first offender.
Fixing only where the error surfaced leaves the bug alive, because the same bad argument will arrive again. The skill pushes for a fix at the source plus validation at each layer — in the worked example that meant a getter that throws, a directory check, and a guard against git init outside a temp dir. The polluter script is bash, so on Windows it needs WSL.
What it helps with
- find where an empty or corrupted value entered a deep call
- read a long stack trace without patching the symptom
- identify the test that leaves junk in a shared directory
- add tracing before a risky operation when manual tracing dead-ends
- close the source of a bug with checks at several layers
Example prompts for the agent
- This error surfaces deep in the stack — trace the call chain back to the original trigger and fix it there
- Add stack trace logging before git init and show me which test passes an empty projectDir
- Something creates .git in the source folder during tests — find the polluter with find-polluter.sh
How to install root-cause-tracing
1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill root-cause-tracing -a claude-code2Manually: put the files in place
~/.claude/skills/root-cause-tracing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/root-cause-tracing/
1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill root-cause-tracing -a codex2Manually: put the files in place
.agents/skills/root-cause-tracing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill root-cause-tracing -a cursor2Manually: put the files in place
.cursor/skills/root-cause-tracing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install NeoLabHQ/context-engineering-kit root-cause-tracing2Manually: put the files in place
.github/skills/root-cause-tracing/SKILL.md1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill root-cause-tracing -a gemini-cli2Platform CLI
gemini skills install https://github.com/NeoLabHQ/context-engineering-kit --path skills/root-cause-tracingManually: put the files in place
.devin/skills/root-cause-tracing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill root-cause-tracing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about root-cause-tracing
How do I install root-cause-tracing in Claude?
Run npx skills add NeoLabHQ/context-engineering-kit --skill root-cause-tracing -a claude-code. The skill file then sits at ~/.claude/skills/root-cause-tracing/SKILL.md.
What does root-cause-tracing do?
It drives the investigation backward through the call chain to the original trigger and insists the fix lands at the source, not where the error appeared. When manual tracing fails, it suggests what instrumentation to add.
How is it different from ordinary stack-trace debugging?
The skill forbids stopping at the first failure point and asks for validation at each layer so the same bug cannot return. For hunting a polluting test, the kit includes find-polluter.sh.
Similar skills
All skills for Agent setup: memory, context, orchestration →root-cause-tracing by other authors comes first.