Migration Guard
by J. Shtal
Catches the database migrations that lock tables or lose data — before they hit production.
- Prevent production table locks from blocking DDL statements
- Convert dangerous schema changes into zero-downtime deployment steps
- Verify SQL migrations against JPA entities to prevent runtime errors
$10
· or 50 creditsSecure checkout via Stripe
Included in download
- Prevent production table locks from blocking DDL statements
- Convert dangerous schema changes into zero-downtime deployment steps
- terminal, file_read automation included
- Ready for Flyway
See it in action
You say
Review this migration for a high-traffic Postgres DB: ALTER TABLE orders ADD COLUMN status text DEFAULT 'pending' NOT NULL;
Your agent does
=== 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.
Migration Guard
by J. Shtal
Catches the database migrations that lock tables or lose data — before they hit production.
$10
· or 50 creditsSecure checkout via Stripe
Included in download
- Prevent production table locks from blocking DDL statements
- Convert dangerous schema changes into zero-downtime deployment steps
- terminal, file_read automation included
- Ready for Flyway
- Instant install
See it in action
You say
Review this migration for a high-traffic Postgres DB: ALTER TABLE orders ADD COLUMN status text DEFAULT 'pending' NOT NULL;
Your agent does
=== 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.
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.
Use Cases
- Prevent production table locks from blocking DDL statements
- Convert dangerous schema changes into zero-downtime deployment steps
- Verify SQL migrations against JPA entities to prevent runtime errors
- Create batched backfill scripts for adding NOT NULL constraints
Known Limitations
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 install
Drop the file into your AI tool. Works with Claude, Cursor, ChatGPT, and 20+ more.
Reviews
No reviews yet - be the first to share your experience.
Only users who have downloaded or purchased this skill can leave a review.
Early access skill
Be the first to review this skill.
Only users who have downloaded or purchased this skill can leave a review.
Security Scanned
Passed automated security review
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.
Requires Python 3.9+ and the sqlglot package (pip install sqlglot). No database connection needed — pure static analysis of SQL/Flyway/Liquibase files. Tested with Claude Code; works with any SKILL.md-compatible agent.
Creator
Frequently Asked Questions
Learn More About AI Agent Skills
More Premium Skills
Multi-Agent Orchestration Master Library
Transform Claude Code into a coordinated multi-agent system. Battle-tested tmux orchestration patterns, YAML task queues, event-driven communication, and parallel worker management for 8+ agents.
designing-hybrid-context-layers
Architects the right retrieval strategy for every query — teaching your agent when to use RAG, a knowledge graph, or a temporal index instead of defaulting to vector search for everything.

Cinematic Landing Page Builder
Turn any business URL into a high-end animated landing page with 4K AI assets and GSAP animations via Cloudflare.
Bounty Security Pattern Master Library — 399 Vulnerability Patterns
A premium library of 399 vulnerability patterns and DeFi attack vectors for AI-driven bug hunting and security audits.