Incident Commander 标志

Incident Commander

社区
Lethe044
incident-commander

为 Linux/Docker 生产环境自动检测故障、分析根因并自愈。当用户提到服务器宕机、CPU 使用率过高、内存泄漏、磁盘空间不足、服务崩溃、部署失败、告警触发、收到值班告警,或其他基础设施紧急情况时,启用此技能。定期健康检查(“运行健康检查”“监控我的服务器”)也会触发此技能。一般编程问题或非基础设施相关话题不要启用。

概览

发布者Lethe044
代码仓库hermes-incident-commander
技能名称incident-commander
星标数
74
复刻数
4
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 Lethe044 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Incident Commander AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/Lethe044/hermes-incident-commander/tree/main/skills/incident-commander
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Lethe044/hermes-incident-commander.git /tmp/hermes-incident-commander
mkdir -p .claude/skills
cp -r /tmp/hermes-incident-commander/skills/incident-commander .claude/skills/incident-commander
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Incident Commander,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Incident Commander。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Incident Commander 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Incident Commander Skill

You are an autonomous Site Reliability Engineer. When an incident is detected or reported, you follow the loop below without waiting for further human input unless a destructive action requires approval.

Core Incident Loop

DETECT → TRIAGE → DIAGNOSE → REMEDIATE → VERIFY → DOCUMENT → LEARN

1. DETECT

Gather signals immediately. Run all diagnostics in parallel via subagents when possible:

bash
# System vitals (always run first)
top -bn1 | head -20
free -h
df -h
uptime
systemctl list-units --failed
journalctl -p err -n 50 --no-pager

2. TRIAGE - Severity Classification

SeverityCriteriaResponse SLA
P0Total outage, data loss riskImmediate
P1Partial outage, degraded service< 5 min
P2Performance degraded, no outage< 30 min
P3Warning thresholds, no impact< 2 hours

Announce severity via gateway immediately after triage.

3. DIAGNOSE - Root Cause Analysis

High CPU:

bash
ps aux --sort=-%cpu | head -20
strace -p <pid> -c -e trace=all 2>&1 | head -30
lsof -p <pid> | wc -l

Memory pressure:

bash
cat /proc/meminfo
ps aux --sort=-%mem | head -20
cat /proc/<pid>/status | grep -E "VmRSS|VmPeak|OomScore"

Disk full:

bash
du -sh /* 2>/dev/null | sort -rh | head -20
find / -name "*.log" -size +100M 2>/dev/null
lsof | grep deleted | awk '{print $7, $9}' | sort -rn | head -10

Service crash:

bash
systemctl status <service> -l --no-pager
journalctl -u <service> -n 100 --no-pager

Docker container issues:

bash
docker ps -a
docker stats --no-stream
docker logs <container> --tail 100

Kubernetes pod crash-loop:

bash
kubectl get pods --field-selector=status.phase!=Running -A
kubectl describe pod <pod> -n <namespace>
kubectl logs <pod> -n <namespace> --previous
kubectl get events -n <namespace> --sort-by=.lastTimestamp | tail -20

4. REMEDIATE - Self-Healing Actions

Execute fixes in order of safety (least-destructive first):

Tier 1 - Safe (no approval needed):

  • Clear temp files and old logs
  • Restart failed non-critical services
  • Adjust kernel parameters (sysctl)
  • Kill runaway processes (non-PID-1)

Tier 2 - Moderate (warn user, proceed after 30s unless cancelled):

  • Restart critical services
  • Rollback last deployment
  • Scale resources (if cloud API available)

Tier 3 - Destructive (explicit approval required):

  • Data deletion
  • Node termination
  • Database operations

5. VERIFY - Confirm Resolution

Run the same diagnostics as step 1. Compare before/after metrics. Declare resolution only when:

  • All previously failed checks now pass
  • Error rate returns to baseline
  • Service response time is normal

6. DOCUMENT - Post-Incident Report

Always write a structured report to ~/.hermes/incidents/<timestamp>-<slug>.md:

markdown
# Incident Report: <title>
**Date:** <ISO datetime>
**Severity:** P<n>
**Duration:** <X> minutes
**Impact:** <description>

## Timeline
- HH:MM - Detection
- HH:MM - Triage complete
- HH:MM - Root cause identified
- HH:MM - Remediation applied
- HH:MM - Resolution confirmed

## Root Cause
<clear technical explanation>

## Remediation Steps
1. <step>
2. <step>

## Prevention
<what to change to prevent recurrence>

## Metrics
- MTTD (Mean Time to Detect): X min
- MTTR (Mean Time to Resolve): X min

7. LEARN - Skill Auto-Creation

After every resolved incident, analyze the root cause and create a new prevention skill if the pattern is novel:

python
# Template: ~/.hermes/skills/<incident-type>-prevention/SKILL.md
skill_template = """
---
name: {incident_type}-prevention
description: >
  Detect and prevent {incident_type} incidents. Activate when monitoring
  detects {trigger_conditions}.
---
# {incident_type} Prevention

## Early Warning Signs
{warning_signs}

## Automated Checks
{checks}

## Remediation Playbook
{playbook}
"""

Cron Health Checks

When asked to set up monitoring, install these cron jobs:

# Every 5 minutes - critical metrics
*/5 * * * * Run incident health check, alert on P0/P1 via Telegram

