
Supabase
Apply Supabase’s local-first CLI workflow—migrations, RLS, auth, storage, and Edge Functions—without editing production by hand.
Install
npx skills add https://github.com/alinaqi/claude-bootstrap --skill supabaseWhat is this skill?
- Core principle: local-first development with every change captured as versioned SQL migrations
- Documents full stack map: Database, Auth, Storage, Edge Functions, Realtime, and pgvector Vector
- CLI flows for brew/npm install, supabase init, link remote project ref, and migration discipline
- Triggers on supabase/** paths and env files via skill path globs
- Explicit anti-pattern: never touch production directly—deploy through CI/CD
Adoption & trust: 496 installs on skills.sh; 691 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Journey fit
Build is canonical because the skill centers on implementing database, auth, and serverless backend surfaces in the repo. Backend subphase captures PostgreSQL schema work, RLS policies, and Edge Functions rather than pure frontend or docs-only tasks.
Common Questions / FAQ
Is Supabase safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Supabase
# Supabase Core Skill Core concepts, CLI workflow, and patterns common to all Supabase projects. **Sources:** [Supabase Docs](https://supabase.com/docs) | [Supabase CLI](https://supabase.com/docs/guides/local-development/cli/getting-started) --- ## Core Principle **Local-first, migrations in version control, never touch production directly.** Develop locally with the Supabase CLI, capture all changes as migrations, and deploy through CI/CD. --- ## Supabase Stack | Service | Purpose | |---------|---------| | **Database** | PostgreSQL with extensions | | **Auth** | User authentication, OAuth providers | | **Storage** | File storage with RLS | | **Edge Functions** | Serverless Deno functions | | **Realtime** | WebSocket subscriptions | | **Vector** | AI embeddings (pgvector) | --- ## CLI Setup ### Install & Login ```bash # macOS brew install supabase/tap/supabase # npm (alternative) npm install -g supabase # Login supabase login ``` ### Initialize Project ```bash # In your project directory supabase init # Creates: # supabase/ # ├── config.toml # Local config # ├── seed.sql # Seed data # └── migrations/ # SQL migrations ``` ### Link to Remote ```bash # Get project ref from dashboard URL: https://supabase.com/dashboard/project/<ref> supabase link --project-ref <project-id> # Pull existing schema supabase db pull ``` ### Start Local Stack ```bash supabase start # Output: # API URL: http://localhost:54321 # GraphQL URL: http://localhost:54321/graphql/v1 # DB URL: postgresql://postgres:postgres@localhost:54322/postgres # Studio URL: http://localhost:54323 # Anon key: eyJ... # Service role key: eyJ... ``` --- ## Migration Workflow ### Option 1: Dashboard + Diff (Quick Prototyping) ```bash # 1. Make changes in local Studio (localhost:54323) # 2. Generate migration from diff supabase db diff -f <migration_name> # 3. Review generated SQL cat supabase/migrations/*_<migration_name>.sql # 4. Reset to test supabase db reset ``` ### Option 2: Write Migrations Directly (Recommended) ```bash # 1. Create empty migration supabase migration new create_users_table # 2. Edit the migration file # supabase/migrations/<timestamp>_create_users_table.sql # 3. Apply locally supabase db reset ``` ### Option 3: ORM Migrations (Best DX) Use Drizzle (TypeScript) or SQLAlchemy (Python) - see framework-specific skills. ### Deploy Migrations ```bash # Push to remote (staging/production) supabase db push # Check migration status supabase migration list ``` --- ## Database Patterns ### Enable RLS on All Tables ```sql -- Always enable RLS ALTER TABLE public.profiles ENABLE ROW LEVEL SECURITY; -- Default deny - must create policies CREATE POLICY "Users can view own profile" ON public.profiles FOR SELECT USING (auth.uid() = id); ``` ### Common RLS Policies ```sql -- Public read CREATE POLICY "Public read access" ON public.posts FOR SELECT USING (true); -- Authenticated users only CREATE POLICY "Authenticated users can insert" ON public.posts FOR INSERT WITH CHECK (auth.role() = 'authenticated'); -- Owner access CREATE POLICY "Users can update own records" ON public.posts FOR UPDATE USING (auth.uid() = user_id); -- Admin access (using custom claim) CREATE POLICY "Admins have full access" ON public.posts FOR ALL USING (auth.jwt() ->> 'role' = 'admin'); ``` ### Link to auth.users ```sql -- Profile table linked to auth CREATE TABLE public.profiles ( id UUID PRIMARY KEY REFERENCES auth.users(id) ON DELETE CASCADE, username TEXT UNIQUE NOT NULL, avatar_url TEXT, created_at TIMESTAMPTZ DEFAULT NOW() ); -- Auto-create profile on signup CREATE OR REPLACE FUNCTION public.handle_new_user() RETURNS TRIGGER AS $$ BEGIN INSERT INTO p