supabase

Guides Supabase development tasks including migrations, RLS policies, auth, and CLI workflows.

Updated Jan 31, 2023
One-click install
npx skills add https://github.com/Briian3306/Transporte --skill supabase-briian3306
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: supabase
Source: https://github.com/Briian3306/Transporte/tree/main/ibarra-app/.agents/skills/supabase
Command: npx skills add https://github.com/Briian3306/Transporte --skill supabase-briian3306

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve? Supabase APIs, CLI commands, and security conventions change frequently, and AI agents relying on stale training data produce broken migrations, insecure RLS policies, and deprecated auth patterns. This Skill grounds every Supabase task in current documentation, changelogs, and a security checklist. ## Core Features & Use Cases - Security checklist enforcement: Catches Supabase-specific traps like user_metadata in JWT authorization, views bypassing RLS, SECURITY DEFINER functions exposed in public schemas, and BOLA/IDOR vulnerabilities in policies. - Schema change workflow: Directs agents to iterate with execute_sql or supabase db query, run advisors, then commit clean migrations via supabase db pull instead of polluting migration history. - CLI and MCP guidance: Covers command discovery via --help, version-specific gotchas, and step-by-step MCP server connection troubleshooting. - Use Case: When adding a new table with row-level security in a Next.js app, the agent checks the changelog for breaking changes, writes policies using TO authenticated with ownership predicates, and verifies the result with a test query. ## Quick Start Ask the agent to create a Supabase migration that adds a posts table with RLS policies restricting access to each row's owner.

Frequently Asked Questions about supabase

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a secure RLS policy in Supabase?▼

Combine TO authenticated with an ownership predicate in USING, such as (select auth.uid()) = user_id. For UPDATE policies, include both USING and WITH CHECK so users cannot reassign rows to other owners.

How do I create a Supabase migration without breaking history?▼

Iterate on schema changes using execute_sql via MCP or supabase db query, which avoid writing migration history entries. When ready, run supabase db advisors, then commit with supabase db pull <name> --local --yes.

Why is my Supabase table not accessible via the Data API?▼

Newly created tables may not be auto-exposed depending on your Data API settings, so anon and authenticated roles need explicit GRANT statements. This is separate from RLS, which controls row visibility after table access is granted.

Why is auth.role() deprecated in Supabase RLS policies?▼

Supabase deprecated auth.role() in favor of the TO clause on policies. It also breaks silently with anonymous sign-ins, since anonymous users carry the authenticated Postgres role and pass the check regardless.

How do I fix Supabase MCP server connection issues?▼

First curl https://mcp.supabase.com/mcp and expect a 401, which confirms the server is up. Then verify your .mcp.json points to the correct URL, and finally complete the OAuth 2.1 browser flow and reload the session.

Can I use user_metadata for authorization in Supabase?▼

No, raw_user_meta_data is user-editable and can appear in auth.jwt(), making it unsafe for RLS or authorization logic. Store authorization data in app_metadata instead, and remember JWT claims are not fresh until token refresh.