/supabase:schema-patternsfrom supabase
Generates and validates production-ready PostgreSQL/Supabase database schemas for AI applications including chat, RAG (pgvector), multi-tenant, user management, and AI usage tracking.
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 PostgreSQL/Supabase database schemas optimized for AI applications including chat systems, RAG (Retrieval-Augmented Generation), multi-tenancy, and usage tracking.
Ask the user which schema pattern they need:
Use the generation script:
cd /home/vanman2025/Projects/ai-dev-marketplace/plugins/supabase/skills/schema-patterns
./scripts/generate-schema.sh <pattern-type> <output-file>
Pattern types: chat, rag, multi-tenant, user-management, ai-usage, complete
Before applying, validate the generated schema:
./scripts/validate-schema.sh <schema-file>
This checks for:
Apply the schema to your Supabase project:
./scripts/apply-migration.sh <schema-file> <migration-name>
This creates a timestamped migration file and validates before applying.
For development, generate realistic test data:
./scripts/seed-data.sh <pattern-type>
chat-schema.sql: Complete chat/conversation system with users, conversations, messages, participantsrag-schema.sql: RAG document storage with chunks, embeddings (pgvector), and similarity searchmulti-tenant-schema.sql: Organization-based multi-tenancy with orgs, teams, members, rolesuser-management-schema.sql: Extended user profiles, metadata, preferencesai-usage-tracking-schema.sql: Token usage, API costs, rate limiting, usage analyticsmigration-template.sql: Boilerplate migration structure with version trackingindexes-template.sql: Performance optimization index patternsrls-policies-template.sql: Row Level Security policy patternsAll RAG schemas include:
Organization-based isolation:
Optimized for real-time messaging:
See the examples directory for:
complete-ai-app-schema.md: Full schema combining all patternsmigration-guide.md: Schema evolution and versioningindexing-strategy.md: Performance optimization guide./scripts/generate-schema.sh chat schema.sql
./scripts/validate-schema.sh schema.sql
./scripts/apply-migration.sh schema.sql "initial-chat-schema"
./scripts/seed-data.sh chat
./scripts/generate-schema.sh rag schema.sql
./scripts/validate-schema.sh schema.sql
./scripts/apply-migration.sh schema.sql "add-rag-storage"
./scripts/seed-data.sh rag
./scripts/generate-schema.sh complete schema.sql
./scripts/validate-schema.sh schema.sql
./scripts/apply-migration.sh schema.sql "complete-ai-platform"
pgvector not found: Enable the vector extension in Supabase dashboard (Database > Extensions)
RLS blocks queries: Check RLS policies or temporarily disable for testing (not recommended for production)
Slow similarity search: Ensure HNSW index is created on vector columns with proper operator class
Migration conflicts: Check migration version ordering and resolve conflicts manually
Skill Location: /home/vanman2025/Projects/ai-dev-marketplace/plugins/supabase/skills/schema-patterns/ Version: 1.0.0
README.md (opens in a new tab)examples/complete-ai-app-schema.md (opens in a new tab)examples/indexing-strategy.md (opens in a new tab)examples/migration-guide.md (opens in a new tab)scripts/apply-migration.sh (opens in a new tab)scripts/generate-schema.sh (opens in a new tab)scripts/seed-data.sh (opens in a new tab)scripts/validate-schema.sh (opens in a new tab)templates/ai-usage-tracking-schema.sql (opens in a new tab)templates/chat-schema.sql (opens in a new tab)templates/migration-template.sql (opens in a new tab)templates/multi-tenant-schema.sql (opens in a new tab)templates/rag-schema.sql (opens in a new tab)templates/user-management-schema.sql (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
8 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-templatesRow Level Security policy templates for Supabase - multi-tenant patterns, user isolation, role-based access, and secure-by-default configurations. Use when securing Supabase tables, implementing RLS policies, building multi-tenant AI apps, protecting user data, creating chat/RAG systems, or when user mentions row level security, RLS, Supabase security, tenant isolation, or data access policies./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.npx claudepluginhub vanman2024/ai-dev-marketplace --plugin supabaseOther plugins' skills for the same job