From flashduty-assistant
This skill should be used when the user asks to "postmortem", "事后分析", "error budget", "错误预算", "SLO", "SLI", "toil", "琐事", "reliability", "可靠性", "blameless", "无责备", or discusses SRE best practices and service reliability (SRE 最佳实践和服务可靠性).
How this skill is triggered — by the user, by Claude, or both
Slash command
/flashduty-assistant:sre-practicesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
本技能覆盖错误预算、无责备事后分析、琐事分析和可靠性改进,基于 Google SRE 的做法。
本技能覆盖错误预算、无责备事后分析、琐事分析和可靠性改进,基于 Google SRE 的做法。
本技能采用 Reviewer + Generator 组合模式:通过多个 Sub-Agent(postmortem-generator、error-budget-tracker、toil-analyzer)分别执行分析和报告生成,结果汇总后形成综合 SRE 报告。
flashduty-postmortem-generator用于:生成无责备事后分析报告
何时调用:
参数:
{
"incident_id": "FD123456",
"include_timeline": true,
"include_metrics": true,
"include_similar_incidents": true,
"time_range": "30d"
}
功能:
list_similar_incidents 查找相似历史事件query_changes 关联事件前后的部署/变更flashduty-error-budget-tracker用于:追踪 SLO 合规性和错误预算消耗
何时调用:
参数:
{
"service": "service-name",
"slo_target": 99.9,
"slo_type": "availability",
"time_range": "30d",
"channel_ids": []
}
功能:
flashduty-toil-analyzer用于:识别自动化机会和减少运营琐事
何时调用:
参数:
{
"time_range": "30d",
"channel_ids": [],
"analysis_type": "incident_response" | "alert_noise" | "manual_tasks"
}
功能:
用户:生成事件 FD123456 的事后分析报告
→ 步骤 1:验证前提
使用 mcp__flashduty__get_incident 获取事件详情,确认事件已关闭
→ 步骤 2:启动 Agent
启动 flashduty-postmortem-generator
参数:{ incident_id, include_similar: true }
Agent 内部使用 `list_similar_incidents` 查找相似事件,使用 `query_changes` 关联部署变更
→ 步骤 3:解析结果
展示结构化事后分析
包括:时间线、5 Whys、行动项、经验教训
→ 步骤 4:后续建议
向事件添加评论,附上事后分析链接
用户:查看支付服务的错误预算
→ 步骤 1:验证前提
使用 mcp__flashduty__list_channels 识别服务频道,查询 "payment"
→ 步骤 2:启动 Agent
启动 flashduty-error-budget-tracker
参数:{
service: "payment-service",
slo_target: 99.95,
time_range: "30d"
}
→ 步骤 3:解析结果
展示预算状态
包括:消耗百分比、燃烧率、建议
→ 步骤 4:后续建议
"✅ 安全发布" 或 "⚠️ 冻结功能"
用户:对比所有核心服务的 SLO 达成情况
→ 步骤 1:验证前提
使用 mcp__flashduty__list_channels 获取所有关键频道
→ 步骤 2:启动 Agent
为每个服务并行启动 error-budget-tracker
Sub-Agent 1:flashduty-error-budget-tracker(api-gateway, 99.99%, time_range: "30d")
Sub-Agent 2:flashduty-error-budget-tracker(payment-service, 99.95%, time_range: "30d")
Sub-Agent 3:flashduty-error-budget-tracker(user-service, 99.9%, time_range: "30d")
→ 步骤 3:解析结果
汇总结果到仪表板
展示:所有服务、预算、燃烧率、状态
→ 步骤 4:后续建议
高亮显示消耗 > 50% 预算的服务,识别有风险的服务
用户:分析我们团队的琐事工作量
→ 步骤 1:验证前提
确认分析范围:最近 30 天,团队的频道
→ 步骤 2:启动 Agent
启动 flashduty-toil-analyzer
参数:{ time_range: "30d", analysis_type: "all" }
→ 步骤 3:解析结果
展示琐事报告
包括:琐事评分、分类、自动化机会
→ 步骤 4:后续建议
确定自动化路线图优先级:速胜 → 中期 → 长期
用户:这周可以发布新版本吗?
→ 步骤 1:验证前提
检查受影响服务的错误预算
为每个服务启动 flashduty-error-budget-tracker
→ 步骤 2:启动 Agent
启动 flashduty-toil-analyzer 进行稳定性评估,检查近期事件率
→ 步骤 3:解析结果
汇总所有服务预算剩余量和 toil_score 数据
→ 步骤 4:后续建议
如果所有预算 > 50% 剩余 且 toil_score < 5:
→ "✅ 可安全发布,使用标准金丝雀"
否则如果预算 20-50% 或 toil_score 5-7:
→ "⚠️ 减少发布范围,延长金丝雀"
否则:
→ "🛑 建议延迟,专注于稳定性"
用户:生成本月 SRE 运营报告
→ 步骤 1:验证前提
确认报告周期(time_range: "30d")和目标服务范围
→ 步骤 2:启动 Agent
并行启动:
Sub-Agent 1:flashduty-error-budget-tracker(所有服务,time_range: "30d")
Sub-Agent 2:flashduty-toil-analyzer(运营效率,time_range: "30d")
Sub-Agent 3:flashduty-stats-collector(MTTR/MTTA 趋势,time_range: "30d")
→ 步骤 3:解析结果
汇总成综合报告:
## 月度 SRE 报告
- 可靠性:各服务 SLO 合规性
- 效率:琐事减少进展
- 性能:MTTR/MTTA 趋势
→ 步骤 4:后续建议
- 行动项:下月优先事项
分析事件时,始终考虑四个黄金信号:
事后分析和分析 Agent 应尽可能提取这些信息。
| 服务类型 | 典型 SLO |
|---|---|
| API 网关 | 99.99% 可用性,p99 < 200ms |
| Web 应用 | 99.9% 可用性,p99 < 500ms |
| 批处理 | 99.5% 成功率 |
| 内部工具 | 99% 可用性 |
## 错误预算策略:[服务]
### SLO
- 可用性:99.9%
- 错误预算:43.2 分钟/月
### 预算消耗行动
- 0-50%:正常运营,常规发布
- 50-75%:减少发布频率,延长金丝雀
- 75-100%:功能冻结,仅稳定性修复
- >100%:紧急程序,全员响应
### 升级
- >50%:通知团队负责人
- >75%:通知工程经理
- >100%:分配事件指挥官
### 审查
每周:预算状态审查
每月:SLO 合规报告
每季度:SLO 目标审查
| 用例 | 主要技能 | 支持 Agent |
|---|---|---|
| 诊断事件 | incident-diagnosis | diagnosis-engine |
| 生成事后分析 | sre-practices | flashduty-postmortem-generator |
| 追踪可靠性 | sre-practices | flashduty-error-budget-tracker |
| 减少琐事 | sre-practices | flashduty-toil-analyzer |
| 查询事件 | incident-management | incident-analyzer |
| 查找值班 | team-collaboration | team-resolver |
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.