migguard-rollbacklisted
Install: claude install-skill vivekbhange-hub/migration-guard-skill
# migguard-rollback: the way back, stated honestly
Most "down" migrations are fiction. `DROP COLUMN` has no inverse: the data is gone, and a `down`
that re-adds an empty column hides that. This skill sorts each step of a migration into reversible,
reversible with a cost, and irreversible, writes the down SQL only for the first two, and for the
third writes the recovery plan: backup, restore test, and what to do if the deploy fails at each point.
It has no script; it works from the migration SQL and the facts the user gives.
## Inputs
- The migration file(s) and the migration tool (Flyway undo, Rails `down`, Alembic `downgrade`,
Django reverse, goose, plain SQL).
- Engine and how backups work: `pg_dump`, snapshots, point-in-time recovery, managed provider
backups, MySQL binlogs. Ask what exists and when it last ran.
- Whether the app version before the deploy can run against the schema after it.
- Commands below say `python3`; on Windows use `python` (or `py -3`).
## Outputs
1. **Step classification table**: each statement, reversible yes, yes with cost, or no, and why.
2. **Down migration SQL** for the reversible steps, in reverse order, with `SET lock_timeout`.
3. **Recovery plan** for irreversible steps: backup command (as text for the user to run), restore
verification, abort points, and who decides to restore.
4. **Go / no-go** line: what must be true before the migration runs.
## Steps
1. **Confirm authorization.** The user owns the database or has permissi