supabase-setup
Skill3 starsChanged 10 days agoMITView on GitHub
Use this skill when setting up or changing a Supabase database - schema, migrations, row-level security, seeds, typed clients, or connecting an app to a hosted project. Covers the safe order of operations and the checks that prevent a public table or an unreviewable schema change.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- planailabs/ui.plan.aitheir own version, first seen May 26, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- planailabs/ui.plan.ai★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository72 other files it gives its agents.
- workflow/AGENTS.mdAGENTS.md
- docs/llms.txtllms.txt
- llms.txtllms.txt
- ai-video-prompt-engineerSkill
- api-contract-designSkill
- api-hardeningSkill
- brainstormingSkill
- cavecrewSkill
- caveman-commitSkill
- caveman-compressSkill
- caveman-helpSkill
- caveman-reviewSkill
- cavemanSkill
- councilSkill
- database-migrationsSkill
- deep-researchSkill
- dependency-auditSkill
- deployment-patternsSkill
- e2e-testingSkill
- error-handlingSkill
- exa-searchSkill
- finishing-a-development-branchSkill
- frontend-securitySkill
- github-opsSkill
- graphifySkill
- graphyloop-wavesSkill
- graphyloop-workflowSkill
- gsap-coreSkill
- gsap-frameworksSkill
- gsap-performanceSkill
- gsap-pluginsSkill
- gsap-reactSkill
- gsap-scrolltriggerSkill
- gsap-timelineSkill
- gsap-utilsSkill
- high-end-visual-designSkill
- image-to-codeSkill
- last30daysSkill
- minimalist-uiSkill
- postgres-patternsSkill
- prisma-patternsSkill
- receiving-code-reviewSkill
- redesign-existing-projectsSkill
- remotion-video-creationSkill
- requesting-code-reviewSkill
- search-firstSkill
- secrets-hygieneSkill
- security-reviewSkill
- security-scanSkill
- short-video-productionSkill
- story-engineeringSkill
- swarm-memorySkill
- systematic-debuggingSkill
- tdd-workflowSkill
- terminal-opsSkill
- threejs-animationSkill
- threejs-fundamentalsSkill
- threejs-geometrySkill
- threejs-interactionSkill
- threejs-lightingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 58
No policy resolving to true for anon unless the data is genuinely public.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Supabase setup and schema changes
Two failures dominate Supabase work: a table shipped with row-level security off (every row readable by anyone holding the anon key), and a schema change made in the dashboard so it exists in production and nowhere in the repo. The order below prevents both.
When to activate
- Adding or changing tables, columns, constraints, indexes, policies.
- Wiring an app to Supabase for the first time.
- "the query returns nothing" / "permission denied for table" symptoms.
Order of operations
- Credentials first.
secrets_status→ store what is missing withsecrets_set→env_sync. Never paste a key into the chat (seesecrets-hygiene).SUPABASE_URL,SUPABASE_ANON_KEY— client-side, public.SUPABASE_SERVICE_ROLE_KEY— server-only, bypasses RLS.SUPABASE_PROJECT_REF/SUPABASE_ACCESS_TOKEN/SUPABASE_DB_URL— CLI + migrations.
preflight target=db. Clear every blocker before touching the database.- Schema as migration files, never dashboard edits.
supabase migration new <name>, orsupabase db diff --file <name>to capture drift that already happened. A dashboard-only change cannot be reviewed, replayed on a teammate's machine, or rolled back. - Table and its policies in the SAME migration. A table without a policy is either fully closed or fully open — never leave that to a follow-up.
- Dry-run, then apply.
supabase db push --dry-runand read the SQL. Apply to a hosted database only with explicit user approval and a rollback note. - Regenerate types.
supabase gen types typescript --linkedso the backend/frontend contract stays type-checked. - Seed realistic data. Idempotent seed script (upsert), a few rows per table, so tests and manual checks have something to read.
Schema rules
- Primary key on every table (
id uuid primary key default gen_random_uuid()is a fine default).created_at/updated_atastimestamptz. - Foreign keys with an explicit
on deletechoice — cascade / restrict / set null is a product decision, not a default. - Index every column you filter, join or sort on. The referencing side of a foreign key is NOT indexed automatically.
numericfor money, neverfloat.checkconstraints or a real enum type for fixed sets. Prefernot nullwith a default over a nullable column every reader must handle.
Row-level security checklist (every new table)
alter table X enable row level security;present in the migration.- One policy per operation you intend to allow (
select,insert,update,delete), each naming the actor:auth.uid() = user_id, a tenant column, or a role check. - No policy resolving to
truefor anon unless the data is genuinely public. - Verify with the anon key, not service-role. Testing with service-role proves nothing — it bypasses every policy. Query as anon and confirm you see exactly what you should.
- Server-only paths (admin actions, webhooks, cron) may use service-role, and must live in server code only.
Client wiring
- One module creates the client; nothing else calls
createClient. - Server and browser clients are separate (
@supabase/ssrfor Next.js) — cookie handling differs, and mixing them silently breaks auth. supabase-jsreturns{ data, error }: checkerroron every call. Swallowing it is how "returns nothing" bugs ship.
Reporting
Name the migration files, the policies added per table, the dry-run output, and the anon-key verification result. If migrations reached a hosted database, include the rollback path.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