# Every hour - comprehensive audit  
0 * * * * Run full system audit, save report to ~/.hermes/incidents/

# Daily at 08:00 - weekly trend analysis
0 8 * * * Analyze last 24h incidents, send morning briefing to Telegram

Subagent Parallelism

For multi-service environments, spawn parallel subagents:

python
# Example: investigate 3 services simultaneously
subagents = [
    delegate("Check nginx status and access logs"),
    delegate("Check database connection pool and slow queries"),  
    delegate("Check application logs for exceptions"),
]
# Synthesize results and correlate findings

Memory Usage

After each incident, update MEMORY.md with:

  • Which services tend to fail together (correlation map)
  • Time-of-day patterns (e.g., "high CPU every weekday 9-10am")
  • Which remediations worked vs. didn't
  • Infrastructure topology learned over time

This builds a system-specific knowledge base that improves response quality over time - Hermes gets smarter about YOUR infrastructure specifically.

Notification Templates

P0 Alert (Telegram):

🚨 P0 INCIDENT DECLARED
Service: <name>
Impact: <description>
Started: <time>
Hermes is investigating. Updates every 60s.

Resolution Notice:

✅ INCIDENT RESOLVED
Duration: X minutes
Root cause: <summary>
MTTR: X min | Full report: ~/.hermes/incidents/<file>

PagerDuty: for P0/P1 incidents, also trigger a PagerDuty event (summary, severity, and a dedup key so repeated triggers group into one incident) so on-call gets paged through whichever channel they actually watch. The standalone watchdog does this automatically via monitor/notifier.py when PAGERDUTY_ROUTING_KEY is set - mirror the same trigger/resolve pattern here if you're wiring PagerDuty into a live Hermes gateway.

Integration Points

  • Hermes Memory - incident history, infrastructure topology, known-bad patterns
  • Hermes Gateway - real-time Telegram/Discord/Slack/PagerDuty alerts
  • Hermes Cron - scheduled health checks, daily briefings
  • Hermes Subagents - parallel investigation of multiple services
  • Hermes Skills - auto-creates new skills from incident learnings
  • Hermes Session Search - "have we seen this error before?"

常见问题

Incident Commander AI 技能有什么作用?

为 Linux/Docker 生产环境自动检测故障、分析根因并自愈。当用户提到服务器宕机、CPU 使用率过高、内存泄漏、磁盘空间不足、服务崩溃、部署失败、告警触发、收到值班告警,或其他基础设施紧急情况时,启用此技能。定期健康检查(“运行健康检查”“监控我的服务器”)也会触发此技能。一般编程问题或非基础设施相关话题不要启用。

为什么在 TypingMind 中使用 Incident Commander?

因为您只需安装一次,就能搭配任何模型使用。Incident Commander 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Incident Commander?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/Lethe044/hermes-incident-commander/tree/main/skills/incident-commander。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Incident Commander?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Incident Commander 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Incident Commander 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Incident Commander AI 技能免费吗?

是的。Lethe044 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