/devops-skills:data-migrationfrom devops-skills
Guides zero-downtime schema and data migrations using expand-then-contract: add new structures alongside old, backfill in batches, dual-write during transition, verify both paths, and keep every step reversible. For renaming columns, changing data types, moving data between tables, or backfilling fields without a maintenance window.
Ships in devops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The instinct when a schema needs to change is to write one migration that gets the database from old shape to new shape and run it. That instinct is exactly what causes downtime: a single atomic cutover means the old code and the new code cannot both be correct at the same moment, so somewhere in the deploy there is a window where reads or writes are wrong.
The fix is to stop treating "old schema" and "new schema" as two states connected by one migration, and instead treat the migration as a sequence of states where old and new coexist, each individually safe, each individually undoable.
A migration that cannot be paused halfway through, with both old and new still working, is not actually a migration — it is a scheduled outage with a script attached.
For a worked SQL walkthrough of the expand, backfill, and contract phases, read
references/expand-contract.md.
Expand-then-contract is the pattern underneath every zero-downtime schema change: add the new thing without touching the old thing, move the data, then remove the old thing only once nothing depends on it anymore.
Each phase ships as its own deploy, sequenced with normal rollout controls — see
deployment-strategies for how to stage and gate a rollout, since migration phases are just
deploys with an extra constraint: the previous phase must already be stable in production.
Done when: the migration is written as three separate, independently deployable changes, not one script that jumps from old shape to new shape.
A backfill that updates every row in one transaction locks the table for its full duration and either completes entirely or rolls back entirely — on a large table, neither outcome is acceptable.
Done when: the backfill can be paused and resumed without manual intervention or risk of double-processing a row.
During the migrate phase, the application writes to both the old and new location so that either can serve reads. Dual-writing is a temporary bridge, not a permanent architecture, and it carries its own risk: a write that succeeds to one side and fails to the other.
Done when: a divergence check between old and new data sources has run clean, and a date is set for ending the dual-write phase.
The whole point of expand-then-contract is that at every phase, both the old and new code paths are live and correct — which only holds if both have actually been verified, not just the new one that got the attention during development.
feature-flags for the mechanics of that rollout.Done when: the new code path has served production traffic correctly at full volume before the old path is scheduled for removal.
The value of splitting a migration into phases evaporates if any individual phase cannot be undone. Reversibility per-step is what makes each phase low-risk enough to ship with normal deploy confidence instead of migration-specific dread.
Done when: any single phase of the migration can be rolled back without requiring a rollback of any other phase.
The contract phase is the one that is actually destructive, and it is also the one people rush because the migration has been "basically done" for weeks by the time they get to it.
Done when: the old structure has been removed, its removal was intentional and reviewed, and a backup of the pre-removal state exists for the agreed retention window.
State which phase (expand, migrate, or contract) the migration is currently in, whether dual-writing is active and its planned end date, and the result of the last old/new divergence check. Name the honest gap — usually a dual-write phase running longer than planned, or an old code path that has not been fully confirmed unused — rather than declaring the migration complete before the contract phase has actually shipped.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub arjunprabhulal/devops-skills --plugin devops-skills88 skills in this plugin
/alertingCovers designing alerts that page a human only when a human needs to act — symptom-based alerting over cause-based, multi-window burn-rate alerts on error budgets, severity tiers that route between page/ticket/dashboard, requiring every page to link a runbook, and tuning out alert fatigue. Use this whenever the user is writing a new alert rule, asking why on-call is paged too often or missing real incidents, choosing an alert threshold, or designing severity routing. For the SLO the burn-rate math comes from use `slo-definition`, and for what a runbook should contain use `runbooks`./api-gatewayCovers the managed front-door pattern for APIs — request routing, centralized auth, rate limiting and quotas, request/response shaping, and recognizing when a gateway helps versus becomes a bottleneck or single point of failure. Use this whenever the user is designing an API entry point, adding rate limits or quotas, centralizing auth for several backend services, transforming a request between an external and internal contract, or debugging a gateway timeout. For east-west traffic between internal services use `service-connectivity`, and for token issuance details use `iam-access-management`./argocd-operationsCovers running Argo CD day to day — structuring app-of-apps, choosing sync policies and waves, reading health versus sync status correctly, and unsticking a degraded or hung Application. Use this whenever the user mentions Argo CD, an Application stuck "Progressing" or "OutOfSync," app-of-apps or ApplicationSets, sync waves and hooks, or asks why a deploy shows synced but the workload is unhealthy. For the underlying model this tool implements use `gitops`; for automated canary analysis on top of it use `progressive-delivery`; for the workloads it manages use `kubernetes-operations`.