mcpField
S
supabase-postgres-best-practices

supabase-postgres-best-practices

github.com/sickn33Data & databases48.8k225 installsUpdated today
Repository

About supabase-postgres-best-practices

A skill for Supabase Postgres work, with performance and practice rules organized by impact. It is intended for writing, reviewing, and optimizing queries, schemas, and database configuration.

Key features

  1. 01Rules across eight categories
  2. 02Prioritized by impact
  3. 03Incorrect and corrected SQL examples
  4. 04Covers RLS, connections, and diagnostics

Use cases

  1. 01Optimize Postgres queries and indexes
  2. 02Review database schema designs
  3. 03Investigate performance and concurrency issues

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/sickn33/agentic-awesome-skills --skill supabase-postgres-best-practices

After installing, type/supabase-postgres-best-practicesin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

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

Details

From the project README

Supabase Postgres Best Practices

When to Use

Use this skill when you need postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.

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)

Execution and evidence boundaries

SQL is illustrative, not an instruction to mutate a live database. Confirm target, permissions, locks, backups and rollback before DDL/DML, global settings, resets or extension changes. EXPLAIN ANALYZE executes its statement and can invoke side effects even for SELECT; inspect first and use a disposable environment when needed. All speedups, row counts, memory estimates and plan outputs here are examples, not measured guarantees. Benchmark equivalent workloads and preserve RLS semantics while optimizing.

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

Limitations

  • Use this skill only when the task clearly matches its upstream product or API scope.
  • Verify commands, API behavior, pricing, quotas, credentials, and deployment effects against current official documentation before making changes.
  • Do not treat generated examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.

Comments

Markdown supported