db-migration-safety

db-migration-safety is a skill for Claude Code from KhaledSaeed18/dotclaude. It costs 75 tokens per session (993 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 — 22 skills, 2 commands, 7 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 22 skills, 2 commands, 7 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/github.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/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 db-migration-safety

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 993 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.00075 $0.00993
Opus 5.5 $0.00030 $0.00397
Sonnet 5.5 $0.00015 $0.00199
Haiku 4.5 $0.00007 $0.00099

Measured 4d ago against content hash b2fc9ce306d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-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 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.

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

How it starts

The opening of the file, as written. The whole thing — 48 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 · 48 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 Changed · +1 lines b2fc9ce306d5
  2. 2mo ago Changed · +1 lines · -13 tokens per session af006da036ac
  3. 3mo 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 (8 stars, last pushed today), licensed MIT. It adds 75 tokens to every session and 993 once invoked, about $0.0003 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

db-migration-safety compared with skills from other repositories

db-migration-safety next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
db-migration-safetyKhaledSaeed18/dotclaudeSkill8todayMITA75Claude Code
database-migratorOneWave-AI/claude-skillsSkill458yesterdayMITA76Claude Code
database-schema-designerOneWave-AI/claude-skillsSkill458yesterdayMITA141Claude Code, Codex
drizzle-ormMindrally/skillsSkill3251mo agoApache-2.0A25Claude Code
elasticsearch-best-practicesMindrally/skillsSkill3251mo agoApache-2.0A20Claude Code
kyselyMindrally/skillsSkill3251mo agoApache-2.0A26Claude Code
mysql-best-practicesMindrally/skillsSkill3251mo agoApache-2.0A21Claude Code