Supabase Postgres Best Practices
Published by dirnbauer in webconsulting-skills
What this skill does
Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
Add Supabase Postgres Best Practices to your agent
Review the source and files first. When you are ready, copy the prompt instruction or use the CLI command supported by your environment.
Install with a prompt
Paste this into a compatible coding agent:
add this skill "supabase-postgres-best-practices" from https://github.com/dirnbauer/webconsulting-skillsInstall with the CLI
Run this command in a controlled environment after reviewing the repository:
npx skills add https://github.com/dirnbauer/webconsulting-skills --skill supabase-postgres-best-practicesSkill instructions
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
Credits & Attribution
This skill is based on the excellent work by Supabase.
Original repository: https://github.com/supabase/agent-skills
Special thanks to Supabase for their generous open-source contributions, which helped shape this skill collection. Adapted by webconsulting.at for this skill collection
Files included
- SKILL-SUPABASE.md
- SKILL.md
- references/_contributing.md
- references/_sections.md
- references/_template.md
- references/advanced-full-text-search.md
- references/advanced-jsonb-indexing.md
- references/conn-idle-timeout.md
- references/conn-limits.md
- references/conn-pooling.md
- references/conn-prepared-statements.md
- references/data-batch-inserts.md
- references/data-n-plus-one.md
- references/data-pagination.md
- references/data-upsert.md
- references/lock-advisory.md
- references/lock-deadlock-prevention.md
- references/lock-short-transactions.md
- references/lock-skip-locked.md
- references/monitor-explain-analyze.md
- references/monitor-pg-stat-statements.md
- references/monitor-vacuum-analyze.md
- references/query-composite-indexes.md
- references/query-covering-indexes.md
- references/query-index-types.md
- references/query-missing-indexes.md
- references/query-partial-indexes.md
- references/schema-constraints.md
- references/schema-data-types.md
- references/schema-foreign-key-indexes.md
- references/schema-lowercase-identifiers.md
- references/schema-partitioning.md
- references/schema-primary-keys.md
- references/security-privileges.md
- references/security-rls-basics.md
- references/security-rls-performance.md
More skills
Supabase Postgres Best Practices
supabase/agent-skills
No summary provided.
Audit unavailable434k installsSupabase Postgres Best Practices
oldwinter/skills
No summary provided.
Audit unavailable32 installsSupabase Postgres Best Practices
aston1690/supabase-postgres-best-practices
No summary provided.
Audit unavailable17 installs

