Token导航 LogoToken导航TokenDH.com
研究检索权限需确认github未标认证来源可访问clear审计通过

root-cause-tracing根本原因追踪

Agent Skill

root-cause-tracing 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

9,911

周安装

382

GitHub Stars

39

下载量

2,925
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:root-cause-tracing(根本原因追踪)
来源仓库:https://github.com/bobmatnyc/claude-mpm-skills
仓库路径:skills/root-cause-tracing
安装命令:
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill 'Root Cause Tracing'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill 'Root Cause Tracing'

简介

root-cause-tracing 用于穿透表象错误,定位原始触发点。

  • 典型应用包括 git init 路径错误、文件创建位置偏差等问题。
  • 强调修复源头而非症状,防止问题复发。
  • 常与其他调试技能联用,在深层调用栈场景中效果显著。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

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.

This skill is a specialized technique within the systematic-debugging workflow, typically applied during Phase 1 (Root Cause Investigation) when dealing with deep call stacks.

When to Use This Skill

Use root-cause-tracing 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
  • Symptom appears far from actual cause

Relationship with systematic-debugging:

  • systematic-debugging: The overall framework (Phases 1-4)
  • root-cause-tracing: A specific technique for Phase 1 investigation
  • Use root-cause-tracing WITHIN systematic-debugging Phase 1

The Iron Law

NEVER FIX JUST WHERE THE ERROR APPEARS
ALWAYS TRACE BACK TO FIND THE ORIGINAL TRIGGER

Fixing symptoms creates bandaid solutions that mask root problems.

Core Principles

  1. Trace Backward: Follow call chain from symptom to source
  2. Find Original Trigger: Identify where bad data/state originated
  3. Fix at Source: Address root cause, not symptom
  4. Defense-in-Depth: Add validation at each layer after fixing source

Quick Start

The 5-Step Trace Process

  1. Observe the Symptom: What error message? What failed operation?
  2. Find Immediate Cause: What code directly causes this error?
  3. Ask What Called This: Trace one level up the call stack
  4. Keep Tracing Up: Continue until you find the original trigger
  5. Fix at Source + Defense: Fix root cause and add layer validation

Decision Tree

Error appears deep in stack?
  → Yes: Start tracing backward
    → Can identify caller? → Trace one level up → Repeat
    → Cannot identify caller? → Add instrumentation (see advanced-techniques.md)
  → No: May not need tracing (error at entry point)

The Tracing Process

Example: Git init in wrong directory

Error symptom → execFileAsync('git', ['init'], { cwd: '' })
  ← WorktreeManager.createSessionWorktree(projectDir='')
  ← Session.create() → Project.create() → Test code
  ← ROOT CAUSE: setupCoreTest() returns { tempDir: '' } before beforeEach

At each level ask: Where did this value come from? Is this the origin?

For detailed tracing methodology, see Tracing Techniques For complete real-world examples, see Examples

After Finding Root Cause

Fix at source (throw if accessed before initialization) + Add defense-in-depth (validate at Project.create, WorkspaceManager, environment guards, instrumentation).

This prevents similar bugs and catches issues earlier.

Navigation

For detailed information:

  • Tracing Techniques: Complete tracing methodology, patterns, and decision trees
  • Examples: Real-world debugging scenarios with full trace chains
  • Advanced Techniques: Stack traces, instrumentation, test pollution detection
  • Integration: How to use with systematic-debugging and other skills

Key Reminders

  • NEVER fix just where the error appears
  • ALWAYS trace back to find the original trigger
  • Use console.error() for debugging in tests (logger may be suppressed)
  • Log BEFORE the dangerous operation, not after it fails
  • Include context: directory, cwd, environment, timestamps
  • Add defense-in-depth after fixing source
  • Document your trace as you go (write down the call chain)

Red Flags - STOP

STOP when thinking:

  • "I'll just add validation here" (without finding source)
  • "This will prevent the error" (symptom fix)
  • "Too hard to trace back" (add instrumentation instead)
  • "Quick fix for now" (creates technical debt)

ALL of these mean: Continue tracing to find root cause.

Integration with Other Skills

  • systematic-debugging: Use root-cause-tracing during Phase 1
  • defense-in-depth: Add after finding root cause
  • verification-before-completion: Verify fix worked at source
  • test-driven-development: Write test for root cause, not symptom

See Integration for complete workflow examples.

Real-World Impact

From debugging session (2025-10-03):

  • Found root cause through 5-level trace
  • Fixed at source (getter validation)
  • Added 4 layers of defense
  • 1847 tests passed, zero pollution
  • Time saved: 3+ hours vs symptom-fix approach

Bottom line: Tracing takes 15-30 minutes. Symptom fixes take hours of whack-a-mole.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

25.86%
按下载量换算756

Gemini CLI

22.17%
按下载量换算648

windsurf

18.26%
按下载量换算534

Antigravity

13.13%
按下载量换算384

OpenCode

6.64%
按下载量换算194

Codex

3.51%
按下载量换算103

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源字段存在多来源差异,先按来源优先级自动处理,无法消解时进入异常复核队列。

来源信息

继续浏览同类 Skills