supabase-migration-writer

Write SQL migrations, RLS policies, and RPC functions for Supabase schemas.

Updated Dec 19, 2025
One-click install
npx skills add https://github.com/Spectaculous-Code/raamattu-nyt --skill supabase-migration-writer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-migration-writer
Source: https://github.com/Spectaculous-Code/raamattu-nyt/tree/main/.claude/skills/supabase-migration-writer
Command: npx skills add https://github.com/Spectaculous-Code/raamattu-nyt --skill supabase-migration-writer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the complex and error-prone process of managing Supabase database schemas, ensuring data integrity and application stability.

Core Features & Use Cases

  • Database Migrations: Create, apply, and rollback SQL migrations for Supabase.
  • Schema Management: Add or modify tables, columns, and Row Level Security (RLS) policies.
  • RPC Functions: Define and manage server-side functions for data operations.
  • Type Synchronization: Ensures frontend TypeScript types stay in sync with the database schema.
  • Use Case: When adding a new user_preferences table with RLS policies, this Skill guides you through writing the SQL migration, creating the necessary RLS, and updating the generated TypeScript types to prevent build errors.

Quick Start

Use the supabase-migration-writer skill to create a new SQL migration file for adding a 'user_notes' table with 'user_id', 'content', and 'created_at' columns, including RLS policies for user-specific access.

Frequently Asked Questions about supabase-migration-writer

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

FAQPage Schema
How do I write Supabase SQL migrations for new tables with RLS policies?

To write Supabase SQL migrations, you define the table schema and add Row Level Security (RLS) policies to restrict data access. This process ensures data integrity by guiding you through table creation, policy enforcement, and TypeScript type synchronization.

How do I keep TypeScript types in sync with my Supabase database schema?

TypeScript types stay in sync with your Supabase database schema by updating generated types whenever you apply SQL migrations. This prevents frontend build errors when you add tables, alter columns, or deploy server-side functions.

How do I create and deploy Supabase RPC functions using SQL?

To create and deploy Supabase RPC functions, write SQL migrations that define the server-side functions for your data operations. This approach manages function deployment securely within your database schema management workflow.

What is the best way to manage database schema changes in Supabase?

The best way to manage database schema changes in Supabase is by creating, applying, and rolling back SQL migrations. This method handles table creation, column alteration, and RLS policy updates systematically to maintain application stability.

Can I rollback Supabase database migrations if a schema update fails?

Yes, you can rollback Supabase database migrations if a schema update fails. The migration management process supports applying and rolling back SQL changes to ensure you can revert table alterations or column modifications without breaking data integrity.

Do I need to write separate SQL migrations for altering columns and updating RLS policies?

You do not need separate SQL migrations for altering columns and updating RLS policies. You can combine table schema modifications and Row Level Security policy updates within the same migration file to streamline database management.