registry/skills/postgres-best-practices/SKILL.md
Postgres performance optimization and best practices. Use when writing or reviewing SQL queries, designing schemas, configuring connection pooling, fixing N+1 queries, creating indexes, implementing row-level security, diagnosing slow queries with EXPLAIN ANALYZE, or optimizing database performance.
npx skillsauth add provectus/awos-recruitment postgres-best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive performance optimization guide for Postgres. 31 rules across 8 categories, prioritized by impact — from critical (query performance, connection management) to incremental (advanced features).
| 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- |
query-missing-indexes - Add indexes on WHERE and JOIN columnsquery-composite-indexes - Create composite indexes for multi-column queriesquery-covering-indexes - Use covering indexes to avoid table lookupsquery-partial-indexes - Use partial indexes for filtered queriesquery-index-types - Choose the right index type for your dataconn-pooling - Use connection pooling for all applicationsconn-limits - Set appropriate connection limitsconn-idle-timeout - Configure idle connection timeoutsconn-prepared-statements - Use prepared statements correctly with poolingsecurity-rls-basics - Enable Row Level Security for multi-tenant datasecurity-rls-performance - Optimize RLS policies for performancesecurity-privileges - Apply principle of least privilegeschema-data-types - Choose appropriate data typesschema-constraints - Add constraints safely in migrationsschema-primary-keys - Select optimal primary key strategyschema-foreign-key-indexes - Index foreign key columnsschema-partitioning - Partition large tables for better performanceschema-lowercase-identifiers - Use lowercase identifiers for compatibilitylock-short-transactions - Keep transactions short to reduce lock contentionlock-deadlock-prevention - Prevent deadlocks with consistent lock orderinglock-advisory - Use advisory locks for application-level lockinglock-skip-locked - Use SKIP LOCKED for non-blocking queue processingdata-n-plus-one - Eliminate N+1 queries with batch loadingdata-pagination - Use cursor-based pagination instead of OFFSETdata-batch-inserts - Batch INSERT statements for bulk datadata-upsert - Use UPSERT for insert-or-update operationsmonitor-explain-analyze - Use EXPLAIN ANALYZE to diagnose slow queriesmonitor-pg-stat-statements - Enable pg_stat_statements for query analysismonitor-vacuum-analyze - Maintain table statistics with VACUUM and ANALYZEadvanced-full-text-search - Use tsvector for full-text searchadvanced-jsonb-indexing - Index JSONB columns for efficient queryingEach rule file in references/ contains: explanation, incorrect/correct SQL examples, EXPLAIN output, and context. Read individual files as needed.
development
Insurance underwriting domain knowledge for building automated submission processing systems. Covers submission-to-bind lifecycle, document extraction patterns, compliance gates (sanctions, licensing, clearance), human-in-the-loop design for regulated financial services, confidence calibration for extracted fields, operating mode progression (manual to automated), and evidence traceability requirements. Use when designing or implementing underwriting pipelines, extraction agents, compliance workflows, HITL review systems, or decision package assembly for insurance or MGA operations.
development
This skill should be used when the user asks to "write TypeScript code", "create a TypeScript module", "define TypeScript types", "add type annotations", "use generics", "handle errors in TypeScript", "set up tsconfig", "organize TypeScript project", or when writing any TypeScript code that is not tied to a specific library or framework. Covers type system, strict mode, naming conventions, error handling, async patterns, and project structure.
development
Use when working with Terraform or OpenTofu - creating modules, writing tests (native test framework, Terratest), setting up CI/CD pipelines, reviewing configurations, choosing between testing approaches, debugging state issues, implementing security scanning (trivy, checkov), or making infrastructure-as-code architecture decisions. Enforces Provectus opinionated conventions (exact version pinning, etc.) on top of community best practices.
development
This skill should be used when the user asks to "write Swift code", "create a Swift type", "set up a Swift package", "review Swift code", "refactor Swift", "use async/await in Swift", "fix Swift style", or when generating any Swift source code regardless of target platform. Provides modern Swift 6+ best practices covering type system, optionals, concurrency, error handling, protocols, generics, and idiomatic patterns. Does not cover any specific platform or framework.