supabase
Skill1 starsChanged 22 days agoMITView on GitHub
Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies, getSession, getUser, getClaims, RLS); Supabase CLI or MCP server; schema changes, migrations, declarative schemas, security audits, Postgres extensions (pg_graphql, pg_cron, pg_vector); debugging and troubleshooting errors or unexpected behavior on Supabase projects (HTTP errors, Postgres errors, RLS surprises, permission denied, schema cache issues, timeouts, Edge Function crashes, Realtime drops, Storage failures) and reading or querying logs (Logs Explorer, ClickHouse).
- Reads credentials
60 other projects use a version of this, 31 of them edited; 5 new projects in the last 4 weeks, against 1 the 4 before.
Adopted by
Surging: 5 new projects took it in the last 4 weeks, 5× the 4 weeks before.thin data
Most recently taken up by
- schornai/schornaiword for word, first seen Nov 8, 2026
- midudev/bigibai-2025word for word, first seen Nov 1, 2026
- sunavoine-sys/Claude-Skillsword for word, first seen Nov 1, 2026
- darknecrocities/SkillBuildertheir own version, first seen Nov 1, 2026
- domhhv/habitrackword for word, first seen Oct 25, 2026
- diegovasquez-ai/skills-apptheir own version, first seen Oct 25, 2026
Used with
Projects with it also use firebase, vercel and 10 more.
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.
xfstudioSkillfirebase
Firebase gives you a complete backend in minutes - auth, database, storage, functions, hosting. But the ease of setup hides real complexity. Security rules are your last line of defense, and they're often wrong. Firestore queries are limited, and you learn this after you've designed your data model. This skill covers Firebase Authentication, Firestore, Realtime Database, Cloud Functions, Cloud Storage, and Firebase Hosting. Key insight: Firebase is optimized for read-heavy, denormalized data. I
Also in 5 projects that use this
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 4 projects that use this
ffsshhttiikkSkillflutter
Flutter cross-platform framework
Also in 3 projects that use this
VercelSkillreact-native
React Native renderer for json-render that turns JSON specs into native mobile UIs. Use when working with @json-render/react-native, building React Native UIs from JSON, creating mobile component catalogs, or rendering AI-generated specs on mobile.
Also in 3 projects that use this
VercelSkillvercel-optimize
Use for Vercel cost and performance optimization on deployed projects, especially Next.js, SvelteKit, Nuxt, and limited Astro apps. Collect Vercel metrics, usage, project config, and code scan results first; investigate only metric-backed candidates; produce ranked recommendations grounded in verified files and version-aware Vercel/framework docs. Trigger for Vercel bill reduction, slow or expensive routes, caching opportunities, Function Invocations, Build Minutes, Fast Data Transfer, Core Web Vitals, Bot Management, Fluid compute, or cost breakdown requests.
Also in 3 projects that use this
wewpellex21Skillbackend
Servers, routes, APIs, and backend architecture. Activated when Claude creates server-side code, API routes, or Express/Fastify/Next.js API handlers.
Also in 3 projects that use this
- +2 more from vercel-labs
Other versions60 projects use a version of this.
Word for word · 7
- supabase/agent-skills★ 2.8k100% same
- midudev/bigibai-2025★ 128100% same
- r2hu1/openbots★ 12100% same
- schornai/schornai★ 9100% same
- domhhv/habitrack★ 8100% same
- nafiskabbo/skills★ 1100% same
- sunavoine-sys/Claude-Skills★ 0100% same
Edited · 31
- openai/plugins★ 7.8k97% same
- FidelusAleksander/ghcertified★ 99695% same
- imbhargav5/nextbase-nextjs-supabase-starter★ 82799% same
- PracticalSwan/agent-skills★ 2284% same
- NiazMorshed2007/jcr★ 1999% same
- ruloCode/hermes-os★ 1697% same
- assaf/expense★ 699% same
- minhdevtry/AI-Teacher-Assistant-Agent★ 497% same
- trancethehuman/template-next-agent★ 399% same
- Adhamxon/claude-code-skills★ 292% same
21 more not listed
Wrote their own version · 22
- alinaqi/maggy★ 711same name
- alinaqi/claude-bootstrap★ 708same name
- Heyvhuang/ship-faster★ 337same name
- Mindrally/skills★ 275same name
- magnus919/agent-skills★ 172same name
- Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations★ 73same name
- Kastalien-Research/thoughtbox★ 64same name
- salavender/antigravity-compound-engineering-plugin★ 48same name
- alanalvestech/hitank★ 38same name
- G1Joshi/Agent-Skills★ 15same name
12 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 repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- gemini-api-devSkill
- supabase-postgres-best-practicesSkill
- typesafe-aiSkill
The file
We split this skill into the rules it gives an agent
12 rules. 4 are common, 1 is distinctive, and 7 are very specific to this project.
4
Common
Most of the 51 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Do not rely on training data for Supabase features.
- Common: line 19
After implementing any fix, run a test query to confirm the change works.
- Common: line 34
When working on any Supabase task that touches auth, RLS, views, storage, or user data, run through this checklist.
- Very specific: line 74
Always pin package versions and commit lockfiles: when installing Supabase packages (supabase-js, @supabase/ssr, supabase-py, etc.).
- Very specific: line 80
Always discover commands via --help — never guess.
- Very specific: line 95
Version check and upgrade: Run supabase --version to check.
- Very specific: line 108
Verify the project root has a valid .mcp.json with the correct server URL.
- Very specific: line 111
If the server is reachable and .mcp.json is correct but tools aren't visible, the user needs to authenticate.
- Common: line 119
Before implementing any Supabase feature, find the relevant documentation.
- Very specific: line 131
Use this when supabase/schemas/ exists or config.toml sets schema_paths.
- Distinctive: line 135
Use this when the project does not use declarative schemas.
- Common: line 144
Review the Security Checklist above: if your changes involve views, functions, triggers, or storage.
“Common” is measured: kept by at least 6 in 10 of the 51 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
Core Principles
1. Supabase changes frequently — verify against changelog and current docs before implementing. Do not rely on training data for Supabase features. Function signatures, config.toml settings, and API conventions change between versions.
First, fetch https://supabase.com/changelog.md (a lightweight summary index — not a heavy pull), scan for breaking-change tags relevant to your task, and follow the linked page for any that apply. Then look up the relevant topic using the documentation access methods below.
2. Verify your work. After implementing any fix, run a test query to confirm the change works. A fix without verification is incomplete.
3. Recover from errors, don't loop. If an approach fails after 2-3 attempts, stop and reconsider. Try a different method, check documentation, inspect the error more carefully, and review relevant logs when available. Supabase issues are not always solved by retrying the same command, and the answer is not always in the logs, but logs are often worth checking before proceeding.
4. Exposing tables to the Data API: Depending on the user's Data API settings, newly created tables may not be automatically exposed via the Data (REST) API. If this is the case, anon and authenticated roles will need to be explicitly granted access.
Note that this is separate from RLS, which controls which rows are visible once a table is accessible, not whether the table is accessible at all.
When a user reports a SQL-created table is unexpectedly inaccessible, check their Data API settings and whether the roles have been granted access via explicit GRANT SQL. When granting public (anon/authenticated) access, always enable RLS too. See Exposing a Table to the Data API for the full setup workflow.
5. RLS in exposed schemas.
Enable RLS on every table in any exposed schema, which includes public by default. This is critical in Supabase because tables in exposed schemas can be reachable through the Data API when the anon/authenticated roles have access (see Exposing a Table to the Data API). For private schemas, prefer RLS as defense in depth. After enabling RLS, create policies that match the actual access model rather than defaulting every table to the same auth.uid() pattern.
6. Security checklist. When working on any Supabase task that touches auth, RLS, views, storage, or user data, run through this checklist. These are Supabase-specific security traps that silently create vulnerabilities:
- Auth and session security
- Never use
user_metadataclaims in JWT-based authorization decisions. In Supabase,raw_user_meta_datais user-editable and can appear inauth.jwt(), so it is unsafe for RLS policies or any other authorization logic. Store authorization data inraw_app_meta_data/app_metadatainstead. - Deleting a user does not invalidate existing access tokens. Sign out or revoke sessions first, keep JWT expiry short for sensitive apps, and for strict guarantees validate
session_idagainstauth.sessionson sensitive operations. - If you use
app_metadataorauth.jwt()for authorization, remember JWT claims are not always fresh until the user's token is refreshed.
- Never use
- API key and client exposure
- Never expose the
service_roleor secret key in public clients. Prefer publishable keys for frontend code. Legacyanonkeys are only for compatibility. In Next.js, anyNEXT_PUBLIC_env var is sent to the browser. - Use scoped personal access tokens for the Management API, CLI, and MCP server. A classic personal access token carries the user's full account access, on every organization and project. For scripts, CI, and agents, have the user create a scoped token limited to the organizations, projects, and permissions the task needs. The personal access tokens guide lists the permission each Management API endpoint and MCP tool requires. Look permissions up there rather than guessing.
- Never expose the
- RLS, views, and privileged database code
- Views bypass RLS by default. In Postgres 15 and above, use
CREATE VIEW ... WITH (security_invoker = true). In older versions of Postgres, protect your views by revoking access from theanonandauthenticatedroles, or by putting them in an unexposed schema. - UPDATE requires a SELECT policy. In Postgres RLS, an UPDATE needs to first SELECT the row. Without a SELECT policy, updates silently return 0 rows — no error, just no change.
auth.role()is deprecated — use theTOclause instead. Supabase has deprecatedauth.role()in favour of specifying the target role directly on the policy withTO authenticatedorTO anon. Beyond deprecation,auth.role() = 'authenticated'breaks silently when anonymous sign-ins are enabled, because anonymous users carry theauthenticatedPostgres role and pass the check regardless of whether the user is genuinely signed in.-- Deprecated (do not use) create policy "example" on table_name for select using ( auth.role() = 'authenticated' );TO authenticatedalone is authentication without authorization (BOLA / IDOR). UsingTO authenticatedonly checks the role — it does not restrict which rows a user can access. The correct pattern combinesTO authenticatedwith an ownership predicate inUSING:create policy "example" on table_name for select to authenticated using ( (select auth.uid()) = user_id );- UPDATE policies require both
USINGandWITH CHECK. WithoutWITH CHECK, a user can reassign a row'suser_idto another user:create policy "example" on table_name for update to authenticated using ( (select auth.uid()) = user_id ) with check ( (select auth.uid()) = user_id ); SECURITY DEFINERfunctions bypass RLS. ASECURITY DEFINERfunction runs with its creator's privileges — typically a role withbypassrls(e.g.,postgres). Never addSECURITY DEFINERto resolve a permission error; it silently removes access control without fixing the underlying cause. PreferSECURITY INVOKER.SECURITY DEFINERfunctions inpublicare callable by all roles. Postgres grantsEXECUTEtoPUBLICby default for every new function, so anySECURITY DEFINERfunction inpublicis a public API endpoint callable byanonandauthenticated(which inherit fromPUBLIC) without any additional grant. WhenSECURITY DEFINERis genuinely needed (e.g., bypassing RLS on an internal lookup table), keep the function in a non-exposed schema, always include anauth.uid()check in the function body, and runsupabase db advisorsafter making changes.
- Views bypass RLS by default. In Postgres 15 and above, use
- Storage access control
- Storage upsert requires INSERT + SELECT + UPDATE. Granting only INSERT allows new uploads but file replacement (upsert) silently fails. You need all three.
- Dependency and supply-chain security
- Always pin package versions and commit lockfiles when installing Supabase packages (
supabase-js,@supabase/ssr,supabase-py, etc.). See the npm security guide for the full checklist.
- Always pin package versions and commit lockfiles when installing Supabase packages (
For any security concern not covered above, fetch the Supabase product security index: https://supabase.com/docs/guides/security/product-security.md
Supabase CLI
Always discover commands via --help — never guess. The CLI structure changes between versions.
supabase --help # All top-level commands
supabase <group> --help # Subcommands (e.g., supabase db --help)
supabase <group> <command> --help # Flags for a specific commandSupabase CLI Known gotchas:
supabase db queryrequires CLI v2.79.0+ → use MCPexecute_sqlorpsqlas fallbacksupabase db advisorsrequires CLI v2.81.3+ → use MCPget_advisorsas fallback- The browser flow of
supabase logincreates a classic token with full account access. In CI, setSUPABASE_ACCESS_TOKENto a scoped personal access token instead. It takes precedence over any saved login. Commands that connect with the database password (--passwordorSUPABASE_DB_PASSWORD, for examplesupabase db push) aren't limited by the token's permissions. - In imperative migration projects, create new hand-authored migration files with
supabase migration new <name>first. Never invent a migration filename or rely on memory for the expected format. Declarative schema projects generate migrations fromsupabase/schemas/; see "Making and Committing Schema Changes" below.
Version check and upgrade: Run supabase --version to check. For CLI changelogs and version-specific features, consult the CLI documentation or GitHub releases.
Supabase MCP Server
For setup instructions, server URL, and configuration, see the MCP setup guide.
Troubleshooting connection issues — follow these steps in order:
- Check if the server is reachable:
curl -so /dev/null -w "%{http_code}" https://mcp.supabase.com/mcpA401is expected (no token) and means the server is up. Timeout or "connection refused" means it may be down. - Check
.mcp.jsonconfiguration: Verify the project root has a valid.mcp.jsonwith the correct server URL. If missing, create one pointing tohttps://mcp.supabase.com/mcp. - Authenticate the MCP server:
If the server is reachable and
.mcp.jsonis correct but tools aren't visible, the user needs to authenticate. The Supabase MCP server uses OAuth 2.1 — tell the user to trigger the auth flow in their agent, complete it in the browser, and reload the session. In CI or other environments where the browser flow can't run, pass a scoped personal access token in theAuthorization: Bearerheader instead. - Check scoped token permissions: If a tool fails with "You do not have permission to perform this action" while using a scoped personal access token, the token lacks that tool's permission or the project is outside the token's scope. Check the tool's required permission in the personal access tokens guide.
Supabase Documentation
Before implementing any Supabase feature, find the relevant documentation. Use these methods in priority order:
- MCP
search_docstool (preferred — returns relevant snippets directly) - Fetch docs pages as markdown — any docs page can be fetched by appending
.mdto the URL path. - Web search for Supabase-specific topics when you don't know which page to look at.
Making and Committing Schema Changes
First decide which schema workflow the project uses.
Option A: Declarative schemas
Use this when supabase/schemas/ exists or config.toml sets schema_paths. Edit the desired schema state in those files, then generate and review the migration. Do not start by hand-writing a migration. See the Declarative database schemas guide.
Option B: Imperative migrations
Use this when the project does not use declarative schemas.
To make schema changes, use execute_sql (MCP) or supabase db query (CLI). These run SQL directly on the database without creating migration history entries, so you can iterate freely and generate a clean migration when ready.
Do NOT use apply_migration to change a local database schema — it writes a migration history entry on every call, which means you can't iterate, and supabase db diff / supabase db pull will produce empty or conflicting diffs. If you use it, you'll be stuck with whatever SQL you passed on the first try.
When ready to commit your changes to a migration file:
- Run advisors →
supabase db advisors(CLI v2.81.3+) or MCPget_advisors. Fix any issues. - Review the Security Checklist above if your changes involve views, functions, triggers, or storage.
- Generate the migration →
supabase db pull <descriptive-name> --local --yes - Verify →
supabase migration list --local
Debugging
When you get an error on a Supabase-related request, for example an error code from the Supabase REST API, Postgres database, or PostgREST, an empty result, getting blocked by RLS unexpectedly, or an error from a Supabase service like Auth, Realtime, Edge Functions, or Storage, you must fetch Supabase's Monitoring and Debugging documentation before diagnosing or proposing a fix, rather than working from memory. The same docs also cover performance optimizations, such as slow queries and missing indexes.
Reference Guides
- Skill Feedback → references/skill-feedback.md MUST read when the user reports that this skill gave incorrect guidance or is missing information.
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.

