supabase
Skill1 starsChanged 4 months agoMITView on GitHub
Supabase-specific expertise — the key model as a trust boundary (the publishable/anon key is public and ships to the browser; the secret/`service_role` key bypasses Row Level Security and must never leave the server), RLS as the actual authorization layer with `USING` vs `WITH CHECK` per operation and indexed policy predicates, validating a session server-side with `getUser()` rather than trusting a decoded token or user-writable `user_metadata`, CLI-based migrations kept in the repo instead of dashboard edits, Edge Functions, Storage bucket policies and signed URLs, and Realtime. Use when `package.json` lists `@supabase/supabase-js`, `@supabase/ssr`, or `@supabase/auth-helpers-*`, when a `supabase/` directory, `config.toml`, or `SUPABASE_URL`/`SUPABASE_ANON_KEY` env vars are present, or when asked directly (Thai or English) to ต่อ/ตั้งค่า Supabase, เขียน RLS policy, หรือทำ auth ด้วย Supabase. Not a replacement for `skills/postgres/SKILL.md` — Supabase is Postgres, so all of its type, index, EXPLAIN, and locking rules apply underneath; this skill is only what Supabase adds on top.
- Reads credentials
32 other projects use a version of this.
Adopted by
Most recently taken up by
- r2hu1/openbotstheir own version, first seen Oct 4, 2026
- nafiskabbo/skillstheir own version, first seen Sep 23, 2026
- NiazMorshed2007/jcrtheir own version, first seen Sep 20, 2026
- PracticalSwan/agent-skillstheir own version, first seen Sep 14, 2026
- irwebtools/Product-Skillstheir own version, first seen Sep 9, 2026
- PentesterFlow/agenttheir own version, first seen Aug 31, 2026
Used with
Projects with it also use vercel and testing.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillvercel
Deploy and inspect Vercel apps, assign aliases, delete deployments, investigate logs, and monitor deployment outcomes. Use for Vercel deployment and log requests, not GitHub code changes or other cloud providers.
Also in 5 projects that use this
NVIDIASkilltesting
Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.
Also in 3 projects that use this
Other versions32 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 32
- openai/plugins★ 7.3ksame name
- supabase/agent-skills★ 2.7ksame name
- PentesterFlow/agent★ 1.4ksame name
- alinaqi/maggy★ 707same name
- nth5693/gemini-kit★ 373same name
- Mindrally/skills★ 266same name
- magnus919/agent-skills★ 109same name
- Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations★ 73same name
- Kastalien-Research/thoughtbox★ 66same name
- salavender/antigravity-compound-engineering-plugin★ 48same name
22 more not listed
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 repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- agent-flowSkill
- dev-testingSkill
- dry-and-corSkill
- electronSkill
- firebaseSkill
- flutterSkill
- google-authSkill
- html-cssSkill
- mysqlSkill
- nodejsSkill
- postgresSkill
- reactSkill
- sqliteSkill
- stack-briefingSkill
- tailwindSkill
- tursoSkill
- typescriptSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 6 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 29 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Check package.json for @supabase/supabase-js, @supabase/ssr, or an auth-helpers package.
- Distinctive: line 67
Test policies from the perspective of a real anon and a real authenticated user, not with the service key, which sails past all of them.
- Very specific: line 101
Run supabase start locally so tests and probes hit a local stack rather than a shared cloud project.
- Distinctive: line 105
Never point automated tests or a destructive script at a production project — check which project ref is linked before running anything …
- Very specific: line 111
Edge Functions: run on Deno, not Node: node: builtins and npm packages need the supported import form, and the runtime is not the one …
- Distinctive: line 134
Use nested selects for related rows in one request instead of a query per row.
- Very specific: line 142
Run Supabase's advisors (security and performance) after schema changes — unindexed foreign keys, missing RLS, and mutable search_path …
- Very specific: line 161
Don't put the service_role/secret key anywhere the browser can reach it, and don't treat a leak as fixed without rotating.
- Very specific: line 163
Don't leave RLS off on any table in an exposed schema, and don't rely on a client-side .eq() filter for authorization.
- Very specific: line 165
Don't write an update policy with USING alone.
- Very specific: line 166
Don't store or read roles/entitlements in user_metadata.
- Very specific: line 167
Don't make an authorization decision from getSession() on the server.
- Distinctive: line 168
Don't change schema, policies, or functions through the dashboard instead of a migration file.
- Distinctive: line 170
Don't test policies with the service key, and don't run destructive scripts against a linked production project.
- Distinctive: line 172
Don't make a Storage bucket public to solve an access problem — sign the URL.
- Very specific: line 174
Don't restate Postgres's own type/index/locking rules here.
“Common” is measured: kept by at least 6 in 10 of the 29 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Supabase
Supabase is Postgres plus an auto-generated API, an auth service, storage,
and Deno-based Edge Functions. skills/postgres/SKILL.md is the base layer —
types, indexes, EXPLAIN (ANALYZE, BUFFERS), MVCC and locking, pooling and
migration safety all apply unchanged. This skill covers only what Supabase
adds, and most of that is about a trust boundary that does not exist in a
normal server-only Postgres deployment: the database is reachable directly
from the browser.
Step 1 — Confirm Supabase is actually in play
Check package.json for @supabase/supabase-js, @supabase/ssr, or an
auth-helpers package; a supabase/ folder with config.toml and
migrations/; or SUPABASE_URL/SUPABASE_ANON_KEY in .env.example. If
the project only talks to a Postgres connection string that happens to be
hosted by Supabase, with no client SDK and no RLS in play, treat it as plain
Postgres.
Step 2 — The two keys are a security boundary
- The anon / publishable key is designed to be public. It ships in the browser bundle and grants exactly what RLS policies allow — no more. Its exposure is not a vulnerability; missing RLS is.
- The
service_role/ secret key bypasses RLS entirely. It belongs only in server-side code (a route handler, an Edge Function, a job) and only in a server-only environment variable. Never underNEXT_PUBLIC_/VITE_/EXPO_PUBLIC_, never in a client component, never in a mobile app, never committed. - A leaked
service_rolekey is a full database compromise. Treat finding one in client-reachable code as a stop-everything finding, route it throughsecurity-auditor, and rotate the key — deleting the line from the source does not un-publish it if it ever shipped or was committed. - Instantiate two clearly named clients (browser vs server/admin) rather than one that picks a key by condition; the conditional is exactly where the mistake happens.
Step 3 — RLS is the authorization layer
- Enable RLS on every table in an exposed schema, including join tables,
lookup tables, and views' underlying tables. A table without RLS in the
publicschema is readable and writable by anyone holding the public key. Supabase's advisors flag this; check them rather than assuming. - RLS default-denies once enabled: no policy means no access. Write one
policy per operation (
select,insert,update,delete) rather than a singlefor all— the four cases genuinely differ. USINGfilters the rows a statement may see or touch;WITH CHECKconstrains the rows it may produce. Anupdatepolicy with onlyUSINGlets a user edit their own row into someone else's ownership —updateneeds both,insertneedsWITH CHECK.- Compare against
(select auth.uid())and index the column the policy filters on. An unindexeduser_idin a policy predicate turns every query into a scan, and wrappingauth.uid()in aselectlets the planner evaluate it once instead of per row. - Policies are the enforcement; a
.eq('user_id', currentUser.id)filter in client code is a convenience the caller can simply remove. Never rely on the client's filter for authorization. - Anything requiring privileged logic goes in a
security definerfunction with a pinnedsearch_pathand a narrow signature — not in a broader policy. Be deliberate: asecurity definerfunction is a hole you are opening on purpose. - Test policies from the perspective of a real anon and a real authenticated user, not with the service key, which sails past all of them.
Step 4 — Auth
- On the server, validate the session with
supabase.auth.getUser(), which verifies the JWT against the auth server.getSession()returns whatever is in storage/cookies without revalidating — fine for rendering a UI state, not for an authorization decision. user_metadatais writable by the user. Roles, plan tiers, and entitlements go inapp_metadataor a table governed by RLS, never inuser_metadata— a role check against it is a privilege-escalation bug.- Configure the redirect URL allowlist explicitly and keep email confirmation on; an open redirect in the auth callback is a real account takeover path.
- Mirror auth users into a
profilestable (trigger onauth.usersinsert) rather than joining against theauthschema from application queries. - In SSR frameworks, use
@supabase/ssrwith cookie storage so the server and client see the same session, and refresh in middleware — alocalStorage-based session is invisible to the server render and shows up as a flash of logged-out UI or a redirect loop. - Social sign-in providers (including Google) are configured here, but the
OAuth/OIDC correctness rules — ID token verification,
state/nonce, scopes, refresh handling — areskills/google-auth/SKILL.md.
Step 5 — Migrations and local development
- Schema lives in
supabase/migrations/in the repo, generated withsupabase migration new/supabase db diffand applied withsupabase db pushor CI. Changes clicked into the dashboard leave no diff to review, don't reach other environments, and get silently overwritten by the next push. - RLS policies, triggers, functions, and grants are schema — they belong in migrations too, not applied by hand.
- Run
supabase startlocally so tests and probes hit a local stack rather than a shared cloud project.supabase db reset+ seed data gives a reproducible state, which is whatskills/dev-testing/SKILL.md's database-delta check needs. - Never point automated tests or a destructive script at a production project — check which project ref is linked before running anything that writes.
Step 6 — Edge Functions, Storage, Realtime
- Edge Functions run on Deno, not Node:
node:builtins and npm packages need the supported import form, and the runtime is not the oneskills/nodejs/SKILL.mdassumes. Read secrets from the function's own env (set via the CLI), keep JWT verification on unless the endpoint is genuinely public, and remember an inbound webhook can't present a user JWT — verify the provider's signature instead. - Storage buckets are private by default and access is governed by
policies on
storage.objects, in the same RLS model as tables. Serve private files with time-limited signed URLs, not by flipping the bucket public; validate content type and size on upload rather than trusting the client's declared type. - Realtime subscriptions respect RLS for Postgres changes, but only once the publication and RLS are configured — enabling replication on a table with no RLS broadcasts every row change to every subscriber. Subscribe to the narrowest filter, and unsubscribe on unmount or the channel leaks.
- The auto-generated PostgREST API exposes every table in
public; keep internal tables in a non-exposed schema instead of relying on nobody guessing the name.
Step 7 — Performance and cost shape
- The client library is PostgREST —
select('*')fetches every column including large text/JSON; select the columns actually used. - Use nested selects for related rows in one request instead of a query per row; an N+1 here is N HTTP round trips.
- Paginate with
range()/keyset rather than fetching a whole table into the browser and slicing it, and set an explicitcountstrategy only when the count is actually displayed — an exact count on a large table is a scan. - Serverless deployments should connect through the pooler, with the
transaction-mode caveats in
skills/postgres/SKILL.md(no session state, no named prepared statements); use the direct connection for migrations. - Run Supabase's advisors (security and performance) after schema changes —
unindexed foreign keys, missing RLS, and mutable
search_pathfunctions surface there.
Step 8 — Self-check before reporting done
Confirm no service_role/secret key is reachable from client code or a
public env var. Confirm every new table has RLS enabled with per-operation
policies, that update policies carry both USING and WITH CHECK, and
that policy predicate columns are indexed. Confirm server-side authorization
uses getUser() and reads roles from app_metadata or an RLS-governed
table, never user_metadata. Confirm every schema and policy change exists
as a committed migration and was applied to a local stack first. Confirm the
advisors are clean for what changed, then verify the feature end to end with
skills/dev-testing/SKILL.md as a non-privileged user — a query that works
with the service key proves nothing about what a real user can do.
What not to do
- Don't put the
service_role/secret key anywhere the browser can reach it, and don't treat a leak as fixed without rotating. - Don't leave RLS off on any table in an exposed schema, and don't rely on a
client-side
.eq()filter for authorization. - Don't write an
updatepolicy withUSINGalone. - Don't store or read roles/entitlements in
user_metadata. - Don't make an authorization decision from
getSession()on the server. - Don't change schema, policies, or functions through the dashboard instead of a migration file.
- Don't test policies with the service key, and don't run destructive scripts against a linked production project.
- Don't make a Storage bucket public to solve an access problem — sign the URL.
- Don't restate Postgres's own type/index/locking rules here; they live in
skills/postgres/SKILL.md.
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.

