StealIt

Supabase Postgres Best Practices

supabase-postgres-best-practices

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.

Install

Run this in your project folder. It works with Claude Code, Cursor, Codex and dozens of other agents.

$ npx skills add supabase/agent-skills --skill supabase-postgres-best-practices

Needs Node.js. Add -g to install for every project, or -a claude-code to skip the agent picker.

How to use Supabase Postgres Best Practices

Once it's installed, Claude reads this skill on its own whenever a request matches what it's for, so you don't have to mention it by name. In Claude Code you can also run it directly by typing /supabase-postgres-best-practices.

It contains no scripts, only instructions and reference files, so it can't run code on its own.

What the instructions cover

  1. 1When to Apply
  2. 2Rule Categories by Priority
  3. 3How to Use
  4. 4References

Section headings from the skill's SKILL.md file.

What's inside · 36 files

  • CHANGELOG.md
  • SKILL.md
  • references/_contributing.md
  • references/_sections.md
  • references/_template.md
  • references/advanced-full-text-search.md
  • references/advanced-jsonb-indexing.md
  • references/conn-idle-timeout.md
  • references/conn-limits.md
  • references/conn-pooling.md
  • references/conn-prepared-statements.md
  • references/data-batch-inserts.md
  • references/data-n-plus-one.md
  • references/data-pagination.md
  • references/data-upsert.md
  • references/lock-advisory.md
  • references/lock-deadlock-prevention.md
  • references/lock-short-transactions.md
  • references/lock-skip-locked.md
  • references/monitor-explain-analyze.md
  • references/monitor-pg-stat-statements.md
  • references/monitor-vacuum-analyze.md
  • references/query-composite-indexes.md
  • references/query-covering-indexes.md
  • references/query-index-types.md
  • references/query-missing-indexes.md
  • references/query-partial-indexes.md
  • references/schema-constraints.md
  • references/schema-data-types.md
  • references/schema-foreign-key-indexes.md
  • references/schema-lowercase-identifiers.md
  • references/schema-partitioning.md
  • references/schema-primary-keys.md
  • references/security-privileges.md
  • references/security-rls-basics.md
  • references/security-rls-performance.md

More from Supabase

See all →

Supabase

Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR…

Data & DatabasesSupabase3k
See all →

Airflow Dag Patterns

Build production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling…

Data & DatabasesSeth Hobson42k

Data Quality Frameworks

Implement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing…

Data & DatabasesSeth Hobson42k

Data Storytelling

Transform data into compelling narratives using visualization, context, and persuasive structure. Use when presenting analytics to stakeholders, creating data reports, or building…

Data & DatabasesSeth Hobson42k

Database Migration

Execute database migrations across ORMs and platforms with zero-downtime strategies, data transformation, and rollback procedures. Use when migrating databases, changing schemas…

Data & DatabasesSeth Hobson42k