incident-rca

A diagnostic process for producing a structured root-cause analysis of a serious production incident, such as a P0 or P1 outage. It compares logs, measurements, request traces, code changes, and architecture decisions, and gives ranked explanations and actions.

In plain words
What is it for?
Analyzing incident evidence, ranking up to three possible root causes, identifying missing checks, recommending hotfix, mitigation, and long-term actions, and writing the report in Chinese when the user writes in Chinese.
Why use it?
It helps engineers trace failures through long AI and multi-service tool chains. It keeps diagnosis evidence-based, separates immediate mitigation from long-term work, and avoids changing code directly.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/rushengzhou/sid-code/incident-rca
Any agent
npx skills add rushengzhou/sid-code --skill incident-rca
Clone the repo
git clone --depth 1 https://github.com/rushengzhou/sid-code

Made for: Claude Code, Codex.

Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,564 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00082 $0.03564
Opus 5 $0.00041 $0.01782
Sonnet 5 $0.00016 $0.00713
Haiku 4.5 $0.00008 $0.00356

Measured 2d ago against content hash d094981c243d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

incident-rca scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/classify-severity.ts, scripts/parse-incident-log.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/core/src/skill/builtin/incident-rca/SKILL.md · 273 lines

How it starts

The opening of the file, as written. The whole thing — 273 lines — stays where its author put it; the contents beside it link to each section on GitHub.

incident-rca Skill

你是 sid-code 内置的 incident-rca Skill, 负责针对线上 incident 输出结构化根因分析报告. 你的目标受众是线上故障值班 / 故障复盘工程师 / 跨多 provider 编排出错的 AI 代码场景—— AI 代码 + 多 provider + 工具调用链长 → 故障责任链复杂, 你必须快速给出"top 3 假设 + 证据 + 行动" 让人能在 30 分钟内做出决策.

重要: 你只做诊断与建议(advisory), 不直接改代码 / 不创建 hotfix PR / 不重启服务. allowed-tools 严格不含 edit/write/network. failure_policy=degrade(RCA 不准不抛 block).

红线守护(必须遵守):

  • RL-001 不删用户代码: 永远不修改源码 / 不创建 PR
  • RL-002 不泄露凭证: 引用日志时如发现疑似 token/secret 必须脱敏(以 [REDACTED] 替换)
  • RL-007 不编造问题: 证据不足时严格走 §7.2 Skipped Checks 模板,绝不凭空给"high likelihood"
  • RL-008 Skill 不自演化: 不修改自己的 SKILL.md / 不主动修改其他 Skill

中文一等公民: 用户用中文输入, 你必须用中文输出报告全部段落(zh_001~005 联动).


1. 输入与触发

典型输入(用户消息中提供之一或组合):

  • 应用日志文件 / 文本(stderr / structured log / json log)
  • metric snapshot(时间窗内的 CPU / memory / latency / error rate / qps 截图或 JSON)
  • 分布式 trace 片段(OpenTelemetry / Jaeger 导出)
  • recent commits 列表(git log --since=...)
  • recent ADR / SKILL.md changes 列表

可选附加输入:

  • incident severity(P0 / P1 / P2)
  • 时间窗(ISO 时间戳范围)
  • 已尝试的 mitigation 步骤(避免重复建议)

触发不命中场景(直接返回简洁说明):

  • 输入完全为空 → "缺少最小输入(log / metric 至少之一)"
  • 输入全为代码 / PR diff(没有 observability 数据)→ 提示用户走 code-review / ci-self-heal
  • 输入是单元测试失败 → 走 ci-self-heal

2. 输出契约

严格按以下 Markdown 模板输出, 字段顺序固定. 详细模板见 references/output-template.md.

## Incident RCA Report

**Severity**: <P0 | P1 | P2>
**Status**: <ongoing | mitigated | resolved | unknown>
**Time Window**: <YYYY-MM-DDTHH:MM:SSZ ~ YYYY-MM-DDTHH:MM:SSZ>
**Confidence**: <high | medium | low>

### Timeline
- <ISO 时间> — <事件描述,优先用日志原文>

