Squire supabase-postgres-best-practices

install
source · Clone the upstream repo
git clone https://github.com/eddiebelaval/squire
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/eddiebelaval/squire "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/supabase-postgres-best-practices" ~/.claude/skills/eddiebelaval-squire-supabase-postgres-best-practices && rm -rf "$T"
manifest: skills/supabase-postgres-best-practices/SKILL.md
source content

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.0" 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. slug: supabase-postgres-best-practices category: operations complexity: complex version: "1.0.0" author: "id8Labs" triggers:

  • "supabase-postgres-best-practices"
  • "supabase postgres best practices" tags:
  • development
  • tool-factory-retrofitted---

Supabase Postgres Best Practices

Core Workflows

Workflow 1: Primary Action

  1. Analyze the input and context
  2. Validate prerequisites are met
  3. Execute the core operation
  4. Verify the output meets expectations
  5. Report results

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 PerformanceCRITICAL
query-
2Connection ManagementCRITICAL
conn-
3Security & RLSCRITICAL
security-
4Schema DesignHIGH
schema-
5Concurrency & LockingMEDIUM-HIGH
lock-
6Data Access PatternsMEDIUM
data-
7Monitoring & DiagnosticsLOW-MEDIUM
monitor-
8Advanced FeaturesLOW
advanced-

How to Use

Read individual rule files for detailed explanations and SQL examples:

references/query-missing-indexes.md
references/schema-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