agentleFS
Starr-delStarr-del/ShipSafe/skills/migration-reversibility/SKILL.md

migration-reversibility

Skill0 starsChanged 5 months agoMITView on GitHub

Check SQL migration files for irreversible or deploy-breaking operations before running them against production. Use whenever the user writes a migration, mentions ALTER/DROP/migrate, prepares a release containing schema changes, or asks if a deploy is safe — for Supabase, Prisma, Drizzle, or raw SQL alike. Runs fully offline — no API keys, no network, no credentials.

  • Deletes or force-pushes

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All paths below are relative to this skill's directory (migration-reversibility/).

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

migration-reversibility

Part of shipsafe — offline deploy-safety skills. Every script is stdlib-only Python 3.8+; nothing leaves the machine.

python3 scripts/check_migrations.py <migrations_dir_or_file> [--json]

Three finding categories:

  • DATA_LOSS — DROP TABLE/COLUMN without co-located backup, TRUNCATE, DELETE without WHERE, type narrowing to VARCHAR(n). Rolling back the deploy does not roll back these — the data is gone.
  • DEPLOY_BREAKER — operations that break the currently running app version during the deploy window: ADD COLUMN NOT NULL without DEFAULT, RENAMEs (old code queries the old name), CREATE INDEX without CONCURRENTLY (locks writes on Postgres).
  • SECURITY — Row Level Security audit. Explicit DISABLE ROW LEVEL SECURITY is critical anywhere. For Supabase projects (detected via path or auth.uid()/anon-grant signals — non-Supabase databases are deliberately not flagged), tables CREATEd without a matching ENABLE ROW LEVEL SECURITY are flagged high: on Supabase the public anon key can query any table in the public schema, so a table without RLS is publicly readable and writable. This is the #1 documented cause of vibe-coded app data breaches; when it fires, walk the user through deny-by-default policies.

The governing rule, which is worth stating to the user verbatim: a migration is deploy-safe only if the previous version of the app still works after it runs. That's what makes rollback possible.

For flagged RENAMEs and DROPs, recommend the expand/contract pattern: add the new thing → dual-write → migrate readers → remove the old thing in a later release. SQL comments are stripped before analysis, and a backup statement in the same file downgrades DROP severity.

Exit codes: 0 clean, 1 findings.

All paths below are relative to this skill's directory (migration-reversibility/).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.