- Home
- Skills
- Data & Databases
- migration-guard
Works with the AI Agents you already use
Migration Guard
by J. Shtal
Catches the database migrations that lock tables or lose data — before they hit production.
$10
migration-guard
Example session with this skill installed
Review this migration for a high-traffic Postgres DB: ALTER TABLE orders ADD COLUMN status text DEFAULT 'pending' NOT NULL;
- Read your context and instructions
- Compiled the migration-guard
=== CRITICAL ===
[MG-030] migration.sql:1
Adding NOT NULL while the old app version still writes without it is a rolling-deploy hazard.
fix: Expand-contract: add nullable with a default, deploy the writer, backfill, then SET NOT NULL.
Summary: 0 blocker, 1 critical, 0 warning.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Database migrations that work fine in development often lock tables, lose data, or break production during a rolling deploy. Standard CI catches syntax errors — it rarely catches a CREATE INDEX that freezes writes for ten minutes, or a RENAME that breaks the app version still running the old code.
What it does
- Reviews SQL, Flyway, and Liquibase migrations for Postgres, MySQL, and Oracle against ~48 dialect-specific safety rules.
- Flags blocking DDL (non-concurrent indexes, table rewrites, unvalidated constraints), data loss (DROP, TRUNCATE, UPDATE without WHERE), and zero-downtime hazards (RENAME, backfills, missing lock_timeout).
- Rewrites unsafe migrations into a safe, ordered sequence — expand-contract, batched backfills, two-step constraint validation — instead of just flagging the problem.
- Outputs text for local review, or JSON/SARIF for CI gates and GitHub code scanning.
Why it's worth having
These are well-known traps, but they're easy to miss in a normal code review — nobody reads a migration file thinking about ACCESS EXCLUSIVE locks on a 100M-row table. migration-guard encodes that expertise so your agent (and your CI) catches it every time, not just when someone remembers to check.
Example
ALTER TABLE orders ADD COLUMN status text NOT NULL; looks harmless. migration-guard flags it as a BLOCKER (forces a full-table rewrite under an exclusive lock) and rewrites it into three safe migrations: add the column nullable, backfill in batches, then enforce NOT NULL via a validated check.
Free vs full
A free edition covering BLOCKER-level lock and data-loss rules is available on GitHub. This full edition adds every CRITICAL/WARNING rule, the zero-downtime rewrite engine, MySQL support, and JSON/SARIF output for CI.
Static analyzer only — it reads SQL, not your database. It doesn't know actual table sizes, so when an operation would rewrite a table and the size is unknown, it errs toward warning rather than guessing.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 months ago
Permissions
File Scopes
Reads .sql/.xml/.yaml files under the target path given as a CLI argument (migration files the user points it at). No network access, no writes — output goes to stdout only.
What's inside
Creator
J. Shtal
Frequently Asked Questions
New in Data & Databases
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.