supabase-postgres-best-practices · openai — Codex skill: how to install
Supabase guidelines for Postgres performance optimization. Helps developers write SQL queries, design database schemas, and configure RLS.
npx skills add openai/plugins --skill supabase-postgres-best-practices
npx skills add openai/plugins --skill supabase-best-practices -a codexWhat supabase-postgres-best-practices does
This skill brings Postgres performance guidelines from Supabase directly to your coding assistant. The material covers 8 categories prioritized by impact, ranging from query bottlenecks and connection pooling to schema design and Row-Level Security.
Rules live in the references/ directory with category prefixes such as query- and schema-. Each entry includes an explanation, incorrect versus correct SQL snippets, and optional EXPLAIN metrics. Agents reference these files when writing raw queries, debugging locks, or reviewing migrations.
Install it if you write SQL directly and want automated checks against bad joins or unindexed filters. Teams relying strictly on basic ORM methods without custom database logic can skip it.
What it helps with
- Detect slow SQL queries missing proper indexes
- Configure database connection pooling
- Design Row-Level Security policies for tables
- Resolve locking conflicts during concurrent access
Example prompts for the agent
- Check this SQL query against the query- rules to spot missing indexes
- Help me set up RLS policies for my user table following Supabase practices
- Review this EXPLAIN query plan and suggest optimizations
How to install supabase-postgres-best-practices
1Skills CLI (Vercel)
npx skills add openai/plugins --skill supabase-postgres-best-practicesnpx skills add openai/plugins --skill supabase-best-practices -a codex2Manually: put the files in place
.agents/skills/supabase-best-practices/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add openai/plugins --skill supabase-best-practices -a claude-code2Manually: put the files in place
~/.claude/skills/supabase-best-practices/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/supabase-best-practices/
Manually: put the files in place
.cursor/skills/supabase-best-practices/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install openai/plugins supabase-best-practices2Manually: put the files in place
.github/skills/supabase-best-practices/SKILL.mdPlatform CLI
gemini skills install https://github.com/openai/plugins --path plugins/build-web-apps/skills/supabase-best-practicesManually: put the files in place
.devin/skills/supabase-best-practices/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set201
The whole set →Other versions of supabase-postgres-best-practices
Similar
Questions about supabase-postgres-best-practices
How do I install supabase-postgres-best-practices in Codex?
Run npx skills add openai/plugins --skill supabase-postgres-best-practices in your terminal. This downloads the skill files into your project.
What does this skill do?
It provides structured rules for inspecting SQL queries, missing indexes, connection pooling, and Row-Level Security policies.
How are the rule categories prioritized?
The guide organizes 8 categories by impact level. Query performance, connection management, and security take critical priority, while advanced features hold the lowest priority.
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. 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. --- # 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/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 - 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