117downloads
Supabase Postgres schema, SQL and performance skill
Review Postgres schema, queries, migrations and row level security with Supabase guidance. Diagnose slow queries, indexing issues and database resource usage.
When it runs
Your agent reads this description from SKILL.md to decide when to load the skill:
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
What SKILL.md covers
- When to Apply
- Rule Categories by Priority
- How to Use
- References
Files in the ZIP
supabase-postgres-best-practices/SKILL.mdsupabase-postgres-best-practices/CHANGELOG.mdsupabase-postgres-best-practices/references/_contributing.mdsupabase-postgres-best-practices/references/_sections.mdsupabase-postgres-best-practices/references/_template.mdsupabase-postgres-best-practices/references/advanced-full-text-search.mdsupabase-postgres-best-practices/references/advanced-jsonb-indexing.mdsupabase-postgres-best-practices/references/conn-idle-timeout.mdsupabase-postgres-best-practices/references/conn-limits.mdsupabase-postgres-best-practices/references/conn-pooling.mdsupabase-postgres-best-practices/references/conn-prepared-statements.mdsupabase-postgres-best-practices/references/data-batch-inserts.mdsupabase-postgres-best-practices/references/data-n-plus-one.mdsupabase-postgres-best-practices/references/data-pagination.mdsupabase-postgres-best-practices/references/data-upsert.mdsupabase-postgres-best-practices/references/lock-advisory.mdsupabase-postgres-best-practices/references/lock-deadlock-prevention.mdsupabase-postgres-best-practices/references/lock-short-transactions.mdsupabase-postgres-best-practices/references/lock-skip-locked.mdsupabase-postgres-best-practices/references/monitor-explain-analyze.mdsupabase-postgres-best-practices/references/monitor-pg-stat-statements.mdsupabase-postgres-best-practices/references/monitor-vacuum-analyze.mdsupabase-postgres-best-practices/references/query-composite-indexes.mdsupabase-postgres-best-practices/references/query-covering-indexes.mdsupabase-postgres-best-practices/references/query-index-types.mdsupabase-postgres-best-practices/references/query-missing-indexes.mdsupabase-postgres-best-practices/references/query-partial-indexes.mdsupabase-postgres-best-practices/references/schema-constraints.mdsupabase-postgres-best-practices/references/schema-data-types.mdsupabase-postgres-best-practices/references/schema-foreign-key-indexes.mdsupabase-postgres-best-practices/references/schema-lowercase-identifiers.mdsupabase-postgres-best-practices/references/schema-partitioning.mdsupabase-postgres-best-practices/references/schema-primary-keys.mdsupabase-postgres-best-practices/references/security-privileges.mdsupabase-postgres-best-practices/references/security-rls-basics.mdsupabase-postgres-best-practices/references/security-rls-performance.md
Related skills
Supabase app development and troubleshooting skill
Build and debug Supabase apps using current product documentation. Work across database, auth, storage, realtime and Edge Functions with scoped guidance.
Supabase CLI local development and migration skill
Use the Supabase CLI for local services, database migrations and Edge Functions. Follow the project workflow for development and deployment commands.
Supabase JavaScript SDK integration skill
Build with supabase-js for database queries, authentication, storage and realtime. Consult the SDK references before changing JavaScript integrations.