Supabase Architect
This skill automates the database lifecycle and enforces security standards for Supabase.
Capabilities
- Create Migrations: Generates timestamped migrations and provides next steps for type syncing.
- Synchronize Types: Regenerates TypeScript definitions from the local Supabase instance.
- Audit Schema: Scans migrations for missing Row Level Security (RLS) policies.
Usage
1. Create a New Migration
Use this to create a new schema change file.
bash1node .gemini/skills/supabase-architect/scripts/create_migration.cjs <migration_name>
2. Sync Types
Run this after applying migrations to update your TypeScript types.
bash1node .gemini/skills/supabase-architect/scripts/sync_types.cjs
3. Audit Migrations
Run this to check for security anti-patterns like missing RLS.
bash1node .gemini/skills/supabase-architect/scripts/audit_schema.cjs
Reference
See conventions.md for project-specific SQL standards and RLS patterns.
Workflow
- Plan: Define the schema change in your task's
plan.md. - Create: Run
create_migration.cjs. - Implement: Add SQL to the generated file in
supabase/migrations/. - Audit: Run
audit_schema.cjsto verify RLS. - Apply: Run
npx supabase db reset(local). - Sync: Run
sync_types.cjsto updatetypes_db.ts.