Postgres best practices
Skill bcastelino/agent-skills-kit/skills/postgres-best-practices
Toolkit for authoring and packaging Agent Skills. Includes a meta skill, templates, a sample skill, and scripts for validation and packaging
npx -y skills add bcastelino/agent-skills-kit --skill postgres-best-practicesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
SKILL.md
1.9 KB, 389 tokens by cl100k_base, as published. Nobody here has run it
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:
rules/query-missing-indexes.md
rules/schema-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.
What ships with it: 36 files
97.1 KB alongside SKILL.md
rules/
- advanced-full-text-search.md1.4 KB
- advanced-jsonb-indexing.md1.4 KB
- conn-idle-timeout.md1.3 KB
- conn-limits.md1.3 KB
- conn-pooling.md1.3 KB
- conn-prepared-statements.md1.5 KB
- _contributing.md4.0 KB
- data-batch-inserts.md1.3 KB
- data-n-plus-one.md1.3 KB
- data-pagination.md1.3 KB
- data-upsert.md1.4 KB
- lock-advisory.md1.5 KB
- lock-deadlock-prevention.md1.8 KB
- lock-short-transactions.md1.3 KB
- lock-skip-locked.md1.3 KB
- monitor-explain-analyze.md1.4 KB
- monitor-pg-stat-statements.md1.4 KB
- monitor-vacuum-analyze.md1.5 KB
- query-composite-indexes.md1.4 KB
- query-covering-indexes.md1.3 KB
- query-index-types.md1.4 KB
- query-missing-indexes.md1.2 KB
- query-partial-indexes.md1.3 KB
- schema-data-types.md1.4 KB
- schema-foreign-key-indexes.md1.6 KB
- schema-lowercase-identifiers.md1.7 KB
- schema-partitioning.md1.5 KB
- schema-primary-keys.md1.8 KB
- _sections.md1.6 KB
- security-privileges.md1.5 KB
- security-rls-basics.md1.3 KB
- security-rls-performance.md1.5 KB
- _template.md1.0 KB
- AGENTS.md43.9 KB
- metadata.json818 B
- README.md3.1 KB