PluginBench
Skill
Official
Pass
Audit score 90

supabase-postgres-best-practices

supabase/agent-skills

Postgres performance optimization and best practices guide from Supabase for query, schema, and configuration tuning.

What is supabase-postgres-best-practices?

Comprehensive reference for optimizing Postgres databases with rules across 8 priority categories: query performance, connection management, security, schema design, concurrency, data access, monitoring, and advanced features. Use when writing queries, designing schemas, reviewing performance issues, or configuring database scaling.

  • Provides 8 categories of optimization rules prioritized by performance impact
  • Includes detailed SQL examples showing incorrect vs. correct patterns
  • Offers EXPLAIN output and performance metrics for query analysis
  • Covers query performance, indexing, connection pooling, and RLS configuration
  • Guides schema design and concurrency optimization
  • Provides monitoring and diagnostics recommendations

How to install supabase-postgres-best-practices

npx skills add https://github.com/supabase/agent-skills --skill supabase-postgres-best-practices
Claude Code
Cursor
Windsurf
Cline

How to use supabase-postgres-best-practices

  1. 1.Identify which rule category applies to your task (query performance, schema design, security, etc.)
  2. 2.Read the relevant rule file in references/ for detailed explanation and examples
  3. 3.Review the incorrect vs. correct SQL examples to understand the pattern
  4. 4.Check EXPLAIN output or metrics provided to understand performance impact
  5. 5.Apply the correct pattern to your code or configuration

Use cases

Good for
  • Optimizing slow queries by identifying missing or inefficient indexes
  • Designing efficient database schemas for new applications
  • Implementing Row-Level Security (RLS) policies correctly
  • Configuring connection pooling for production deployments
  • Reviewing and refactoring existing database code for performance
Who it's for
  • Backend developers writing SQL and designing schemas
  • Database administrators optimizing Postgres instances
  • DevOps engineers configuring database scaling and pooling
  • Code review participants evaluating database changes
  • Teams using Supabase for their Postgres backend

supabase-postgres-best-practices FAQ

What are the priority categories?

Rules are organized by impact: Query Performance and Connection Management (CRITICAL), Security & RLS (CRITICAL), Schema Design (HIGH), Concurrency & Locking (MEDIUM-HIGH), Data Access Patterns (MEDIUM), Monitoring & Diagnostics (LOW-MEDIUM), and Advanced Features (LOW).

Does this include Supabase-specific guidance?

Yes, rule files include Supabase-specific notes where applicable, particularly for features like Row-Level Security and connection pooling.

Are SQL examples included?

Yes, each rule file contains incorrect SQL examples with explanations and correct SQL examples with explanations, plus optional EXPLAIN output and performance metrics.

Can this guide automated optimization?

Yes, the rules are designed to guide both automated query optimization and code generation tools.

What Postgres versions does this cover?

The guide references PostgreSQL current documentation and best practices applicable across modern Postgres versions.

Full instructions (SKILL.md)

Source of truth, from supabase/agent-skills.


name: supabase-postgres-best-practices description: Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations. license: MIT metadata: author: supabase version: "1.1.1" organization: Supabase date: January 2026 abstract: Comprehensive Postgres performance optimization guide for developers using Supabase and Postgres. Contains performance rules across 8 categories, prioritized by impact from critical (query performance, connection management) to incremental (advanced features). Each rule includes detailed explanations, incorrect vs. correct SQL examples, query plan analysis, and specific performance metrics to guide automated optimization and code generation.

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

Related skills

More from supabase/agent-skills and the wider catalog.

SUsupabase logo

supabase

Official
supabase/agent-skills

Complete Supabase backend integration for databases, auth, storage, and real-time features.

145k installs
SUsupabase-server logo

supabase-server

Official
supabase/server

Use when planning or writing server-side code that uses `@supabase/server` — Edge Functions, Hono apps, webhook handlers, or any backend that creates Supabase clients or validates inbound auth. Trigger **before** writing or modifying any file that imports from `@supabase/server` (or sub-paths like `@supabase/server/core`); calls `withSupabase`, `createSupabaseContext`, `createAdminClient`, `createContextClient`, `verifyAuth`, `verifyCredentials`, or `extractCredentials`; configures an `auth:` mode (`'none'` | `'publishable'` | `'secret'` | `'user'`, or keyed variants like `'secret:*'`); or lives under `supabase/functions/` and authenticates an inbound request. Also trigger during planning — if a plan mentions any of the above, load the skill before drafting code; do not extrapolate `auth:` values or auth modes from neighboring functions. Also trigger when you see legacy patterns to migrate to this package — `Deno.serve`, `createClient(Deno.env.get('SUPABASE_URL'))`, imports from `esm.sh/@supabase` or `deno.land/std`, usage of `SUPABASE_ANON_KEY` / `SUPABASE_SERVICE_ROLE_KEY`, or the deprecated `allow:` config option / removed `'always'` / `'public'` mode values / removed `authType` field.

1.0k installs
VEvercel-composition-patterns logo

vercel-composition-patterns

Official
supabase/supabase

React composition patterns that scale. Use when refactoring components with

1.0k installsAudited
CIci-cd-security logo

ci-cd-security

superagent-ai/skills

Scan GitHub Actions workflows for security vulnerabilities without external tools or execution.

2.4k installs
SKskill-security logo

skill-security

superagent-ai/skills

Audit AI agent skills for security risks before installing—catches credential theft, prompt injection, malicious code, and intent mismatches.

2.4k installs
SUsuperdesign logo

superdesign

superdesigndev/superdesign-skill

Design agent for frontend UI/UX—create and iterate design drafts before implementation.

5.3k installs