AGENT SKILL

SLO 架构设计与审查

slo-architect

在定义、评审或运维 SLO/SLI/错误预算时使用。当用户提及“定义 SLO”“我们的 SLO 应该是多少”“错误预算”“燃烧率”“SLI”“服务级别目标”“Google SRE 工作手册”“多窗口燃烧率告警”或任何可靠性目标相关问题时触发。提供 SLO 设计器、带多窗口燃烧率阈值的错误预算计算器,以及能发现常见问题的 SLO 审查器(目标过于激进、窗口过短、SLO 相互冲突、缺少 SLI 定义)。包含 4 篇参考文档,涵盖 SLO 原则 + SLI 设计 + 错误预算计算 + 与 feature-flags-architect/chaos-engineering/kubernetes-operator 的组合使用。并非通用可观测性技能——专攻 SLO 这一领域。

适用职业SRE 工程师
License 许可
MIT
最近更新
2026-10-28
Stars
★ 0
Forks
0

01 前言 Front Matter

name
slo-architect
tags
[ "slo", "sli", "sla", "error-budget", "burn-rate", "sre", "reliability", "google-sre-workbook", "observability" ]
author
claude-code-skills
context
fork
license
MIT
version
2.9.0
description
Use when defining, reviewing, or operating SLOs/SLIs/error budgets. Triggers on "define an SLO", "what should our SLO be", "error budget", "burn rate", "SLI", "service level objective", "Google SRE workbook", "multi-window burn-rate alert", or any reliability-target question. Ships SLO designer, error-budget calculator with multi-window burn-rate thresholds, and SLO reviewer that catches the common bugs (target too aggressive, window too short, conflicting SLOs, no SLI definition). 4 references on SLO principles + SLI design + error budget math + composition with feature-flags-architect/chaos-engineering/kubernetes-operator. NOT a generic observability skill — specifically the SLO discipline.
compatible_tools
[ "claude-code", "codex-cli", "cursor", "antigravity", "opencode", "gemini-cli" ]

02 资源文件 10

03 SKILL.md 正文

SLO Architect

Define SLOs that mean something. Most "SLOs" in the wild are arbitrary numbers no one believes — 99.9% on every endpoint, no SLI definition, no error budget, no policy for what happens when budget burns. This skill enforces the discipline from Google's SRE Workbook: pick the right SLI, set a target users actually care about, calculate the error budget, wire multi-window burn-rate alerts, and have a written policy for when budget runs out.

When to use

  • Defining a new SLO for a service or feature
  • Reviewing existing SLOs for common bugs
  • Picking the right SLI (event-based vs time-window based vs request-based)
  • Computing error budgets and burn-rate alert thresholds
  • Tying SLOs to existing controls — feature flags abort, chaos blast radius, operator capability levels

When NOT to use

  • General observability strategy (metrics + logs + traces) → use observability-designer
  • Customer-facing SLAs with legal teeth → that's contract drafting, not engineering
  • Performance load testing (capacity, not reliability) → use performance-profiler
  • Active incident response → use incident-response

Core principle: an SLO is a promise about user experience

SLI  ⟶  measurable signal of user-perceived health (e.g., HTTP 2xx rate)
SLO  ⟶  target for the SLI over a window (e.g., 99.9% over 30 days)
SLA  ⟶  customer-facing commitment with consequences (separate concern)
EB   ⟶  error budget: 100% − SLO target = how much "bad" you can spend
BR   ⟶  burn rate: how fast you're consuming the error budget

