supabase-migration

Create and validate Supabase migrations with RLS policies and TypeScript types.

Updated Feb 19, 2026
One-click install
npx skills add https://github.com/brunolimaff-jpg/NOVO-APP --skill supabase-migration-brunolimaff-jpg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-migration
Source: https://github.com/brunolimaff-jpg/NOVO-APP/tree/main/.claude/skills/supabase-migration
Command: npx skills add https://github.com/brunolimaff-jpg/NOVO-APP --skill supabase-migration-brunolimaff-jpg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents unsafe or incomplete database changes in Supabase by guiding you to create migrations that correctly enable Row Level Security, define explicit policies, and validate security after deployment.

Core Features & Use Cases

  • RLS-first migration workflow: Ensures every new/modified table follows project RLS rules (enabled, secure defaults, and documented policies).
  • Policy correctness for read/write paths: Applies explicit SELECT policies and enforces auth.uid() checks for INSERT/UPDATE to avoid over-permissioning.
  • Post-migration security validation: Recommends running security advisor checks and confirming schema correctness, then regenerating TypeScript types when needed.
  • Use Case: Adding a new multi-tenant table for user-scoped tracking (e.g., operator_sessions) with strict per-row access while keeping SELECT behavior intentional and auditable.

Quick Start

Use the command /supabase-migration and describe the schema change you want to make (new table, column, or RLS/policy update), then follow the migration checklist to generate and validate the SQL safely.

Frequently Asked Questions about supabase-migration

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

FAQPage Schema
How do I create a safe Supabase migration with RLS enabled?

To create safe Supabase migrations, you must enable Row Level Security and define explicit policies for SELECT, INSERT, and UPDATE operations. Scoping access with auth.uid() checks ensures strict per-row authorization boundaries for multi-tenant production use.

What is the best way to write RLS policies for multi-tenant Supabase tables?

The best way to write RLS policies for multi-tenant Supabase tables is to enforce auth.uid() checks on INSERT and UPDATE paths while applying explicit SELECT policies. This prevents over-permissioning and maintains intentional, auditable read/write access.

How do I validate Supabase security policies after applying a database migration?

Validating Supabase security policies after a database migration involves running security advisor checks to confirm schema correctness. This post-migration validation ensures your RLS rules and explicit policies are properly enforced without exposing unprotected data.

Do I need to regenerate TypeScript types after modifying a Supabase schema?

Yes, you need to regenerate TypeScript types after modifying a Supabase schema. When schema changes occur during a migration, updating your TypeScript types ensures your application code remains synchronized with the new database structure and security policies.

Why are my Supabase INSERT policies allowing unauthorized row access?

Supabase INSERT policies allow unauthorized row access when they lack explicit auth.uid() checks for user-scoped tracking. Over-permissioning occurs if you do not enforce deterministic authorization boundaries and define strict per-row access rules for multi-tenant tables.