12-系统监控和告警

12-系统监控和告警 is a skill for Claude Code, Codex from xcodethink/open-claude-code-skills. It costs 278 tokens per session (2,888 once invoked), scanned A, original, MIT.

A set of standards for monitoring running software and alerting people when something goes wrong. It covers health checks, structured and audit logs, request tracing, performance monitoring, and advanced incident handling.

In plain words
What is it for?
Use it to add health-check endpoints, Lark or Telegram alerts, structured logs, audit logs, request tracing, performance monitoring, incident states, alert escalation, SLO dashboards, scheduled-task delay checks, and monitoring for third-party services.
Why use it?
It reduces the chance that a system fails silently or that alerts become confusing and hard to act on. It also provides ways to track service reliability and manage incidents.

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/xcodethink/open-claude-code-skills/12
Any agent
npx skills add xcodethink/open-claude-code-skills --skill 12
Clone the repo
git clone --depth 1 https://github.com/xcodethink/open-claude-code-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 12-系统监控和告警

README.md
[![agentmods](https://agentmods.dev/badge/skills/xcodethink/open-claude-code-skills/12.svg)](https://agentmods.dev/skills/xcodethink/open-claude-code-skills/12)
Your own site
<a href="https://agentmods.dev/skills/xcodethink/open-claude-code-skills/12"><img src="https://agentmods.dev/badge/skills/xcodethink/open-claude-code-skills/12.svg" alt="Measured on agentmods" height="20"></a>
Per session 278 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,888 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.00278 $0.02888
Opus 5 $0.00139 $0.01444
Sonnet 5 $0.00056 $0.00578
Haiku 4.5 $0.00028 $0.00289

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

Security

Grade A, and why

12-系统监控和告警 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 4d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (incident-management/templates/adminApi.snippet.ts, incident-management/templates/index_routes.snippet.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.

skills/12-系统监控和告警/SKILL.md · 206 lines

How it starts

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

系统监控和告警标准

核心原则:系统出了问题,必须在 1 分钟内通知到人。不允许系统静默故障。


两层架构

这个 skill 提供两层监控能力,按项目阶段递进接入:

Tier 1 — 基础层 (本文件)

所有项目必须接入。最少要做的事:Lark webhook + 健康检查端点 + 结构化日志 + 审计日志。

Tier 2 — 商业级层 (incident-management/)

有付费用户、有 SLA、有 cron 任务的项目必须接入。在 Tier 1 之上提供:

  • 事件状态机(firing → acked → snoozed → resolved)
  • Fingerprint 去重 + N-of-M 跨周期去抖(消除 99% 误报)
  • 3 级自动升级(15min/60min/4h)
  • 自愈 [RESOLVED] 闭环通知(终结"狼来了")
  • 实时 SLO 仪表盘(uptime / MTTR / MTBF)
  • Cron lag 检测(safety net)
  • 第三方 provider 监控
  • Ack / Snooze 工作流(管理员可在 admin Tab 点击操作)

11 个可复制的代码模板 + 完整接入手册 + 经验教训 + 验收清单都在 incident-management/ 子目录。第一次接入耗时 2 小时,熟练后 30 分钟。

何时升级到 Tier 2?

  • 项目已上线生产
  • 有付费用户
  • 依赖 ≥ 3 个第三方 API
  • 有 cron 任务
  • 需要回答客户"你们 uptime 多少"

满足任何一条 → 立即接入 Tier 2,详见 incident-management/INSTALL.md


详细规范(详细规范/

本 SKILL.md 是入口和 Tier 1 基础接入。完整规范在 详细规范/,需要深入时按需读取:

  • 详细规范/监控告警.md — 全链路 4 层监控架构、8 项必监控环节、告警格式模板(Telegram/Lark/WhatsApp)、每日业务报告、健康检查端点(标准版+Prisma 版)、前端 AI 请求兜底、监控实施步骤、Cloudflare 专属监控
  • 详细规范/可观测性规范.md — 可观测性三支柱(Metrics / Logs / Traces)、SLO/SLI 定义、告警分级与降噪、Cloudflare Analytics Engine、结构化日志、分布式追踪
  • 详细规范/事件管理规范.md — 事件严重度定义(P0-P3)、响应 SLA、事件响应流程、沟通模板、事后复盘(5 Whys)、常见事件剧本
  • 详细规范/系统埋点与告警集成标准.md — 埋点分类与标准、告警通道集成代码模板、必须告警的场景、环境变量标准、每日业务报告集成

1. Lark 飞书机器人告警(必须接入)

1.1 架构

应用代码 → AlertService → Lark Webhook → 飞书群消息

1.2 告警级别

级别 颜色 触发条件 示例
[CRITICAL] 红色 系统不可用、数据丢失 数据库连接失败、认证服务崩溃
[ERROR] 橙色 功能异常但系统可用 API 请求 5xx、第三方 API 失败
[WARNING] 黄色 需关注但不紧急 高延迟、API 配额接近上限
[INFO] 蓝色 重要业务事件 用户注册、大批量操作完成

1.3 标准实现

sendAlert(payload) 接受 AlertPayload(level / title / details / project / environment / timestamp / requestId? / userId? / extra?),内部用 LARK_WEBHOOK_URL env 推送 Lark 卡片消息。告警服务本身不能阻断主流程(catch 后只 console.error)。

Read the full file on GitHub · 206 lines

Files

What ships with it

25 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 206 lines · 278 tokens per session scan A d02d5d2360fe

Subscribe to this mod's changes

12-系统监控和告警 is a skill published in the GitHub repository xcodethink/open-claude-code-skills (2 stars, last pushed 29d ago), licensed MIT. It adds 278 tokens to every session and 2,888 once invoked, about $0.0014 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

android-finance-spec

Use when generating, reviewing, or refactoring Android Kotlin code for financial apps that require BigDecimal/String precision, RTL/i18n safety, Kotlin style discipline, and "do not reinvent existing project patterns" constraints.

brycegao/android-finance-spec · 48 tokens

elite-engineer

The operating system for elite software engineering in TypeScript, React, and Next.js. Enforces the cognitive models, architecture laws, type-level patterns, component design, visual standards, and performance mandates that separate exceptional software from the ordinary — grounded in named sources (Torvalds…

Kerim-Sabic/elite-engineer · 167 tokens

rulesync

Generates and syncs AI rule configuration files (.cursorrules, CLAUDE.md, copilot-instructions.md) across 20+ coding tools from a single source. Use when syncing AI rules, running rulesync commands, importing or generating rule files, or managing shared AI coding configurations.

dyoshikawa/rulesync · 64 tokens

JavaScript Tooling

Development tools, linting, and testing for JavaScript projects.

HoangNguyen0403/agent-skills-standard · 18 tokens

loongsuite-pilot-insight

基于 LoongSuite Pilot / AI Coding Agent 日志生成事件洞察、组织洞察、数据质量、研发效能和 AI Native 使用类 SLS 报表时使用;包含 AI Coding 事件表语义,以及团队报表可选的部门维表、deptuser 组织关系、指标口径和公共 CTE,通常与 sls-dashboard-builder 一起使用。.

alibaba/loongsuite-pilot · 91 tokens

alipay-webhooks

Receive and verify Alipay (Antom / Alipay+) webhook notifications. Use when setting up Alipay webhook handlers, debugging RSA256 Signature header verification, or handling payment events like notifyPayment, notifyCapture, notifyRefund, notifyAuthorization, and notifyDispute.

hookdeck/webhook-skills · 58 tokens