The four cardinal mistakes:

  1. Target too high (99.99%+ on services that can't support it) — every minor blip violates SLO; alerts become noise.
  2. Wrong SLI (CPU usage as proxy for user experience) — system can be "green" while users suffer.
  3. No error budget policy — burning budget means nothing if there's no agreed action.
  4. Single-window burn-rate alert — either too noisy (page on a 5-min spike) or too slow (notice budget exhausted after the fact).

The 3 tools below catch each of these.

Quick start

SKILL=engineering/slo-architect/skills/slo-architect

# 1. Design an SLO
python "$SKILL/scripts/slo_designer.py" \
  --service checkout-svc \
  --sli-type request-success-rate \
  --target 99.9 \
  --window-days 30

# 2. Compute error budget + multi-window burn-rate alerts
python "$SKILL/scripts/error_budget_calculator.py" \
  --target 99.9 --window-days 30

# 3. Review existing SLO definitions for common bugs
python "$SKILL/scripts/slo_review.py" --slo-doc docs/slos/

The 3 Python tools

All stdlib-only.

slo_designer.py

Generates a structured SLO definition with required fields. Refuses to render if any required field is missing (exit 1).

python scripts/slo_designer.py \
  --service checkout-svc \
  --sli-type request-success-rate \
  --target 99.9 \
  --window-days 30 \
  --owner team-checkout

SLI types supported:

  • request-success-rate — (total_requests - bad_requests) / total_requests
  • request-latency — count(requests < threshold) / total_requests
  • availability-time — (window - downtime) / window
  • data-freshness — count(data_age < threshold) / total_data_points
  • correctness — count(correct_outputs) / total_outputs

Output is markdown by default with all required fields filled or marked <must define>. JSON output (--format json) is consumed by slo_review.py.

error_budget_calculator.py

Given target availability + window, computes:

  • Allowed downtime in the window
  • Multi-window burn-rate thresholds per Google SRE Workbook (Chapter 5):
    • Fast burn — page if 2% of monthly budget consumed in 1 hour
    • Slow burn — page if 10% consumed in 6 hours, ticket if 10% in 3 days
  • Recommended alerting rules (PromQL-shaped output)
python scripts/error_budget_calculator.py --target 99.9 --window-days 30
python scripts/error_budget_calculator.py --target 99.95 --window-days 7 --format json

slo_review.py

Audits a directory of SLO definitions (markdown or JSON) for the common bugs.

python scripts/slo_review.py --slo-doc docs/slos/

Checks:

  • target_too_high: target ≥ 99.99% (sustainable only with massive engineering investment)
  • target_too_low: target ≤ 99.0% (probably wrong SLI; users will notice)
  • window_too_short: window < 7 days (statistical noise dominates)
  • window_too_long: window > 90 days (slow feedback)
  • no_sli_definition: SLI section missing or vague ("everything OK")
  • no_error_budget_policy: no documented action when budget burns
  • cpu_as_sli: CPU/memory used as user-experience proxy (wrong signal)

SLI selection cheatsheet

User experience SLI type What you measure
"Did the request succeed?" request-success-rate 2xx / total
"Was the response fast?" request-latency count(p99 < threshold) / total
"Was the service up?" availability-time (window - downtime) / window
"Is the data current?" data-freshness count(data_age < threshold) / total
"Was the answer correct?" correctness count(correct) / total

See references/sli_design.md for examples and anti-patterns.

Error budget math (the basics)

For 99.9% SLO over 30 days:

  • Allowed unavailability: 0.1% × 30 × 24 × 60 = 43.2 minutes
  • 1-hour fast-burn threshold (2% of monthly budget burned): 2% × 43.2 / 60 ≈ 1.44 ratio multiplier
  • 6-hour slow-burn threshold (10% in 6h): 10% × 43.2 / 360 ≈ 0.6 ratio multiplier

error_budget_calculator.py does this math for you and emits ready-to-paste alert rules.

Composition with the rest of the portfolio

This skill explicitly composes with three others:

Skill Composition
feature-flags-architect Rollout abort criteria reference SLO burn-rate thresholds
chaos-engineering Blast-radius calculator already takes monthly error budget as input — define it here
kubernetes-operator Operator capability L4 (Deep Insights) requires SLOs + Prometheus rules

The error_budget_calculator.py output is in the same shape engineering/skills/chaos-engineering/scripts/blast_radius_calculator.py expects on stdin.

Workflows

Workflow 1: Define a new SLO

1. Pick the user journey to protect (e.g., "checkout completion").
2. Choose SLI type (request-success-rate, latency, availability, freshness, correctness).
3. Define the SLI precisely: numerator/denominator with concrete labels.
4. Pick a target by measuring 30 days of historical SLI value:
     target = floor(p50 of last 30 days × 100) / 100
   This avoids targets the system has never sustained.
5. Pick a window (28 days = 4 calendar weeks, recommended).
6. Run slo_designer.py to render the SLO definition.
7. Run error_budget_calculator.py to get burn-rate alerts.
8. Write the error budget policy (what happens when budget burns).
9. Run slo_review.py — must pass before the SLO is "live".

Workflow 2: Quarterly SLO review

1. For every active SLO, run slo_review.py — fix any FAIL findings.
2. Look at last quarter's data:
   - Was the SLO too easy (never burned budget)? Tighten target.
   - Was it too hard (frequently burned)? Loosen target OR fix the system.
   - Did burn-rate alerts fire usefully (not too noisy, not too late)? Adjust thresholds.
3. Audit error budget policies — were they actually followed when budget burned?
4. Commit revised SLOs; archive old versions with date stamps.

Workflow 3: SLO-driven rollback

1. New deploy starts burning error budget faster than baseline.
2. Burn-rate alert fires (from error_budget_calculator.py thresholds).
3. Auto-rollback via feature flag (kill switch from feature-flags-architect).
4. Postmortem feeds into next SLO revision.

References

  • references/slo_principles.md — SLI vs SLO vs SLA, Google SRE Workbook canon
  • references/sli_design.md — picking the right SLI; 5 types with examples
  • references/error_budget.md — error budget math, burn-rate alerts, budget policy
  • references/composition.md — how SLOs feed feature flags, chaos, operators

Slash command

/slo-design — interactive SLO design wizard that runs all 3 tools.

Asset templates

  • assets/slo_template.yaml — fillable SLO YAML
  • assets/error_budget_policy.md — fillable policy template

Anti-patterns

  • 99.99% on every endpoint — copy-paste SLOs that nobody verified the system can sustain
  • CPU usage as SLI — system metrics aren't user experience
  • Single-window burn-rate alert — too noisy if 5-min, too slow if 30-day
  • No error budget policy — burning budget means nothing without an action
  • SLOs without owners — no one is responsible; they bit-rot
  • SLOs reviewed once a year — system characteristics change faster than that
  • SLAs in the SLO doc — different audience, different stakes; keep them separate
  • SLO target = SLA target — SLO must be tighter (you should beat your contract before customers notice)

Verifiable success

A team using this skill should achieve:

  • 100% of SLOs pass slo_review.py with 0 FAIL findings
  • Every SLO has a documented owner, error budget, burn-rate alerts, and policy
  • Burn-rate alerts fire ≤2 times/month per SLO that's hit (signal, not noise)
  • Mean time to detect SLO violation: <30 min (multi-window burn-rate alerts working)
  • Quarterly SLO review happens every quarter (not annually)

04 同仓库更多 Skills

mne20114-hash
mne20114-hash/gest35bi

课程大纲阅读清单生成

syllabus

使用 Consensus 学术搜索从任意课程大纲生成精选的补充阅读清单。在任何搜索运行之前,进行'拷问式'信息收集(syllabus 输入格式 + 课程受众 + 年份范围)以及分组强制选项检查点——以确保阅读清单匹配课程的层次和时效性需求。解析大纲以提取主题和学习成果,针对每个主题在 Consensus 中搜索近期同行评审论文,并生成专业排版的 .docx 文档,包含可点击的 Consensus 链接、按受众层次校准的通俗语言摘要,以及与课程学习目标关联的布鲁姆(Bloom)高阶层次讨论问题。当用户上传课程大纲、课程概要或课程文档并希望获得补充阅读材料时使用(例如'create a reading list from this syllabus'、'find recent papers for my course')——即使是附带大纲的随意提及也应触发此技能。

教师学习引导
★ 0
mne20114-hash
mne20114-hash/gest35bi

话题动态多源调研

pulse

多源近期研究技能,可在可配置的近期时间窗口(默认 30 天)内,跨 Reddit、Hacker News、开放网络以及可选的 X/Twitter 把握任意话题的动态。强制信息收集(intake)会在搜索前明确话题的具体性、角度(趋势/情绪/问题/机会/对比)、时间窗口和平台范围。返回一份综合简报,包含引用来源、互动指标和跨平台模式分析。当用户请求对某话题进行多源近期情报调研时使用(例如'pulse on [topic]'、'what's happening with [topic]'、'what are people saying about [topic]'、'current conversation about [topic]'、'take the pulse of [topic]'、'trending: [topic]'、'find me info on [topic]'),也适用于竞品研究、趋势发现、工具对比和受众情绪分析。

营销专员网页搜索与信息研究
★ 0
mne20114-hash
mne20114-hash/gest35bi

专利现有技术检索分析

patent

专利现有技术检索与专利景观情报技能——并非通用专利助手。在任何检索运行之前,通过强制问询确定五种子用例之一(新颖性检索 / 自由实施 FTO / 竞争景观 / 收购尽调 / 诉讼现有技术)。检索 Google Patents、Espacenet、USPTO,并可选检索 Lens.org 以获取引文图谱信号。输出为可编辑的 Word 文档(.docx),包含结论、按相关度排序的最接近现有技术(附提取的权利要求文本)、考虑 CPC 分类的景观分析、经家族解析的命中结果、地域覆盖、适用时的 FTO 标记、策略建议以及完整审计日志。当用户要求进行专利检索或分析时使用(例如“针对 [invention] 的现有技术检索”“针对 [product] 的自由实施分析”)。产出的是检索信号而非法律建议——在提交申请或许可决策前始终建议咨询专利律师。商标、版权和商业秘密问题不在范围内。

法务专员网页搜索与信息研究
★ 0
mne20114-hash
mne20114-hash/gest35bi

NotebookLM 笔记本自动化管理

notebooklm

用于控制 Google NotebookLM 的浏览器自动化技能。当用户希望在 NotebookLM 中完成任何操作时使用(例如“打开 NotebookLM”“查看我的 [name] 笔记本”“向我的笔记本询问 X”“将 [source] 添加到 NotebookLM”“从我的笔记本生成视频概览”“使用 NotebookLM Studio”)。可处理读取与查询笔记本、添加来源(URL、文本、文件、YouTube 链接、合成内容)、生成 Studio 输出(音频/视频概览、思维导图、报告,包括简报文档/学习指南/FAQ、抽认卡、测验、幻灯片、信息图——需从实时 Studio 面板发现确切的输出集合;其 UI 迭代很快),以及创建新笔记本。需要浏览器自动化环境——不可用时优雅降级。

知识工作者浏览器自动化与网页交互
★ 0
mne20114-hash
mne20114-hash/gest35bi

学术文献综述指南

litreview

学术文献导向技能,默认通过免费、无需密钥的API(PubMed E-utilities + OpenAlex)检索论文——连接后可将Consensus MCP作为可选的增强通道——使用PICO(默认)或SPIDER / Decomposition / hybrid作为后备来构建战略检索计划,并将发现综合成格式化的Word(.docx)研究指南。在侦察性检索(recon search)前进行Grill-me式信息收集(研究问题的具体程度+框架提示+初步深度);在Phase 2之后设置第二个强制检查点,先确认框架+子领域+深度,再让检索消耗预算。可配置的深度(5/10/20次查询)用于控制覆盖面与速度。输出是一个'起点'(launching pad)——让研究者能自信地深入展开的方向性指南,而非已完成的综述。当用户开始文献导向的研究时使用(例如'litreview on [topic]'、'literature review on [topic]'、'I'm starting a literature review on X'、'I'm writing a paper on X'、'help me research X'、'I'm doing research on X'、'can you help me research X')。不要用于只想快速获得列表的单个一次性论文检索——那属于普通的PubMed/OpenAlex(或Consensus)查询。

学术研究员科研论文写作
★ 0
mne20114-hash
mne20114-hash/gest35bi

NIH科研基金申请

grants

面向临床研究人员的NIH科研基金申请技能。Grill-me式信息收集(研究想法+职业阶段+初步数据+研究环境+提交姿态+已知的目标研究所)会在任何检索开始前锁定资助策略。运行5个维度的Consensus定位分析(含起草的Significance/Innovation措辞),通过RePORTER将研究映射到合适的NIH研究所(institutes)与研究部门(study sections),查找NOSIs及已获资助的重叠项目,并生成可编辑的Word文档(.docx),包含考虑预算与范围的机制推荐、提交时间线以及必须给出的项目官员(program officer)推荐。当用户询问研究资助或提出任何与基金申请相关的请求时使用(例如'[某主题]的基金'、'为我的研究想法找基金'、'哪些基金与我的研究匹配'、'帮我找NIH资助'、'我研究的基金机会')。仅限NIH范围——非NIH资助方(PCORI、DOD CDMRP、VA、基金会)不在范围内,并会在信息收集(intake)时予以提示。

生物医学研究员科研基金申请撰写
★ 0