safe-rollout
Design a safe progressive rollout — flags, canary/blue-green, ring stages, SLO health gates, automated rollback, kill switch. Rollout mechanics, not env promotion or A/B experiments.
- License 许可
- MIT
- 最近更新
- 2026-10-29
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- safe-rollout
- description
- Design a safe progressive rollout — flags, canary/blue-green, ring stages, SLO health gates, automated rollback, kill switch. Rollout mechanics, not env promotion or A/B experiments.
03 SKILL.md 正文
safe-rollout
Ship change to users gradually, watch the signals that matter, and make rollback the default reflex — not a heroic incident response.
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
- A change is risky enough that an all-at-once deploy is unwise: large blast radius, new infra, irreversible data path.
- The user asks how to roll out behind a flag, do a canary, or stage a percentage rollout safely.
- A workflow invokes
polymath-release:safe-rollout.
This designs rollout mechanics. It is not promoting a build across environments (polymath-devops:env-promotion), running an A/B experiment to learn (polymath-data:run-experiment / the experimentToGA workflow), or defining the SLO itself (polymath-sre:slo-design — consume it here).
Inputs
- The change and its blast radius (who/what breaks if it's wrong).
- Reversibility: is it flag-toggleable, or does it touch data/schema?
- The SLIs/SLOs that define "healthy" for the affected journey. Absent: run
polymath-sre:slo-designfirst, or propose gate thresholds marked[VERIFY: SLO]— never a gate without a number. - Designing the rollout never executes it: flag flips, traffic shifts, and deploys are shown as commands for the operator and run only on their explicit go-ahead.
Procedure
- Choose the technique by reversibility and infra:
- Feature flag — app-level, instant off; the default for code-path changes.
- Canary / ring — route a small % (or internal ring) to the new version; widen on health.
- Blue-green — full standby environment; instant cutover + cutback. Use for infra/runtime swaps.
- Stage the ramp — e.g. internal → 1% → 5% → 25% → 100%, with a bake time per stage.
- Define health gates — the SLIs and thresholds that must hold to advance; tie to
polymath-sre:slo-design. Breach = halt + auto-rollback, not a page-and-wait. - Automate rollback — flag-off / route-back / redeploy-previous; state the trigger and the expected time-to-safe.
- Kill switch — a single, tested control that disables the change instantly, independent of the deploy pipeline.
- Data/irreversibility — for schema/data changes, pair with expand/contract migration; a flag cannot roll back a destructive write.
- Slug from the change name: a workflow's
${workflow.slug}wins; otherwise lowercase it, replace each run of characters outsidea-z0-9with-, trim-at the ends, and cut to ≤ 60 characters at a-. An existing file at the target path is updated in place (show the diff), never duplicated. - Write
docs/rollouts/<slug>.md.
Output
docs/rollouts/<slug>.md, in this shape:
Rollout: checkout-v2 technique: canary (new service) + feature flag `checkout_v2`
Stages (advance only when every gate holds for the full bake):
internal (staff) bake 24h
1% bake 2h
5% bake 4h
25% bake 24h (covers a daily peak)
100%
Health gates (vs. the control cohort, from slo-design):
checkout success rate ≥ 99.5% · p95 latency ≤ 800 ms · payment-provider 5xx ≤ 0.2%
Rollback (automatic): any gate breached for 5 consecutive minutes → route 100% back to v1; time-to-safe ≤ 2 min
Kill switch: flag `checkout_v2` off — independent of the deploy pipeline; tested in staging on 2026-10-20
Irreversible: order-table write path is expand/contract — v2 writes both columns until the contract phase
Operator commands (run on explicit go-ahead only): <flag / traffic-shift commands per stage>
Quality bar
- Every stage has an explicit advance criterion (a metric + threshold), not "looks fine".
- Rollback is automated and its trigger is a measured signal, not human judgment alone.
- A kill switch exists and is independent of a full redeploy.
- Irreversible (data) changes are called out and not hidden behind a flag that can't actually undo them.
Anti-patterns
- "Canary" that is one box for five minutes with no health gate (theater).
- Flag with no kill switch or no removal plan (flags become permanent tech debt).
- Rollback that requires a manual redeploy under incident pressure.
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).