data-migration

data-migration is a skill for Claude Code, Codex from OKHP3/skillz. It costs 88 tokens per session (1,166 once invoked), scanned A, original, MIT.

Production data-change guidance for safely changing database structures or moving data while software remains available. It covers schema changes, backfills, table splits, and transfers between systems.

In plain words
What is it for?
Planning column changes, backfilling records, renaming fields, splitting tables, and moving production data.
Why use it?
It reduces downtime, data loss, and rollback problems by separating each migration step and keeping old and new code compatible.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Planning column changes, backfilling records, renaming fields, splitting tables, and moving production data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/okhp3/skillz/data-migration
View source ↗ OKHP3/skillz
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add OKHP3/skillz --skill data-migration
Clone the repo
git clone --depth 1 https://github.com/OKHP3/skillz

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for data-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/okhp3/skillz/data-migration/github.svg)](https://agentmods.dev/skills/okhp3/skillz/data-migration)
Your own site
<a href="https://agentmods.dev/skills/okhp3/skillz/data-migration"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/data-migration/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for data-migration

Your own site · 80×15
<a href="https://agentmods.dev/skills/okhp3/skillz/data-migration"><img src="https://agentmods.dev/badge/skills/okhp3/skillz/data-migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,166 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00088 $0.01166
Opus 5 $0.00044 $0.00583
Sonnet 5 $0.00018 $0.00233
Haiku 4.5 $0.00009 $0.00117

Measured 6d ago against content hash 2a33c8fae2b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

data-migration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

community/data-migration/SKILL.md · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Data migration

Migrations are the most irreversible thing most engineers do routinely. Code can be rolled back; a dropped column cannot, and a botched backfill can corrupt data in ways no deploy fixes.

Two properties make a migration safe, and both must hold:

  • Backwards compatible: the currently deployed code works before and after it runs
  • Reversible, or backed up: you can get back, or you have a copy you have tested restoring

If a migration has neither, it needs a maintenance window and a rehearsal.

1. Never combine schema change with data change

Separate migrations, separate deploys:

  1. Add the new structure
  2. Backfill it
  3. Switch the code to use it
  4. Remove the old structure — later, as its own change

Combining these makes rollback impossible: reverting the code leaves the data half-moved, and reverting the data loses whatever the new code wrote.

Done when: each step is independently deployable and revertible.

2. Use expand-then-contract for anything breaking

Renaming a column is not a rename in production. It is:

  1. Expand — add new_name, nullable
  2. Dual-write — deploy code writing both; reads still use the old
  3. Backfill — populate new_name for existing rows, in batches
  4. Switch reads — deploy code reading the new column
  5. Stop writing the old
  6. Contract — drop old_name, well after everything is stable

Slow and boring, and it is the only way to do it without a window. Each step is individually safe to roll back.

Done when: no single step breaks the currently running code.

3. Know which operations take locks

The operation that takes an exclusive lock on a large table stops all writes for its duration. This is the most common cause of migration incidents, and the details are engine-specific — check yours.

Common traps in Postgres:

  • Adding an index without CONCURRENTLY blocks writes for the build
  • Adding a column with a volatile default rewrites the table on older versions
  • Changing a column type usually rewrites
  • Adding a foreign key takes a lock on both tables while validating — add NOT VALID, then validate separately
  • A migration waiting behind a long transaction queues everything behind it, so a "fast" migration can still cause an outage

Read the full file on GitHub · 117 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 117 lines · 88 tokens per session scan A 2a33c8fae2b6

Subscribe to this mod's changes

data-migration is a skill published in the GitHub repository OKHP3/skillz (3 stars, last pushed yesterday), licensed MIT. It adds 88 tokens to every session and 1,166 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.