supabase-postgres-best-practices

Postgres performance optimization rules across 8 priority categories, from query tuning to advanced features. Organized into 8 rule categories prioritized by impact: query performance and connection management (critical), security and RLS, schema design, concurrency, data access patterns, monitoring, and advanced features Each rule includes detailed explanations, incorrect vs. correct SQL examples, EXPLAIN output analysis, and performance metrics to guide optimization decisions Covers query...

npx skills add https://github.com/supabase/agent-skills --skill supabase-postgres-best-practices

Supabase Postgres Best Practices

Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design.

When to Apply

Reference these guidelines when:

  • Writing SQL queries or designing schemas
  • Implementing indexes or query optimization
  • Reviewing database performance issues
  • Configuring connection pooling or scaling
  • Optimizing for Postgres-specific features
  • Working with Row-Level Security (RLS)

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Query PerformanceCRITICALquery-
2Connection ManagementCRITICALconn-
3Security & RLSCRITICALsecurity-
4Schema DesignHIGHschema-
5Concurrency & LockingMEDIUM-HIGHlock-
6Data Access PatternsMEDIUMdata-
7Monitoring & DiagnosticsLOW-MEDIUMmonitor-
8Advanced FeaturesLOWadvanced-

How to Use

Read individual rule files for detailed explanations and SQL examples:

references/query-missing-indexes.md
references/query-partial-indexes.md
references/_sections.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect SQL example with explanation
  • Correct SQL example with explanation
  • Optional EXPLAIN output or metrics
  • Additional context and references
  • Supabase-specific notes (when applicable)

References

Mais skills de supabase

skill-creator
supabase
Comprehensive guide for creating modular skills that extend Claude's capabilities with specialized knowledge and workflows. Skills consist of a required SKILL.md file with YAML frontmatter and markdown instructions, plus optional bundled resources (scripts, references, assets) organized by purpose and loaded progressively to conserve context Design skills around concrete usage examples; identify reusable scripts for deterministic tasks, reference files for domain knowledge, and assets for...
official
supabase
supabase
Use ao realizar QUALQUER tarefa envolvendo Supabase. Gatilhos: produtos Supabase (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); cliente…
official
supabase-server
supabase
Use when writing server-side code with Supabase — Edge Functions, Hono apps, webhook handlers, or any backend that needs Supabase auth and client creation.…
official
dev-toolbar-review
supabase
Use when reviewing PRs that touch packages/dev-tools/, packages/common/posthog-client.ts,
official
e2e-studio-tests
supabase
Run e2e tests in the Studio app. Use when asked to run e2e tests, run studio tests, playwright tests, or test the feature.
official
studio-best-practices
supabase
Melhores práticas de React e TypeScript para o Supabase Studio. Use ao escrever
official
studio-e2e-tests
supabase
Escreva e execute testes E2E com Playwright para o Supabase Studio. Use quando solicitado.
official
studio-error-handling
supabase
Padrão de exibição de erros e solução de problemas para o Supabase Studio. Use quando
official