migration-patterns

migration-patterns is a skill for Claude Code from atuljha23/holocron. It costs 50 tokens per session (1,146 once invoked), scanned A, original, MIT.

A guide to changing a database's table structure while an application continues serving users. It explains expand, migrate, and contract steps, including copying existing data and safely changing reads and writes.

In plain words
What is it for?
Use it when adding, removing, or changing database fields under live traffic when a maintenance window is unavailable.
Why use it?
Changing a live database directly can cause locked tables, failed deployments, or code that expects data the database does not yet have.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the holocron plugin — 11 skills, 24 commands, 14 agents, 6 hooks shipped together

Good fit Use it when adding, removing, or changing database fields under live traffic when a maintenance window is unavailable.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/atuljha23/holocron/migration-patterns
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 atuljha23/holocron --skill migration-patterns
Clone the repo
git clone --depth 1 https://github.com/atuljha23/holocron

Made for: Claude Code.

Or install holocron, the plugin that ships this one along with the rest of its 11 skills, 24 commands, 14 agents, 6 hooks.

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 migration-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/atuljha23/holocron/migration-patterns/github.svg)](https://agentmods.dev/skills/atuljha23/holocron/migration-patterns)
Your own site
<a href="https://agentmods.dev/skills/atuljha23/holocron/migration-patterns"><img src="https://agentmods.dev/badge/skills/atuljha23/holocron/migration-patterns/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 migration-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/atuljha23/holocron/migration-patterns"><img src="https://agentmods.dev/badge/skills/atuljha23/holocron/migration-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,146 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.00050 $0.01146
Opus 5.5 $0.00020 $0.00458
Sonnet 5.5 $0.00010 $0.00229
Haiku 4.5 $0.00005 $0.00115

Measured 1mo ago against content hash 8d478cdd489e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

migration-patterns 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 1mo 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.

skills/migration-patterns/SKILL.md · 121 lines

How it starts

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

Migration patterns

Assume: the service is running, writes are arriving, you cannot take a maintenance window. Most production migrations live here.

The universal rule

Never couple a schema change to a code change in the same deploy. They fail independently, and you need each to be reversible independently.

Expand → Migrate → Contract

The safe three-phase dance for any non-trivial change:

  1. Expand — add the new shape alongside the old. No caller depends on it yet.
  2. Migrate — move data to the new shape. Switch readers. Switch writers. Backfill anything left.
  3. Contract — drop the old shape once nothing reads or writes it for a cooling-off period.

Each phase is a separate deploy. Each is independently revertable.

Common change patterns

Add a column

  • Safe: ALTER TABLE ... ADD COLUMN ... NULL. No lock (or brief, depending on engine).
  • Danger: NOT NULL with no default on a large table — full-table rewrite, long lock. Use a default (cheap if metadata-only in your engine) or expand/migrate/contract: add nullable → backfill → add NOT NULL constraint.

Drop a column

  • Ship code that stops reading it. Deploy. Wait a release.
  • Ship code that stops writing it. Deploy. Wait a release.
  • Drop the column.
  • Never reverse this order.

Rename a column

  • Effectively: add new → dual-write → backfill → switch reads → stop writing old → drop old.
  • Never ALTER TABLE ... RENAME COLUMN while code is live. Callers break.

Change column type

  • Add a new column with the target type.
  • Dual-write (writers write both).
  • Backfill the new column.
  • Switch readers to the new column.
  • Stop writing the old.
  • Drop the old.

Add an index on a large table

  • Postgres: CREATE INDEX CONCURRENTLY — no table lock. Monitor for failure.
  • MySQL: online DDL since 5.6 for most index adds. Check ALGORITHM=INPLACE, LOCK=NONE.
  • Never just CREATE INDEX on a hot table without CONCURRENTLY / online algorithm.

Add a foreign key

  • Add the column first, without the constraint.
  • Backfill valid values.
  • Add the constraint NOT VALID (Postgres) so new rows are checked.
  • VALIDATE CONSTRAINT later during low traffic.

Read the full file on GitHub · 121 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. 1mo ago First seen · 121 lines · 50 tokens per session scan A 8d478cdd489e

Subscribe to this mod's changes

migration-patterns is a skill published in the GitHub repository atuljha23/holocron (2 stars, last pushed 6mo ago), licensed MIT. It adds 50 tokens to every session and 1,146 once invoked, about $0.0002 per session on Opus 5.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-08-31.

Related

Other skills, from other repositories

distributed-storage

Distributed storage systems design and operation for cloud platforms. Covers the GFS/HDFS block-and-master pattern, object storage (Swift/S3) with consistent hashing and eventual consistency, block storage semantics, replication vs erasure coding, the CAP theorem in practice, read-repair and anti-entropy, snapshot…

Tibsfox/gsd-skill-creator · 98 tokens

portable-schema-generator

Emit Postgres.sql and SQLite.sql from a single schema spec so tools work across both drivers without duplicating DDL by hand. Use when designing a schema that needs to support both shared Postgres deployments and zero-config SQLite. Reduces two-file sync burden to a single source edit.

Tibsfox/gsd-skill-creator · 61 tokens

behavioral-economics

Systematic departures from rational choice theory and their implications for economic analysis and policy. Covers cognitive heuristics (anchoring, availability, representativeness), biases (loss aversion, status quo, overconfidence), prospect theory (reference dependence, probability weighting, diminishing…

Tibsfox/gsd-skill-creator · 103 tokens

development-economics

Economics of low-income countries and the structural transformation from agrarian poverty to industrial prosperity. Covers growth models (Solow, endogenous growth, unified growth theory), the role of institutions (inclusive vs. extractive), inequality measurement and dynamics (Gini, Lorenz curve, Kuznets), poverty…

Tibsfox/gsd-skill-creator · 124 tokens

international-trade

Theory and policy of international economic exchange. Covers comparative advantage (Ricardo, Heckscher-Ohlin), gains from trade, trade policy instruments (tariffs, quotas, subsidies), exchange rate determination, balance of payments, globalization dynamics, trade agreements, and the political economy of protectionism.…

Tibsfox/gsd-skill-creator · 90 tokens

macroeconomics

Analysis of aggregate economic phenomena -- GDP measurement, inflation dynamics, unemployment theory, monetary policy (central banks, interest rates, money supply), fiscal policy (government spending, taxation, debt), and the business cycle. Covers Keynesian, monetarist, and new classical perspectives. Use when…

Tibsfox/gsd-skill-creator · 87 tokens