data-migration-safety

Review Postgres and Supabase migration files for reversibility, lock duration, and RLS correctness.

6|1|Updated May 13, 2026
One-click install
npx skills add https://github.com/Xipher-Labs/walter-os --skill data-migration-safety
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-migration-safety
Source: https://github.com/Xipher-Labs/walter-os/tree/main/skills/data-migration-safety
Command: npx skills add https://github.com/Xipher-Labs/walter-os --skill data-migration-safety

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents high-risk database changes by reviewing migrations for reversibility, locking behavior, safe backfills, idempotence, constraint/foreign-key rollout, and Supabase RLS correctness so teams avoid outages and data integrity incidents.

Core Features & Use Cases

  • Migration safety checklist enforcement: evaluates every migration for required structure (up/down), lock duration risks (e.g., ACCESS EXCLUSIVE), and rollback feasibility.
  • Operational migration guidance: flags patterns like non-concurrent index creation, unbatched backfills, and non-idempotent SQL constructs, and recommends safer phased approaches.
  • Supabase-specific RLS review: verifies RLS is enabled for new tables/policy changes, ensures per-operation policies exist, and catches service-role bypass risks.
  • Risk-aware guidance for regulated data: applies special severity expectations when audit-log integrity or PHI compliance is implicated.
  • PR-oriented output: produces actionable BLOCKING|WARN|NIT findings with location, class, risk, estimated impact, fixes, and tests.

Quick Start

Use the data-migration-safety skill on your pull request that modifies migrations, SQL schema files, Supabase migrations, or any schema/RLS-related changes so it can produce a safety verdict for each risky statement.

Frequently Asked Questions about data-migration-safety

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check database migrations for downtime risks before merging?

You can review database migrations for downtime risks by enforcing a safety checklist that evaluates lock durations, rollback feasibility, and batched backfill requirements. This process flags patterns like non-concurrent index creation to prevent outages and data integrity incidents.

What makes a Postgres schema change irreversible and how do I avoid it?

A Postgres schema change becomes irreversible when it lacks a valid down migration or applies non-idempotent SQL constructs. You can avoid this by enforcing strict reversibility patterns and idempotence checks during your migration linting process.

How do I safely enable Supabase RLS policies in a new migration?

To safely enable Supabase RLS policies, review new tables to verify RLS is active, ensure per-operation policies exist, and catch potential service-role bypass risks. This structured review prevents security regressions when modifying schema inputs.

Does this migration review process work with unbatched backfills on large tables?

The migration review process specifically flags unbatched backfills on large tables as high-risk operations. It recommends safer phased approaches and provides operational guidance to require batched backfills, preventing long lock durations and potential outages.

What is the best way to handle ACCESS EXCLUSIVE locks during column alterations?

The best way to handle ACCESS EXCLUSIVE locks during column alterations is to apply structured migration linting that identifies these lock-duration risks. The review outputs actionable guidance recommending safer online approaches to avoid blocking table operations.

When do I need migration linting for regulated data and audit logs?

You need migration linting for regulated data and audit logs when schema changes implicate PHI compliance or audit-log integrity. The review applies special severity expectations and escalates findings to BLOCKING status to prevent compliance violations.