A Claude Code skill that generates Supabase migrations with RLS policies from feature requirements.
Author: Mehdi Michiels
- Supabase CLI setup help: Checks for CLI installation and offers guided setup
- Template-driven generation: Choose from four proven ownership patterns
- Dev-first workflow: RLS policies are commented out for fast iteration
- Battle-tested patterns: Reusable policy library with common scenarios
- Validation checklists: Specific test queries to verify policies work
- Helper scripts: Setup and testing automation included
- Single-user SaaS: Users own their data (
auth.uid() = user_id) - Multi-tenant: Teams own data, members have roles
- Public + Auth hybrid: Anonymous read, authenticated write
- Admin-only: Backoffice and CMS patterns
cd ~/.claude/skills
git clone https://github.com/mehdimichiels/supabasepower.gitcd your-project
git clone https://github.com/mehdimichiels/supabasepower.git .claude/skills/supabasepowercd your-project
git submodule add https://github.com/mehdimichiels/supabasepower.git .claude/skills/supabasepowerRun the setup helper:
./scripts/setup-supabase.shThis will:
- Check and install Supabase CLI if needed
- Initialize your Supabase project
- Start local development environment
In Claude Code, say:
Use the supabasepower skill to generate a migration for my blog posts feature.
The skill will:
- Ask about your ownership pattern
- Ask pattern-specific questions
- Generate migration file in
supabase/migrations/ - Provide validation checklist with test queries
Fast Iteration (RLS disabled):
# Migration has RLS sections commented out
supabase db reset
# Build your features, test without auth frictionPre-Production (Enable RLS):
# Uncomment RLS sections in migration file
supabase db reset
# Run validation tests from skill output
# Fix any policy issuesDeploy to Production:
supabase db push --db-url $STAGING_URL # Test in staging first
supabase db push --db-url $PRODUCTION_URLSee examples/ directory:
blog-posts.md- Public read, auth writetodo-app.md- Single-user SaaSworkspace-docs.md- Multi-tenantadmin-panel.md- Admin-only
See policies/library.md for reusable patterns:
- user-owns-row
- user-in-team
- is-admin
- public-read-auth-write
- team-member-read
- team-admin-write
- Supabase project initialized (
supabase init) - Supabase CLI installed (
brew install supabase/tap/supabase) - PostgreSQL knowledge (basic)
Found a bug or have a pattern to add? Open an issue or PR!
MIT - Use freely, attribute Mehdi Michiels
Built by Mehdi Michiels Powered by Claude Code superpowers