跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
数据与分析

ops

Deploys, schema migrations, rollback and infrastructure. Use when "can I ship this on Friday", "this migration is scary", "what is the blast radius", "prevent accidental deletion of the database", or a change drops a column. Covers expand/contract, canary rollout, kill switches, prevent_destroy, tested backups. For an incident that already happened use retro.

rainmanjam · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add rainmanjam/poka-yoke --skill ops

技能说明


name: ops description: >- Deploys, schema migrations, rollback and infrastructure. Use when "can I ship this on Friday", "this migration is scary", "what is the blast radius", "prevent accidental deletion of the database", or a change drops a column. Covers expand/contract, canary rollout, kill switches, prevent_destroy, tested backups. For an incident that already happened use retro.

Poka-Yoke for Deploys and Infrastructure

Operations is where irreversible mistakes concentrate. Code mistakes are usually recoverable, git remembers, a revert ships in twenty minutes. A dropped table, a deleted bucket, a rotated credential, or a terminated stateful node is not recoverable by any amount of engineering after the fact.

So the governing question in this mode is different from the rest of the plugin. Not "can this be done wrong?" but: when this is done wrong, how much is affected, and can it be undone? Those two axes, blast radius and reversibility, determine every device below.

Answer these four first

Before any framework or table, establish these. They are what an operator actually needs, and they are the things most often left out: an answer that skips them is not useful no matter how well organized the rest is. Say each one plainly, in a sentence, before going deeper.

  1. What here is irreversible, and what restores it? Name the specific unrecoverable step: a dropped column, a deleted bucket, a rotated key. Then say what would restore it: a backup, a snapshot, a rebuild. If the answer is "nothing", say so explicitly. An irreversible step with no stated restore path is the single most important thing you can tell someone, and it is the first thing to get lost in a longer answer.
  2. What breaks during the rollout window? Deploys are not atomic. For a period, old code runs against the new state. Say what happens in that window, usually this is the actual outage, not the change itself.
  3. Can the irreversible part ship separately? Most changes are a reversible part and an irreversible part stapled together. Splitting them is nearly always available and nearly always right; say so concretely rather than in general.
  4. If it goes wrong, who is available and how fast is rollback? Timing questions are about staffing and recovery speed, not superstition. A change that reverts in two minutes is fine on a Friday afternoon; one that needs a four-hour restore with two people asleep is not.

Cover all four even when the answer is brief. If you only have room for a little, spend it here rather than on the taxonomy: the rungs below are how to think about the fix, but these four are what the person has to know before they ship.

The blast radius ladder

Most ops poka-yoke is not about preventing the bad change. It is about ensuring the bad change reaches 1% of traffic instead of 100%. You cannot prevent every bad deploy; you can make bad deploys cheap.

RungDeviceWhat it buys
1 ControlThe dangerous operation is impossible in this environment, prevent_destroy on stateful resources, deletion protection on the database, no human write access to prod, immutable infrastructureThe mistake cannot be made at all
1 ControlProgressive rollout with automatic rollback on error-rate: the bad version is withdrawn before most users see itThe mistake is capped and self-healing
2 WarningRequired plan review, a deploy that prints what it will destroy and demands typed confirmation, alerts wired to the rolloutThe mistake is visible at the moment of decision
3 DetectionPost-deploy smoke tests, monitoring, an on-call humanThe mistake is found after users find it
0A runbook step that says "double-check the environment first"Nothing

Reversibility is the highest-leverage property

Before adding any gate, ask whether the operation can be made reversible instead: a reversible operation needs far weaker devices, because the cost of the mistake collapses.

  • Soft delete and retention windows on anything user-facing. S3 versioning plus MFA delete, database point-in-time recovery, trash with a 30-day window.
  • Deletion protection flags on databases, buckets, clusters, and load balancers. These cost nothing and stop the single most expensive class of cloud mistake.
  • Backups that have actually been restored. An untested backup is a belief, not a device, and this is the most common false sense of protection in the industry. Restore drills on a schedule, timed, into a real environment. If nobody has restored it, treat the data as unbacked when you assess blast radius.
  • Immutable artifacts so rolling back means redeploying a known-good image, not rebuilding and hoping the build is reproducible.

Schema migrations: expand and contract

Co-deploying a destructive schema change with the code that depends on it is an outage, not a risk, during the rollout window old code necessarily runs against the new schema.

The pattern, one deploy per step:

  1. Expand: add the new column/table, nullable, with no code depending on it.
  2. Backfill: in batches, resumable, throttled, with progress recorded so a failure resumes rather than restarts.
  3. Dual-write: new code writes both old and new; both remain readable.
  4. Switch reads: behind a flag, so switching back is instant.
  5. Contract: drop the old column, in a later deploy, once nothing references it.

Steps 1–4 are reversible: the old column stays readable throughout, so rolling the deploy back is enough. Only step 5 is not, which is exactly why it gets its own deploy and its own gate. The device that makes this stick is a CI check that refuses any DROP, TRUNCATE, or ALTER ... DROP in a changed migration unless the PR carries an explicit approval label, see guardrails for the gate itself.

Migration-specific hazards worth checking every time: a lock taken on a large tabl

阅读完整来源 ↗