About postgres-best-practices
postgres-best-practices is a community-bundled guide attributed to Supabase for Postgres query optimization and schema design. It organizes rules into eight impact-prioritized categories, with explanations and SQL examples for database practitioners.
Key features
- 01Eight prioritized rule categories
- 02Query and index optimization guidance
- 03Connection and pooling guidance
- 04Security and RLS recommendations
- 05SQL examples in individual rule files
Use cases
- 01Reviewing Postgres query performance
- 02Designing schemas and indexes
- 03Configuring connection pooling
- 04Assessing Row-Level Security
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ sickn33/ agentic-awesome-skills --skill postgres-best-practicesAfter installing, type/postgres-best-practicesin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
AGENTS.mdmetadata.jsonREADME.mdrules/_contributing.md_sections.md_template.mdadvanced-full-text-search.mdadvanced-jsonb-indexing.mdconn-idle-timeout.mdconn-limits.mdconn-pooling.mdconn-prepared-statements.mddata-batch-inserts.mddata-n-plus-one.mddata-pagination.mddata-upsert.mdlock-advisory.mdlock-deadlock-prevention.mdlock-short-transactions.mdlock-skip-locked.mdmonitor-explain-analyze.mdmonitor-pg-stat-statements.mdmonitor-vacuum-analyze.mdquery-composite-indexes.mdquery-covering-indexes.mdquery-index-types.mdquery-missing-indexes.mdquery-partial-indexes.mdschema-data-types.mdschema-foreign-key-indexes.mdDetails
From the project READMESupabase Postgres Best Practices
Community-bundled Postgres guide attributed to Supabase; upstream maintenance and example performance numbers are not independently certified. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design.
When to Use
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:
rules/query-missing-indexes.md
rules/query-partial-indexes.md
rules/_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)
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.