← ClaudeAtlas

migguard-rollbacklisted

Writes the down migration or the recovery plan for a given migration, marks which steps are irreversible because they destroy data, and requires a backup and restore check before any of them runs. Never claims a destructive change can be undone. Use when the user says "write the down migration", "how do I roll back this migration", "can I undo this migration", "what if the migration fails halfway", "recovery plan for this schema change", or "do I need a backup before this".
vivekbhange-hub/migration-guard-skill · ★ 0 · API & Backend · score 75
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