Skip to main content
skill CX Codex GP ChatGPT official · OpenAI

supabase-postgres-best-practices · openai — Codex skill: Postgres tuning rules

A rule set for Postgres performance, maintained by Supabase. Useful when your agent writes queries, designs schemas or digs into a slow database.

Install into Codex · Skills CLI (Vercel) All methods and platforms ↓
npx skills add openai/plugins --skill supabase-postgres-best-practices -a codex
Open on GitHub

What supabase-postgres-best-practices does

The skill hands your agent a reference on Postgres optimization. Rules sit in 8 categories, ordered by impact: query performance, connection management and security with RLS come first, then schema design, locking, data access patterns, monitoring and advanced features. Each category has a filename prefix — query-, conn-, security-, schema-, lock-, data-, monitor-, advanced-.

Files live in references/, for example references/query-missing-indexes.md and references/query-partial-indexes.md. Every rule explains why it matters, shows a bad SQL example next to a good one, and adds EXPLAIN output or metrics. Supabase-specific notes appear where they apply.

Worth installing if you run Postgres or Supabase and want the agent to suggest indexes instead of piling on connections. On a small database with simple queries the reference won't change much.

What it helps with

  • spot a query that needs an index
  • read an EXPLAIN plan and find the bottleneck
  • design a schema with the right types and relations
  • size a connection pool for real load
  • audit Row-Level Security policies

Example prompts for the agent

  • review this query and tell me which indexes are missing
  • check the orders and users tables against the schema- rules
  • why is this query slow? walk through the execution plan

How to install supabase-postgres-best-practices

1Skills CLI (Vercel)

npx skills add openai/plugins --skill supabase-postgres-best-practices -a codex

2Manually: put the files in place

.agents/skills/supabase-postgres-best-practices/SKILL.md

For all projects use ~/.agents/skills/

From the same set201

The whole set →
supabase official supabase Guides the agent through database configuration and strict RLS policies in Supabase. CX Codex GP ChatGPT 8installs remotion-render official Remotion Exports videos and static stills from Remotion projects using CLI commands. CX Codex GP ChatGPT 3installs figma-create-new-file official Figma Creates blank Figma, FigJam, or Slides files inside draft folders. It resolves planKey and editor types before invoking Figma MCP tools. CX Codex GP ChatGPT 6installs swiftui-performance-audit official OpenAI Pinpoints SwiftUI runtime issues like frame drops, unresponsive taps, and excessive view body computations. Works code-first and guides Instruments profiling. CX Codex GP ChatGPT 109installs swiftui-liquid-glass official OpenAI This skill helps build and review SwiftUI Liquid Glass interfaces for iOS 26+. Use it when adopting the API or checking fallbacks, interaction, and design fit. CX Codex GP ChatGPT 121installs swiftui-ui-patterns official OpenAI This skill helps build and refactor SwiftUI interfaces, from navigation and state to layouts and controls. Use it for new screens or changes to an existing project. CX Codex GP ChatGPT 114installs swiftui-view-refactor official OpenAI Refactors SwiftUI view files into clean, testable structures with dedicated subview types and proper Observation ownership. CX Codex GP ChatGPT 113installs ios-memgraph-leaks official OpenAI Captures and inspects iOS leaks from a simulator process or .memgraph. Useful for tracing retained objects and checking a fix with before-and-after evidence. CX Codex GP ChatGPT 1,054installs

Other versions of supabase-postgres-best-practices

Similar

sql-object-impact-analysis official github Traces dependencies on tables, columns, and stored procedures across SQL scripts and app code before schema changes. Useful for legacy codebases. GitHub Copilot 26installs pinecone-rag official github This skill guides Pinecone-based RAG pipelines and persistent agent memory. Use it for semantic document search, hybrid retrieval, or context shared across sessions. GitHub Copilot 24installs server-side-conversion-tracking official github This skill sets up server-side purchase reporting for Facebook, TikTok, Google, and Bing. Use it when ad platforms under-report conversions. GitHub Copilot 21installs migrating-oracle-to-postgres-data-access-code official github Moves .NET/C# data-access code from Oracle to PostgreSQL with Npgsql. Use it while migrating an application's code layer alongside its database. GitHub Copilot 10installs memory-engineering Alireza Rezvani This skill designs and audits agent memory, prices the write path, and enforces forgetting rules. Use it when a CLAUDE.md or memory store keeps growing. Claude Code 29installs xlsx official anthropics Creates, reads, edits, and converts spreadsheet files. Use it when the requested deliverable is an Excel workbook or another tabular file. Claude Code Claude.ai 187,223installs google-agents-cli-observability official Google This skill guides you through tracing and monitoring AI agents, including ADK agents. Use it when you need to inspect agent execution or monitor a deployed agent. Claude Code CX Codex Cursor +1 509,900installs caveman-evidence-review JuliusBrussee A read-only skill reviews Caveman Cloud evidence on LLM spend, traces, and routing. Use it to see where a project’s model budget goes. Claude Code CX Codex Cursor +1 103,500installs

Questions about supabase-postgres-best-practices

How do I install supabase-postgres-best-practices in Claude?

Run npx skills add openai/plugins --skill supabase-postgres-best-practices -a codex. The skill lands at .agents/skills/supabase-postgres-best-practices/SKILL.md.

What does supabase-postgres-best-practices do?

It gives the agent Postgres tuning rules covering indexes, connections, RLS, schema and locking, and the agent applies them while writing or reviewing SQL.

Do I need a Supabase project for it to work?

No. It is a text reference — the agent reads the rule files and applies them to whatever Postgres code you have.

Source text

SKILL.md · MIT
---
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

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Query Performance | CRITICAL | `query-` |
| 2 | Connection Management | CRITICAL | `conn-` |
| 3 | Security & RLS | CRITICAL | `security-` |
| 4 | Schema Design | HIGH | `schema-` |
| 5 | Concurrency & Locking | MEDIUM-HIGH | `lock-` |
| 6 | Data Access Patterns | MEDIUM | `data-` |
| 7 | Monitoring & Diagnostics | LOW-MEDIUM | `monitor-` |
| 8 | Advanced Features | LOW | `advanced-` |

## 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

- https://www.postgresql.org/docs/current/
- https://supabase.com/docs
- https://wiki.postgresql.org/wiki/Performance_Optimization
- https://supabase.com/docs/guides/database/overview
- https://supabase.com/docs/guides/auth/row-level-security

© supabase · MIT · openai/plugins

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor