supabase-postgres-best-practices
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
- 最近更新
- 2026-09-04
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- supabase-postgres-best-practices
- license
- MIT
- metadata
- { "author": "supabase", "version": "1.0.0" }
- description
- Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
02 资源文件 36
- 参考文档AGENTS.md43.9 KB
- 参考文档metadata.json818 B
- 参考文档README.md3.1 KB
- 参考文档rules/_contributing.md4.0 KB
- 参考文档rules/_sections.md1.6 KB
- 参考文档rules/_template.md1.0 KB
- 参考文档rules/advanced-full-text-search.md1.4 KB
- 参考文档rules/advanced-jsonb-indexing.md1.4 KB
- 参考文档rules/conn-idle-timeout.md1.3 KB
- 参考文档rules/conn-limits.md1.3 KB
- 参考文档rules/conn-pooling.md1.3 KB
- 参考文档rules/conn-prepared-statements.md1.5 KB
- 参考文档rules/data-batch-inserts.md1.3 KB
- 参考文档rules/data-n-plus-one.md1.3 KB
- 参考文档rules/data-pagination.md1.3 KB
- 参考文档rules/data-upsert.md1.4 KB
- 参考文档rules/lock-advisory.md1.5 KB
- 参考文档rules/lock-deadlock-prevention.md1.8 KB
- 参考文档rules/lock-short-transactions.md1.3 KB
- 参考文档rules/lock-skip-locked.md1.3 KB
- 参考文档rules/monitor-explain-analyze.md1.4 KB
- 参考文档rules/monitor-pg-stat-statements.md1.4 KB
- 参考文档rules/monitor-vacuum-analyze.md1.5 KB
- 参考文档rules/query-composite-indexes.md1.4 KB
- 参考文档rules/query-covering-indexes.md1.3 KB
- 参考文档rules/query-index-types.md1.4 KB
- 参考文档rules/query-missing-indexes.md1.2 KB
- 参考文档rules/query-partial-indexes.md1.3 KB
- 参考文档rules/schema-data-types.md1.4 KB
- 参考文档rules/schema-foreign-key-indexes.md1.6 KB
- 参考文档rules/schema-lowercase-identifiers.md1.7 KB
- 参考文档rules/schema-partitioning.md1.5 KB
- 参考文档rules/schema-primary-keys.md1.8 KB
- 参考文档rules/security-privileges.md1.5 KB
- 参考文档rules/security-rls-basics.md1.3 KB
- 参考文档rules/security-rls-performance.md1.5 KB
03 SKILL.md 正文
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
04 同仓库更多 Skills
zapier-make-patterns
No-code automation democratizes workflow building. Zapier and Make (formerly Integromat) let non-developers automate business processes without writing code. But no-code doesn't mean no-complexity - these platforms have their own patterns, pitfalls, and breaking points. This skill covers when to use which platform, how to build reliable automations, and when to graduate to code-based solutions. Key insight: Zapier optimizes for simplicity and integrations (7000+ apps), Make optimizes for power
Cross-Site Scripting and HTML Injection Testing
This skill should be used when the user asks to "test for XSS vulnerabilities", "perform cross-site scripting attacks", "identify HTML injection flaws", "exploit client-side injection vulnerabilities", "steal cookies via XSS", or "bypass content security policies". It provides comprehensive techniques for detecting, exploiting, and understanding XSS and HTML injection attack vectors in web applications.
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
workflow-automation
Workflow automation is the infrastructure that makes AI agents reliable. Without durable execution, a network hiccup during a 10-step payment flow means lost money and angry customers. With it, workflows resume exactly where they left off. This skill covers the platforms (n8n, Temporal, Inngest) and patterns (sequential, parallel, orchestrator-worker) that turn brittle scripts into production-grade automation. Key insight: The platforms make different tradeoffs. n8n optimizes for accessibility
WordPress Penetration Testing
This skill should be used when the user asks to "pentest WordPress sites", "scan WordPress for vulnerabilities", "enumerate WordPress users, themes, or plugins", "exploit WordPress vulnerabilities", or "use WPScan". It provides comprehensive WordPress security assessment methodologies.