/supabase:rls-templatesfrom supabase
Provides Row Level Security policy templates for Supabase with multi-tenant, user isolation, role-based, and AI-specific patterns. Includes scripts to apply, test, and audit policies.
Ships in supabase. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Production-ready Row Level Security policy templates for Supabase applications, with focus on AI application patterns (multi-tenant chat, RAG systems, user-specific embeddings).
Apply policies to tables:
# Apply user isolation policies
bash scripts/apply-rls-policies.sh user-isolation conversations messages
# Apply multi-tenant policies
bash scripts/apply-rls-policies.sh multi-tenant organizations org_members documents
# Apply AI-specific policies
bash scripts/apply-rls-policies.sh ai-chat conversations messages message_embeddings
Generate custom policy:
# Generate policy from template
bash scripts/generate-policy.sh user-isolation my_table user_id
# Generate with custom column
bash scripts/generate-policy.sh multi-tenant projects organization_id
Test policies work correctly:
# Test all policies on a table
bash scripts/test-rls-policies.sh conversations
# Test specific user context
bash scripts/test-rls-policies.sh messages --user-id "user-uuid-here"
# Test multi-tenant isolation
bash scripts/test-rls-policies.sh documents --org-id "org-uuid-here"
Audit tables for missing RLS:
# Audit all tables in public schema
bash scripts/audit-rls.sh
# Audit specific tables
bash scripts/audit-rls.sh conversations messages embeddings
# Generate audit report
bash scripts/audit-rls.sh --report audit-report.md
Choose the right pattern:
user-isolation.sql: User owns row directly (user_id column)
auth.uid() = user_idmulti-tenant.sql: Organization/team-based isolation
role-based-access.sql: Different permissions per role
auth.jwt() claimsai-chat-policies.sql: Chat/conversation data
embeddings-policies.sql: Vector/embedding data
Example 1: Secure Chat Application
-- Apply chat policies to tables
\i templates/ai-chat-policies.sql
-- Tables: conversations, messages, participants
-- Result: Users only see conversations they participate in
Example 2: Multi-Tenant RAG System
-- Apply organization isolation
\i templates/multi-tenant.sql
-- Apply embedding security
\i templates/embeddings-policies.sql
-- Tables: organizations, documents, document_embeddings
-- Result: Each org only sees their own documents and embeddings
Example 3: Role-Based Admin Panel
-- Apply role-based policies
\i templates/role-based-access.sql
-- Roles: admin (full access), editor (read/write), viewer (read-only)
-- Result: Different permissions based on user role
psql) installedSUPABASE_DB_URL: PostgreSQL connection stringSUPABASE_ANON_KEY: For testing anon accessSUPABASE_SERVICE_KEY: For admin operations(SELECT auth.uid()) for performanceCREATE INDEX idx_table_user_id ON table(user_id);(SELECT auth.uid()) instead of auth.uid().eq('user_id', userId) in client codeTO authenticated to skip anon checksBest Practices:
README.md (opens in a new tab)VALIDATION.md (opens in a new tab)examples/common-patterns.md (opens in a new tab)examples/migration-guide.md (opens in a new tab)examples/testing-guide.md (opens in a new tab)scripts/apply-rls-policies.sh (opens in a new tab)scripts/audit-rls.sh (opens in a new tab)scripts/generate-policy.sh (opens in a new tab)scripts/test-rls-policies.sh (opens in a new tab)templates/ai-chat-policies.sql (opens in a new tab)templates/embeddings-policies.sql (opens in a new tab)templates/multi-tenant.sql (opens in a new tab)templates/role-based-access.sql (opens in a new tab)templates/user-isolation.sql (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vanman2024/ai-dev-marketplace --plugin supabase8 skills in this plugin
/agentic-platform-schemaAgentic Platform Contract tables for AI agent applications - runs, events, artifacts, and tool calls tracking. Use when building AI agent backends that need structured run/event storage./auth-configsConfigure Supabase authentication providers (OAuth, JWT, email). Use when setting up authentication, configuring OAuth providers (Google/GitHub/Discord), implementing auth flows, configuring JWT settings, or when user mentions Supabase auth, social login, authentication setup, or auth configuration./e2e-test-scenariosEnd-to-end testing scenarios for Supabase - complete workflow tests from project creation to AI features, validation scripts, and comprehensive test suites. Use when testing Supabase integrations, validating AI workflows, running E2E tests, verifying production readiness, or when user mentions Supabase testing, E2E tests, integration testing, pgvector testing, auth testing, or test automation./pgvector-setupConfigure pgvector extension for vector search in Supabase - includes embedding storage, HNSW/IVFFlat indexes, hybrid search setup, and AI-optimized query patterns. Use when setting up vector search, building RAG systems, configuring semantic search, creating embedding storage, or when user mentions pgvector, vector database, embeddings, semantic search, or hybrid search./rls-test-patternsRLS policy testing patterns for Supabase - automated test cases for Row Level Security enforcement, user isolation verification, multi-tenant security, and comprehensive security audit scripts. Use when testing RLS policies, validating user isolation, auditing Supabase security, verifying tenant isolation, testing row level security, running security tests, or when user mentions RLS testing, security validation, policy testing, or data leak prevention./schema-patternsProduction-ready database schema patterns for AI applications including chat/conversation schemas, RAG document storage with pgvector, multi-tenant organization models, user management, and AI usage tracking. Use when building AI applications, creating database schemas, setting up chat systems, implementing RAG, designing multi-tenant databases, or when user mentions supabase schemas, chat database, RAG storage, pgvector, embeddings, conversation history, or AI application database.Other plugins' skills for the same job