error-budget-policy
Author an error-budget policy — what happens when budget is healthy, eroding, or exhausted; named consequences not vibes.
- License 许可
- MIT
- 最近更新
- 2026-10-29
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- error-budget-policy
- description
- Author an error-budget policy — what happens when budget is healthy, eroding, or exhausted; named consequences not vibes.
03 SKILL.md 正文
error-budget-policy
Pin the actions tied to error-budget state. Output is a one-page policy a team can point to.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
When to use
- An SLO exists but the team doesn't know what to do when budget gets thin.
- Leadership wants reliability work to compete fairly with feature work.
- A workflow includes a release gate keyed to the error-budget state.
Inputs
- The SLO (required): target, window, and SLI — from
polymath-sre:slo-design. No SLO: stop and run that first; a policy over an undefined budget is not a policy. - Budget consumed so far (optional): bad minutes, or failed/total requests, for the current window. Present: classify the current state with the script below.
- The approver role for exceptions (required) — ask; unattended run: write
[TBD: approver role]and list it in the summary, never invent a person.
Procedure
-
Current state (when consumption data exists) — run the script, don't eyeball it:
python3 "${POLYMATH_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/skills/slo-design/scripts/error-budget.py" --slo 99.5 --window-days 28 --consumed-minutes 140 # request-based SLI: --requests 2000000 --failed 7300Quote its
Consumed:andState:lines in the policy header. -
Three states:
- Healthy — budget consumed < 50% of allowance for the window.
- Eroding — 50–100% consumed.
- Exhausted — over budget; service has missed its SLO.
-
Per state, name the consequence:
- Healthy: feature work proceeds as usual.
- Eroding: required reliability work in addition to features; no risky launches; new feature flags must be rollable.
- Exhausted: feature freeze. The team works only on reliability and rollback hardening until budget is back to healthy. Exceptions require a named approver and a documented reason.
-
Document the named approver (a role, e.g. "VP Eng", not a person).
-
Document the off-ramp — how the team gets out of an exhausted state. Usually: SLO compliance for 14 consecutive days, or a budget reset following a major incident postmortem.
-
SLO trust — once a quarter, review whether the SLO threshold still matches user expectations. Don't move the threshold to fit the budget; either accept the work or renegotiate the threshold with stakeholders.
Output
Error-budget policy: refund-service (SLO: 99.5% / 28d)
State: HEALTHY (< 50% of the 3h 21m 36s budget used)
- Feature work proceeds as planned.
- Standard release cadence.
State: ERODING (50–100% of budget used)
- Mandatory: every PR includes a reliability or test improvement.
- No "risky" launches (defined: schema changes, dependency upgrades,
new external integrations).
- Feature flags required for new features; must be rollable < 1m.
- Daily 5-min standup on burn-rate.
State: EXHAUSTED (> 100% of budget used)
- Feature freeze. Reliability and rollback hardening only.
- Exceptions require VP Eng sign-off; reason recorded.
- Resume normal work after 14 consecutive days of compliant SLO.
Quarterly review:
- Does the 99.5% threshold still match what users need?
- Is the SLI definition still right (latency cutoff, success codes)?
Anti-pattern guard:
We do not move the SLO threshold to "fit" the consumed budget.
If the SLO is genuinely wrong, we renegotiate with stakeholders
in writing, not via a config tweak.
Anti-patterns to avoid
- "When budget is low, we'll be careful" — not a policy.
- Allowing exceptions without an approver or paper trail.
- Lowering the SLO threshold to keep budget healthy. That's not reliability work.
04 同仓库更多 Skills
runbook
Write or refresh an operational runbook for an alert/symptom; structured as TL;DR + Pre-checks + Steps + Verification + Rollback + Escalation.
rfc
Draft a lightweight design RFC to docs/rfcs/<slug>.md; Summary, Motivation, Detailed design, Drawbacks, Alternatives, Unresolved questions. A proposal to debate, not a recorded decision (adr).
editorial-pass
Review and tighten prose in a Markdown artifact for a target tone (terse, formal, friendly) without dropping information; preserve quotations and load-bearing constraints.
architecture-review-facilitation
Run an architecture review as a process — entry criteria, reviewer checklist, decision log, and follow-up actions — pairing the design artifact with a red-team pass.
architecture-doc
Write a C4-style architecture document; System Context + Containers (+ Components when interesting) with mermaid diagrams. Describes structure, not a decision (adr) or proposal (rfc).
adr
Write an Architecture Decision Record (Michael Nygard format) to docs/adrs/NNNN-<slug>.md; frontmatter validated by the ADR artifact schema. Records a made decision, not a proposal to debate (rfc).