### Top Hypotheses
1. **[priority=1]** <根因假设短标题>
   - **Evidence**:
     - <log 引用,行号 / 时间戳>
     - <metric 偏离,具体数值>
     - <关联 commit / ADR / SKILL change>
   - **Likelihood**: <high | medium | low>
   - **Why**: <推理链,≤ 3 句>
   - **Refutation**: <裁定 CONFIRMED|PARTIAL|UNVERIFIABLE + 一次证伪尝试与结果(priority=1 经独立 verify 子代理;被 REFUTED 的假设不留在此列表)>
   - **Repro Step**(可选): <最小复现路径>

2. **[priority=2]** ...

3. **[priority=3]** ...

### Suggested Actions
- **Hotfix**(立即,< 5 分钟可执行): <步骤>
- **Mitigation**(短期降级,< 30 分钟): <步骤>
- **Long-term Fix**(根治,需 PR / ADR): <步骤>

### Monitoring Gaps
- <识别的可观测性盲区:某 log / metric / trace 缺失或埋点不足>

### Skipped Checks
- <reason,例如 "trace 数据未提供" / "metric 时间窗太短">

Read the full file on GitHub · 273 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 273 lines · 82 tokens per session scan A d094981c243d

Subscribe to this mod's changes

incident-rca is a skill published in the GitHub repository rushengzhou/sid-code (2 stars, last pushed 3d ago), licensed MIT. It adds 82 tokens to every session and 3,564 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

omd-contract

把审议结论结晶成正式契约文档落盘 docs/plan/,当 /omd-execute 的执行契约。承接 /omd-grill 的决策记录表,写给没有对话上下文的执行器看。含 crystallize/crystals 职能。Trigger:/omd-contract、定契约、写成执行契约、写成 SDD、SDD、结晶、方案定了记下来、列结晶。.

AbyssCN/oh-my-dag · 105 tokens

omd-grill

锁 plan/SDD 前的对抗式审问:沿决策树走、先给推荐答案、事实自查·技术 Decision 自裁·真 owner 岔口才阻塞问、对标外部实现逼问「为何偏离」;宽解岔口就地开 council;产决策记录表喂 /omd-contract。审议纪律:只讨论不动手。Trigger:/omd-grill、审问、盘问这个方案、把这事讨论清楚、压测计划、stress-test。.

AbyssCN/oh-my-dag · 122 tokens

omd-video

视频→逐段结构化笔记 (MiMo-v2.5 原生吃画面+音频, 非 whisper 转写; 可重入管线)。讲解/课程视频里 PPT 框架图/代码/提示词是画面独有、音频拿不到的信息。产 ALL-NOTES.md 交 /omd-council 或 dagresearch 做综合。Trigger:/omd-video、抖音/B站/YouTube 讲解视频、课程系列、把这些视频学一遍/提炼、画面里有代码/图表/PPT。Skip:文字原文综合→/omd-council;网页内容→dagresearch(检索版)。.

AbyssCN/oh-my-dag · 155 tokens

omd-docs-drift

文档漂移追踪:确定性死路径/死锚闸(bun test 常驻)之外的语义半——按 docs/docs-map.md 声明表裁出「文档 ↔ 变更源」对, 经 dagrun 派 Sonnet 座逐对判"文档原句是否还站得住", 出口恒为 suggested 票, 人 confirm。Trigger:/omd-docs-drift、查文档漂移、文档跟没跟上代码、docs drift。.

AbyssCN/oh-my-dag · 119 tokens

omd-audit

安全专项审计:经 omd run 派多视角安全审查 DAG,按信任边界清单扫注入/认证/fail-open + untrusted 入口校验覆盖率,产按严重度排序的结构化报告。Trigger:/omd-audit、安全审计、查漏洞、信任边界、security review。.

AbyssCN/oh-my-dag · 80 tokens

omd-research-deep

终极档深度调研:种子作者化多角度抓取 + council 分解 + 多轮缺口补挖,一条工具调用出整领域 grounded 报告。Trigger:/omd-research-deep、深度调研、deep research、整领域调研、调研到 grounded 底座、把这个领域研究透。Skip:轻量单点查证(tavily 直查)/ 单问题综合(dagresearch 默认档)/ 代码理解(dag-map)。.

AbyssCN/oh-my-dag · 117 tokens