supabase-migration

Generate and validate Supabase migrations with RLS policies, triggers, and retention rules.

209|46|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/erp-mafia/gnubok --skill supabase-migration-erp-mafia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-migration
Source: https://github.com/erp-mafia/gnubok/tree/main/.claude/skills/supabase-migration
Command: npx skills add https://github.com/erp-mafia/gnubok --skill supabase-migration-erp-mafia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates and validates Supabase migrations for the gnubok project, ensuring correct RLS policies, triggers, indexes, and compliance with BFL 7-year retention and immutability rules.

Core Features & Use Cases

  • Migration numbering: deterministic, sequential IDs for each migration.
  • Table templates: complete new-table blueprint with UUID PK, user_id FK, timestamps, and necessary constraints.
  • RLS, policies, triggers: built-in support to enforce row-level security and audit-trail requirements.
  • Compliance guidance: ensures 7-year retention, period lock, and immutability constraints are properly implemented in migrations.

Quick Start

Run the migration generator to create the next migration file and apply it to your Supabase project.

Frequently Asked Questions about supabase-migration

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

FAQPage Schema
How do I enforce Swedish accounting constraints in Supabase migrations?

You generate and validate Supabase migrations that specifically enforce period locks, immutability, and auditability. This ensures your database schema satisfies Swedish legal-compliance requirements for accounting data.

What is the best way to add a new table with RLS policies in Supabase?

Using a table template blueprint ensures correct RLS policies and triggers when adding new Supabase tables. It automatically includes a UUID primary key, user_id foreign key, timestamps, and necessary constraints.

How do I set up a 7-year retention rule for database records in Supabase?

You set up a 7-year retention rule by implementing compliance guidance within your Supabase migration scripts. This enforces BFL retention requirements directly in the database schema, ensuring records are preserved correctly.

How does migration numbering work for sequential database schema changes?

Supabase migration numbering uses deterministic, sequential IDs for each generated migration file. This ensures consistent ordering and reliable tracking of schema changes across different deployment scenarios.

Can I validate Supabase triggers and audit-trail requirements before deployment?

Yes, you can validate triggers and audit-trail requirements before deployment. The migration generator validates Supabase scripts to ensure row-level security policies and audit-trail requirements are properly implemented.

What are the limitations when modifying constraints across deployment scenarios?

When modifying constraints across deployment scenarios, Supabase migrations must maintain immutability and period locks. Changes are strictly constrained by the need to satisfy legal-compliance requirements and preserve 7-year retention rules.