amnafarzy/ravie/supabase-guardian
Claude Code and agent skill by amnafarzy/ravie
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Use this whenever touching Supabase: tables, columns, indexes, migrations, RLS policies, auth flows, storage policies, edge functions, or service-role keys — even if the user just says "add a field". Every schema change gets a migration; every user-facing table gets RLS.
Install
npx vskill@latest install amnafarzy/ravie/supabase-guardianSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as amnafarzy/ravie/supabase-guardian.
supabase-guardian
Review every database, auth, and RLS change before it ships. The skill that prevents "it works in dev" from becoming "users can see each other's data in prod."
Purpose
Gate all Supabase changes — schema, RLS, auth, storage, edge functions — through a structured review. No DB change ships without passing this.
Process
0. Read the Supabase rule reference first
Before reviewing or changing anything, read rules/supabase.md. If the change also touches UI or Git operations, read rules/ui.md or rules/git.md as appropriate.
1. Review the migration file
List every table, column, index, function, trigger, policy, and storage bucket touched. Flag destructive operations (DROP, TRUNCATE, broad UPDATE/DELETE) before running anything.
2. Apply from a clean local database
Run migrations from scratch before trusting an incremental local state:
If reset is too destructive for the current machine, stop and state that the migration was not fully verified from a clean baseline.
3. Verify RLS is enabled per public table
Check the actual database state, not only the migration text:
Every user-facing table must have relrowsecurity = true. Internal lookup tables may be exempt only when the reason is documented.
4. Inspect policies per changed table
For every changed table, inspect policies directly:
Check SELECT, INSERT, UPDATE, and DELETE separately. Verify owner scoping uses auth.uid() or an equivalent tenant/user boundary.
Example review:
5. Service-role audit
Find service-role usage before approving:
Rules:
- Service-role clients must stay in server-only code paths.
- They must not be imported in files with a
'use client'directive. - They must not be imported by modules that client components can transitively reach.
src/app/api/, server actions, and server components may use service-role clients when the code path is server-only and the key is not exposed asNEXT_PUBLIC_.
6. Regenerate and inspect types
After any schema migration, regenerate types and confirm the diff matches the migration:
7. Test with actual user context
Do not test RLS with service-role. Use an anon key plus a JWT for a real test user. Attempt the operations the policy should allow and the operations it should block. The review is blocked until denied operations actually fail.
Test pattern:
- Sign in as user A and create/read/update only user A data.
- Attempt to read or mutate user B data and confirm it fails.
- Attempt unauthenticated access where relevant and confirm it fails.
- Repeat for each changed table and storage bucket policy.
Output format
Hard rules
- Never ship a user-facing table without RLS enabled
- Never weaken RLS to fix a frontend bug — fix the frontend
- Never import service-role client in client-side code
- Never test RLS with service-role bypass only
- Always regenerate types after migration
Connects to
issue-to-pr— invoked during implementation when DB is touchedcurrent-docs-guard— verify Supabase API patterns are currentdeploy-ready— complementary pre-deploy checksecurity-auditoragent — for deeper auth/access review
Common failure modes
RLS "works" because you tested with service-role — Service-role bypasses all RLS. You must test as an actual authenticated user.
Frontend workaround for RLS — "The query doesn't return data, so I'll disable RLS on that table." No. Fix the policy or the query.
Forgetting to regenerate types — Schema changed but TypeScript types are stale. Runtime works, types lie. Always regenerate.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/supabase-guardian/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/amnafarzy/ravie/supabase-guardian)