From flashduty-assistant
This skill should be used when the user asks to "create incident", "acknowledge incident", "resolve incident", "close incident", "snooze incident", "query incidents", "list incidents", "创建事件", "确认事件", "关闭事件", "查询事件", or discusses incident lifecycle operations (事件生命周期管理).
How this skill is triggered — by the user, by Claude, or both
Slash command
/flashduty-assistant:incident-managementThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
本技能管理事件的生命周期。简单操作直接执行;复杂查询委托给 Sub-Agent。
本技能管理事件的生命周期。简单操作直接执行;复杂查询委托给 Sub-Agent。
本技能采用 Pipeline 模式:通过决策树判断操作类型,简单操作直接执行,复杂查询委托给 Sub-Agent。
本技能遵循 SRE 最佳实践:
创建或更新事件时,考虑 SLO 影响:
解决事件后:
用户: "事件已解决,生成事后分析"
→ 步骤 1: 直接解决事件
→ 步骤 2: 委托给 sre-practices 技能
启动: postmortem-generator
→ 步骤 3: 安排行动项
关闭带有根因的事件时:
这些简单操作立即执行:
| 操作 | 工具 | 何时直接使用 |
|---|---|---|
| 创建事件 | mcp__flashduty__create_incident | 用户提供所有必需信息 |
| 确认事件 | mcp__flashduty__ack_incidents | 提供单个或列表 ID |
| 解决事件 | mcp__flashduty__resolve_incidents | 提供 ID,可选根因 |
| 重新打开 | mcp__flashduty__reopen_incidents | 提供 ID |
| 延迟事件 | mcp__flashduty__snooze_incidents | 提供 ID 和时长 |
| 添加评论 | mcp__flashduty__comment_incidents | 提供 ID 和评论内容 |
| 更新事件 | mcp__flashduty__update_incident | 修改标题/描述/严重级别/影响/根因/解决方案 |
| 分配事件 | mcp__flashduty__assign_incident | 指派给特定人员或升级规则 |
flashduty-incident-analyzer用于: 复杂事件查询、过滤、搜索
何时委托:
参数:
{
"filters": { "severity": "...", "progress": "...", "title": "..." },
"time_range": "7d",
"group_by": "severity" | "channel" | "labels.xxx",
"brief": true
}
注意:优先使用
time_range(如'7d'、'24h'、'last_week')而非手动计算start_time/end_time。使用brief: true减少数据量。
用户请求:
├─ 直接操作 (ack/resolve/snooze/comment/update/assign) + 提供 ID
│ └─ 直接使用 MCP 工具执行
│
├─ 创建事件
│ └─ 收集必需字段 → 直接创建
│
├─ 更新事件字段(标题/描述/严重级别/影响/根因/解决方案)
│ └─ 直接使用 update_incident 执行
│
├─ 分配/指派事件
│ └─ 直接使用 assign_incident(type: "assign" + person_ids 或 type: "escalateRule" + escalate_rule_id)
│
├─ 查询/搜索/列出事件
│ └─ 委托给 flashduty-incident-analyzer
│
└─ 混合 (例如 "ack all critical incidents")
└─ 步骤 1: 委托 analyzer 查找匹配项
└─ 步骤 2: 与用户确认
└─ 步骤 3: 直接执行 ack
不适用场景:批量创建 200+ 事件(应使用批处理 API)、纯统计分析(使用 incident-analytics)。
用户: "确认事件 FD123456"
→ 直接调用 mcp__flashduty__ack_incidents
→ 确认完成
用户: "确认今天所有 triggered 状态的事件"
→ 步骤 1: 启动 analyzer 查找匹配事件
filters: { progress: "Triggered" }, time_range: "24h"
→ 步骤 2: 向用户展示列表,确认
→ 步骤 3: 使用列表调用 ack_incidents
用户: "为数据库故障创建一个严重级别的事件"
→ 收集必需信息(标题、严重级别、描述)
→ 直接调用 create_incident
→ 返回事件 ID
用户: "查找本周基础架构 channel 的所有 Critical 事件"
→ 启动 incident-analyzer
filters: { severity: "Critical", channel_name: "基础架构" }
time_range: "7d"
brief: true
→ 展示结果
当用户提到多个不相关的事件时:
用户: "展示事件 A、B 和 C"
→ 并行:
Agent 1: 获取事件 A 详情
Agent 2: 获取事件 B 详情
Agent 3: 获取事件 C 详情
→ 展示合并结果
用户: "列出基础架构和数据库两个 channel 的 triggered 事件"
→ 并行:
Agent 1: 查询基础架构 channel(brief: true)
Agent 2: 查询数据库 channel(brief: true)
→ 合并并展示
[操作] 成功完成。
- 事件: [ID]
- 状态: [新状态]
- [附加详情]
[操作] 已完成 [N] 个事件:
- [ID 1]: 成功
- [ID 2]: 成功
...
找到 [N] 个匹配条件的事件:
| ID | 标题 | 严重级别 | 状态 | Channel |
|----|------|---------|------|---------|
|... |... |... |... |... |
[操作按钮或建议]
start_time < end_time。使用 Unix 秒级时间戳推荐使用 time_range 参数:
# 简单直观,无需计算时间戳
time_range: "24h" # 最近 24 小时
time_range: "7d" # 最近 7 天
time_range: "30d" # 最近 30 天
time_range: "last_day" # 昨天整天
time_range: "last_week" # 上周整周
当需要精确时间范围时,使用 start_time+end_time:
如果查询失败(超出保留期限),逐步缩短时间范围:
npx claudepluginhub futuretea/flashduty-assistant --plugin flashduty-assistantProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.