migguard-lintlisted
Install: claude install-skill vivekbhange-hub/migration-guard-skill
# migguard-lint: review the migration before it reviews you
A migration that is fine on a laptop database can take production down: a plain `CREATE INDEX`
blocks writes for ten minutes, `ADD COLUMN ... NOT NULL` fails the deploy, a rename breaks the
version of the app that is still running. This skill runs `sql_lint.py`, then does the part a
script cannot: explain each finding to this user and write the safe version.
## Inputs
- A migration file, several files, or a folder (Flyway, Prisma, Rails `structure.sql`, plain
`.sql`). The database engine: PostgreSQL (default) or MySQL. Ask if it is not obvious.
- Row counts for the tables the migration touches. These decide severity, so ask for them; the
user can get them with `SELECT reltuples::bigint FROM pg_class WHERE relname = 'orders'`
(PostgreSQL) or `SELECT table_rows FROM information_schema.tables` (MySQL). An estimate is fine.
- Whether the migration runner wraps each file in a transaction (Flyway, Rails, Alembic and
Django do by default). Commands below say `python3`; on Windows use `python` (or `py -3`).
## Outputs
- A report with every finding: rule id, severity, file and line, why it matters, safe alternative.
- A corrected migration (new file or edited copy) that keeps the same intent, plus a short list of
deploy steps for anything that needs more than one release.
- A list of what the linter could not analyze (Python migrations, `DO` blocks).
## Steps
1. **Confirm authorization.** The migration should