db-migration-safety

db-migration-safety is a skill for Claude Code from KhaledSaeed18/dotclaude. It costs 88 tokens per session (973 once invoked), scanned A, original, MIT.

A safety review method for database schema migrations, which are changes to the structure of stored data and tables.

In plain words
What is it for?
It is for reviewing or writing migrations for PostgreSQL, MySQL, SQLite, and common database tools, including indexes, backfills, deploy order, and rollback.
Why use it?
It helps prevent migrations from locking tables, rewriting large amounts of data, breaking rolling deployments, or lacking a safe rollback path.

Skill for Claude Code

Written for Claude Code: a Claude Code plugin manifest.

Part of the engineering plugin — 15 skills, 1 command, 6 agents shipped together

Good fit It is for reviewing or writing migrations for PostgreSQL, MySQL, SQLite, and common database tools, including indexes, backfills, deploy order, and rollback.

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

Made for: Claude Code.

Or install engineering, the plugin that ships this one along with the rest of its 15 skills, 1 command, 6 agents.

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 db-migration-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/db-migration-safety.svg)](https://agentmods.dev/skills/khaledsaeed18/dotclaude/db-migration-safety)
Your own site
<a href="https://agentmods.dev/skills/khaledsaeed18/dotclaude/db-migration-safety"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/db-migration-safety.svg" alt="Measured on agentmods" 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 973 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.00973
Opus 5 $0.00044 $0.00487
Sonnet 5 $0.00018 $0.00195
Haiku 4.5 $0.00009 $0.00097

Measured 7d ago against content hash 5179170011a5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

db-migration-safety 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 7d 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.

.claude-plugin/plugins/engineering/skills/db-migration-safety/SKILL.md · 46 lines

How it starts

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

A migration that is correct on an empty dev database can still take a production table offline. Judge every migration by what it does under load on the largest table it touches: what lock it takes, for how long, and what the old application version does while the new schema is live. When any answer is "depends", assume the worst table and the slowest query.

Step 1: Establish the blast radius

  • Read the migration and identify every table it touches, then find out (or ask) roughly how large and how hot each one is. A pattern that is fine on 10k rows is an outage on 100M.
  • Identify the engine and version (Postgres, MySQL 8, SQLite, ...) from config; lock behavior differs materially between them, and between versions.
  • Identify the deploy model: is the old app version still running while this migration executes (rolling deploy, multiple replicas)? Almost always yes; review under that assumption.

Step 2: Check the dangerous patterns

Flag any of these, with the safe alternative:

Locking and rewrites

  • Any statement that rewrites the table or takes an exclusive lock for its duration: changing a column's type, adding a column with a volatile default (pre-Postgres 11), ALTER TABLE on MySQL without ALGORITHM=INPLACE/INSTANT support. Alternative: add a new column, backfill, swap.
  • CREATE INDEX without CONCURRENTLY (Postgres) on a live table blocks writes for the build. CONCURRENTLY cannot run inside a transaction; the migration tool must support that (most do via a flag or disable_ddl_transaction!).
  • Adding a NOT NULL constraint or foreign key that validates existing rows scans the table under lock. Alternative: add as NOT VALID / unvalidated, then VALIDATE CONSTRAINT separately.

Deploy-order breaks (expand-contract violations)

  • Dropping or renaming a column or table the currently-deployed code still reads or writes. Renames are two deploys minimum: add new + dual-write, migrate readers, then drop the old one in a later release.
  • Making a column NOT NULL while the running app still inserts without it.
  • Enum or check-constraint tightening that existing rows or in-flight writes violate.

Read the full file on GitHub · 46 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. 7d ago First seen · 46 lines · 88 tokens per session scan A 5179170011a5

Subscribe to this mod's changes

db-migration-safety is a skill published in the GitHub repository KhaledSaeed18/dotclaude (5 stars, last pushed 6d ago), licensed MIT. It adds 88 tokens to every session and 973 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-08-31.