supabase-sql

Clean and format Supabase SQL migrations with idempotent patterns and RLS policies.

28|3|Updated Dec 10, 2025
One-click install
npx skills add https://github.com/ScientiaCapital/skills --skill supabase-sql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-sql
Source: https://github.com/ScientiaCapital/skills/tree/main/active/supabase-sql-skill
Command: npx skills add https://github.com/ScientiaCapital/skills --skill supabase-sql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Clean and format SQL migrations for Supabase, ensuring idempotency, proper RLS policies, consistent formatting, and clear documentation to make deployments safe and repeatable.

Core Features & Use Cases

  • Idempotent migrations with DROP ... IF EXISTS and CREATE ... IF NOT EXISTS.
  • RLS policy corrections, including proper TO service_role usage.
  • Standardized formatting (NOW(), TIMESTAMPTZ) and removal of dead code.
  • End-of-migration dependencies documentation for traceability.

Quick Start

Clean any SQL migration by fixing typos, adding idempotency, correcting RLS policies, removing dead code, standardizing casing, and documenting dependencies.

Frequently Asked Questions about supabase-sql

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

FAQPage Schema
How do I make Supabase SQL migrations idempotent?

Make SQL migrations idempotent by using DROP ... IF EXISTS and CREATE ... IF NOT EXISTS statements so re-running the script in the Supabase SQL Editor yields the same database state without errors. This Skill automatically enforces those patterns for you.

Why do my Supabase RLS policies fail with service_role?

Supabase RLS policies often fail when they do not explicitly specify the TO service_role clause. This Skill corrects RLS policies by enforcing proper TO service_role usage, ensuring your Postgres row level security configurations function as intended.

What is the best way to format Postgres SQL for Supabase migrations?

The best way to format Postgres SQL for Supabase is to standardize TIMESTAMPTZ and NOW() functions, remove dead code, and document dependencies at the end of the migration. This ensures clean, repeatable, and traceable database deployments.

Can I use this to prepare SQL for the Supabase SQL Editor?

Yes, you can use this to prepare SQL specifically for the Supabase SQL Editor. It cleans and formats your migration scripts by fixing typos, standardizing casing, and applying idempotent patterns so they are ready to paste and execute safely.

How do I document dependencies in a Supabase SQL migration?

Document dependencies in a Supabase SQL migration by listing them at the end of the script for traceability. This Skill automatically appends dependency documentation to your formatted SQL, making deployment tracking and debugging easier.