migration-patterns

migration-patterns is a skill for Claude Code, Codex 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 CodeCodex

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

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.

agentmods
npx agentmods add skills/atuljha23/holocron/migration-patterns
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, Codex.

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00050 $0.01146
Opus 5 $0.00025 $0.00573
Sonnet 5 $0.00010 $0.00229
Haiku 4.5 $0.00005 $0.00115

Measured 4d ago against content hash 8d478cdd489e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 4mo ago), licensed MIT. It adds 50 tokens to every session and 1,146 once invoked, about $0.0003 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-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

survey-generator

Compile a structured literature survey on any AI/ML topic. Agent curates a research bundle (taxonomy + sections + bibliography of real papers) from a public anchor resource, then a chosen LLM generates the survey artifact. Output target is a wiki page (markdown), not a one-off HTML — survey lands in /derived/surveys/…

rohitg00/pro-workflow · 135 tokens

batch-orchestration

Decompose large-scale changes into independent units and spawn parallel agents in isolated worktrees. Use for migrations, refactors, codemods, and any change touching 10+ files with the same pattern.

rohitg00/pro-workflow · 46 tokens

design-engineering

Apply interface craft when building or reviewing UI - motion, easing, timing, springs, component feel, and visual foundations. Use when building a component, animation, transition, hover or press state, modal, drawer, toast, or when polishing an interface so it feels right. Says "make this feel better", "add an…

rohitg00/pro-workflow · 82 tokens

skill-optimizer

SkillOpt-flavored offline training loop for any SKILL.md. Treats accumulated learn-rule corrections as training trajectories, proposes bounded patches via an optimizer LLM, gates each candidate against a held-out validation set built from the user's own past corrections, and ships only candidates that demonstrably…

rohitg00/pro-workflow · 124 tokens