/major-ai-skills:supabasefrom major-ai-skills
Build Supabase apps with migration-first SQL, RLS policies, auth.uid() performance, SSR cookie clients vs service role, Edge Functions, and JWT troubleshooting. Use for Postgres-backed products with client-side data access under RLS.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Supabase centers on PostgreSQL with PostgREST auto-API, GoTrue Auth (JWT sessions), Storage, Realtime, and Edge Functions (Deno). Security is RLS, not hiding the anon/publishable key. Service role / secret keys bypass RLS only on the server—and only when no user JWT overrides the Authorization header.
Claude operates as a Principal Backend Platform Engineer: RLS-by-default, policy performance, SSR client separation, and CLI migrations.
Client (anon/publishable key + user JWT)
→ PostgREST → Postgres (RLS enforced)
Server (secret/service role, no user session on same client)
→ admin tasks / webhooks / batch jobs
Use when
supabase start and SQL migrations.Do not use when
select/insert/update/delete.service_role or secret keys to browsers or mobile binaries.(select auth.uid()) = user_id over bare auth.uid() = user_id per row re-eval (Supabase RLS guide).supabase/migrations/*.sql; avoid prod dashboard-only schema drift.auth.uid() is NULL in editor context.getUser() works but REST returns 42501 with NULL auth.uid(), decode Authorization on failing request—verify user access token (not apikey) and signing key alignment (see GitHub #46946, #43066).create table public.profiles (
id uuid primary key references auth.users (id) on delete cascade,
display_name text,
updated_at timestamptz not null default now()
);
alter table public.profiles enable row level security;
create policy "profiles_select_own"
on public.profiles for select
to authenticated
using ((select auth.uid()) = id);
create policy "profiles_update_own"
on public.profiles for update
to authenticated
using ((select auth.uid()) = id)
with check ((select auth.uid()) = id);
Client (browser—anon key only):
import { createClient } from "@supabase/supabase-js";
const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
);
| Mistake | Symptom | Fix |
|---|---|---|
SSR @supabase/ssr client + service key for "admin" | User session overrides Authorization → RLS applies | Separate createClient(url, secretKey) without cookies |
signUp on service client | Returns session; key behaves like user | Use auth.admin.createUser for provisioning |
Policy service_role in USING | Meaningless | Service role bypasses policies entirely |
| Secret key + user Bearer together | RLS as user, not bypass | Strip user token for admin ops |
| Issue | Root cause | Fix |
|---|---|---|
| Empty results, no error | RLS filters all rows | Policy for role; check auth.uid() |
| 42501 on insert | WITH CHECK fails or NULL uid | JWT on request; policy match |
| permission denied | RLS on but no policy / revoked grant | Add policy; review grants |
| Migration drift | Dashboard edits | Pull/migrate; db push from git |
| Slow lists | RLS + missing index | Index filter columns |
user_id, tenant_id).@stripe): use server client + service role only after signature verify.security definer reviewed carefully).@postgresql — SQL design and indexes@nextjs — cookie-based Supabase SSR@stripe — server webhooks updating entitlements@supabase-rls — deep RLS-only pass (if installed)MANDATORY: Enable RLS on user-owned tables with explicit policies. Keep secret/service keys server-side only. Never debug RLS only in SQL Editor—reproduce on live REST with decoded JWT. Manage schema via migrations, not one-off prod clicks.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization.Other plugins' skills for the same job
/act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.