alert-optimizer

alert-optimizer:用于重构并优化监控平台(如 Sentry、PagerDuty、Datadog、OpsGenie)中的告警规则。适用于减少告警噪音、解决告警疲劳、创建告警规则、设置升级策略、调整阈值或编写值班手册,且可生成针对各平台的告警配置与分层升级策略。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
7

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "alert-optimizer":https://skillpi.com/zh/skills/deepskill-e39bc527d25e5da6275b56e629ed888e0223c6933d87975a9d4b1b9f264cbf48。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

alert-optimizer:用于重构并优化监控平台(如 Sentry、PagerDuty、Datadog、OpsGenie)中的告警规则。适用于减少告警噪音、解决告警疲劳、创建告警规则、设置升级策略、调整阈值或编写值班手册,且可生成针对各平台的告警配置与分层升级策略。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: alert-optimizer
description: >-
  Restructure and optimize alert rules for monitoring platforms (Sentry, PagerDuty, Datadog, OpsGenie).
  Use when someone asks to "reduce alert noise", "fix alert fatigue", "create alert rules",
  "set up escalation policies", "tune alerting thresholds", or "create on-call runbooks".
  Generates platform-specific alert configurations and tiered escalation policies.
license: Apache-2.0
compatibility: "Generates configurations for Sentry, PagerDuty, Datadog, OpsGenie, or generic webhook-based systems"
metadata:
  author: terminal-skills
  version: "1.0.0"
  category: devops
  tags: ["alerting", "on-call", "pagerduty", "incident-response", "observability"]

Alert Optimizer

Overview

This skill takes error analysis data (ideally from the error-monitoring skill) and generates optimized alert rules, severity tiers, escalation policies, and on-call runbooks. It turns a noisy alerting setup into a structured incident response system.

Instructions

1. Understand Current State

Ask for or infer:

  • Current monitoring platform (Sentry, Datadog, PagerDuty, etc.)
  • Current alert volume and on-call team size
  • Notification channels available (Slack, PagerDuty, email, SMS)
  • Any existing severity definitions

2. Define Severity Tiers

Create a three-tier model (unless the user specifies otherwise):

Tier Criteria Response Time Channel
P1 - Critical Revenue impact, data loss, security breach, >50% users affected Immediate page PagerDuty/SMS
P2 - Warning Degraded experience, >5% users affected, error rate spike 1 hour Slack channel
P3 - Info Known issues, cosmetic errors, self-healing transients Weekly review Log only

3. Generate Alert Rules

For each error group, produce a platform-specific alert configuration:

  • Sentry: JSON alert rule with conditions, filters, and actions
  • Datadog: Monitor definition with query, thresholds, and notification targets
  • PagerDuty: Event rules with severity mapping and escalation policy
  • Generic: Webhook payload template with routing logic

4. Create Escalation Policies

Define who gets notified and when:

  • P1: On-call engineer immediately → team lead after 10 min → engineering manager after 30 min
  • P2: Post to team Slack channel → on-call acknowledges within 1 hour
  • P3: Aggregated weekly digest

5. Generate Runbooks

For each P1 alert, create a runbook with:

  • What: One-sentence description of the alert
  • Why it matters: Business impact
  • Diagnose: First 3 steps to investigate
  • Fix: Common resolutions
  • Escalate: When and to whom

Examples

Example 1: Sentry Alert Rules

Input: Error audit showing PaymentProcessingError as P1, RedisTimeout as P3.

Output:

{
  "rules": [
    {
      "name": "P1: Payment Processing Failure",
      "conditions": [
        {"id": "sentry.rules.conditions.event_frequency", "value": 1, "interval": "5m"}
      ],
      "filters": [
        {"id": "sentry.rules.filters.tagged_event", "key": "error_type", "value": "PaymentProcessingError"}
      ],
      "actions": [
        {"id": "sentry.integrations.pagerduty.notify_action", "service": "engineering-oncall"},
        {"id": "sentry.integrations.slack.notify_action", "channel": "#incidents", "tags": "environment,transaction"}
      ],
      "frequency": 5
    },
    {
      "name": "P3: Redis Connection Timeout (Log Only)",
      "conditions": [
        {"id": "sentry.rules.conditions.event_frequency", "value": 100, "interval": "1h"}
      ],
      "filters": [
        {"id": "sentry.rules.filters.tagged_event", "key": "error_type", "value": "TimeoutError"}
      ],
      "actions": [],
      "frequency": 1440
    }
  ]
}

Example 2: On-Call Runbook Entry

Input: P1 alert for database deadlocks.

Output:

## RUNBOOK: Database Deadlock Detected

**Alert**: DatabaseError: deadlock detected in order processing
**Severity**: P1 — Revenue impact, orders fail silently
**Response**: Immediate — acknowledge within 5 minutes

### Diagnose
1. Check current DB connections: `SELECT * FROM pg_stat_activity WHERE state = 'active' ORDER BY query_start;`
2. Identify locked queries: `SELECT * FROM pg_locks WHERE NOT granted;`
3. Check if deployment happened in last 30 min (new query pattern?)

### Common Fixes
- Kill the blocking query: `SELECT pg_terminate_backend(<pid>);`
- If recurring post-deploy: rollback last migration
- If load-related: enable connection pooling or add read replica

### Escalate
- If not resolved in 15 min → page team lead
- If data corruption suspected → page engineering manager + DB admin

Guidelines

  • Always deduplicate alert rules — one root cause should trigger one alert, not five
  • Set reasonable frequency caps: P1 alerts should re-fire every 5 minutes max, P3 should be daily at most
  • Include "auto-resolve" rules where appropriate (e.g., error rate drops below threshold)
  • Runbooks should be copy-pasteable — include actual commands, not pseudocode
  • When the user has fewer than 3 people on-call, simplify escalation to two tiers
  • Test configurations by asking the user to dry-run before applying

当前收录版本

1.0.0

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 解决 DevOps/SRE 实际痛点:告警噪音、告警疲劳、规则优化、升级策略、值班手册
触发精准95/100

亮点

  • 触发词精准完整,覆盖多种变体,边界清晰
结构规范90/100

待提升项

  • 缺少 When to Use 章节 原报告严重程度:轻微

    文档结构完整,但缺少独立的 When to Use 章节,建议补充以增强可读性。

    改进建议:建议在 Overview 后增加 When to Use 章节,明确说明适用场景。

亮点

  • Phase/步骤清晰,有出口条件,含端到端示例,frontmatter完整
执行可靠85/100

亮点

  • 工具来源明确,参数正确,覆盖主要异常,建议 dry-run 测试
证据可验 (前四项均值)89/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。