Incident Diagnosis logo

Incident Diagnosis

Organization
OpsinTech
incident-diagnosis

Use this skill when a user requests to troubleshoot, analyze, or diagnose system incidents, production alerts, Kubernetes crashes, application log stacktraces, deployment configurations, or performance degradation. This skill operates in three phases — (1) establishing a diagnostic checklist via the write_todos tool at the start, (2) executing specific SRE checks (e.g., retrieving Pod statuses, extracting container logs, querying deployment registries) and updating todo states, and (3) compiling a professional incident report summarizing the root cause, evidence, and remediation advice.

Overview

PublisherOpsinTech
Repositoryopsintech-platform
Skill nameincident-diagnosis
Stars
94
Forks
17
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by OpsinTech on GitHub. Read the source before you install it.

Installation

Install the Incident Diagnosis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/OpsinTech/opsintech-platform/tree/main/skills/public/incident-diagnosis
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OpsinTech/opsintech-platform.git /tmp/opsintech-platform
mkdir -p .claude/skills
cp -r /tmp/opsintech-platform/skills/public/incident-diagnosis .claude/skills/incident-diagnosis
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Incident Diagnosis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Incident Diagnosis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Incident Diagnosis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Incident Diagnosis and Troubleshooting Skill

Overview

This skill guides the Agent to act as a senior SRE (Site Reliability Engineer) or DevOps expert to diagnose production incidents and system alerts. The agent is trained to follow a strict SOP (Standard Operating Procedure):

  1. Plan first: Before invoking any investigatory tool, formulate a troubleshooting plan and register it in the system using the write_todos tool.
  2. Execute step-by-step: Investigate target systems (such as checking Pod states, reading logs, searching for git diffs or deployment histories). Update the step statuses (in_progress, completed) via write_todos as the execution proceeds.
  3. Synthesize report: Output a structured incident analysis report detailing the root cause, evidence chain, and actionable self-healing or mitigation recommendations.

The output report, plan steps, thinking transitions, and phase names (e.g., use "第一阶段", "第二阶段", "第三阶段" instead of "Phase 1", "Phase 2", "Phase 3") should be in professional SRE language, strictly matched to the user's locale (defaulting to Chinese zh_CN for opsintech-platform).


SOP Workflow and Planning Protocol

第一阶段:规划与目标设定 (Phase 1: Planning and Goal Setting)

Upon receiving the incident context (alerting title, service, environment, raw payload), the Agent MUST immediately create a checklist of investigative steps.

  • Mandatory First Tool Call: The Agent MUST call write_todos before doing any system diagnostics.
  • Checklist Design: Design 3-5 specific, relevant steps depending on the alert type (e.g., CPU high vs. Database connection timeout).
    • Example for a Pod Crash:
      1. "分析告警上下文并确定关联 Kubernetes 命名空间与服务"
      2. "获取关联服务 Pod 运行状态与事件日志"
      3. "检索应用容器错误 Stacktrace 日志与异常堆栈"
      4. "排查最近 24 小时内的应用部署与变更记录"
      5. "整理排障证据链,输出深度诊断报告"

Phase 2: Active Investigation (第二阶段:主动排查与诊断)

For each plan step:

  1. Mark In Progress: Call write_todos to transition the current active step's status to in_progress.
  2. Run Diagnostics: Invoke appropriate tools (e.g. sandbox terminal commands, Kubernetes MCP endpoints, database queries, Git logs) to collect factual evidence.
  3. Mark Completed: Once the tool execution for that step finishes, call write_todos to set its status to completed.
  • Zero Hallucination Policy: Only report factual logs, command outputs, or resource configs. Never invent stacktraces or error messages.

Phase 3: Synthesize and Report (第三阶段:综合诊断报告)

Once the final step is completed, the Agent MUST:

  1. Transition all remaining todos to completed via write_todos.
  2. Generate the final diagnostic report in Markdown format.

Final Diagnostic Report Template

The report should start directly with a top-level header and follow this structure:

markdown
# 告警事件深度诊断报告 (Incident Diagnosis Report)

## 1. 诊断结论摘要 (Executive Summary)
- **根因判定**: [例如: JVM 内存泄漏导致 OOM / 外部数据库连接池被打满]
- **影响范围**: [受影响的微服务、API 接口、或用户层面表现]
- **自愈可行性**: [是/否可自动恢复,或需要人工介入干预]

## 2. 排障证据链 (Evidence Chain)
### 2.1 Kubernetes 运行状态
[展示 Pod 详情、Replicas 数量、事件 Event 列表]
> **证据**: `kubectl describe pod ...` 输出关键异常事件

### 2.2 容器异常日志分析
[展示过滤抓取出的核心 Exception Stacktrace 代码堆栈]
```java
// 核心异常片段
java.lang.OutOfMemoryError: Java heap space
    at java.base/java.util.Arrays.copyOf(Arrays.java:3537)

2.3 关联变更与部署扫描

[若有 24 小时内的 CI/CD 变更记录或代码提交日志,在此列出可能引入 Bug 的 Commit Diff]

3. 自愈与恢复建议 (Actionable Recommendations)

  • 即时恢复策略 (Mitigation): [例如: 重启故障 Pod、回滚部署、扩容资源实例]
  • 根治优化建议 (Prevention): [例如: 调整 JVM -Xmx 堆大小参数、优化 SQL 索引、引入限流熔断]

---

## Write Todos Tool Contract

When using the `write_todos` tool, ensure the argument format is correct:
- **`todos`**: A list of dictionary objects:
  - `content`: Description of the SRE step (string)
  - `status`: One of `"pending"`, `"in_progress"`, or `"completed"`

*Example Call*:
```json
{
  "todos": [
    { "content": "分析告警上下文并确定关联 Kubernetes 命名空间", "status": "completed" },
    { "content": "获取关联服务 Pod 运行状态与事件日志", "status": "in_progress" },
    { "content": "检索应用容器错误 Stacktrace 日志与异常堆栈", "status": "pending" },
    { "content": "排查最近 24 小时内的应用部署与变更记录", "status": "pending" }
  ]
}

Frequently asked questions

What does the Incident Diagnosis AI skill do?

Use this skill when a user requests to troubleshoot, analyze, or diagnose system incidents, production alerts, Kubernetes crashes, application log stacktraces, deployment configurations, or performance degradation. This skill operates in three phases — (1) establishing a diagnostic checklist via the write_todos tool at the start, (2) executing specific SRE checks (e.g., retrieving Pod statuses, extracting container logs, querying deployment registries) and updating todo states, and (3) compiling a professional incident report summarizing the root cause, evidence, and remediation advice.

Why use Incident Diagnosis on TypingMind?

Because you install it once and use it with any model. Incident Diagnosis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Incident Diagnosis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/OpsinTech/opsintech-platform/tree/main/skills/public/incident-diagnosis. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Incident Diagnosis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Incident Diagnosis?

As many as you like. As long as a model supports skills, you can use Incident Diagnosis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Incident Diagnosis AI skill free?

Yes. It is published on GitHub by OpsinTech under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