Productivity

postgresql-expert-best-practices-code-review

wispbit-ai/skills · updated Apr 8, 2026

$npx skills add https://github.com/wispbit-ai/skills --skill postgresql-expert-best-practices-code-review
summary

Simple, pragmatic, opinionated. Only what matters for writing production-grade PostgreSQL queries.

skill.md

PostgreSQL Expert Best Practices

Simple, pragmatic, opinionated. Only what matters for writing production-grade PostgreSQL queries.

When to Apply

Reference these guidelines when:

  • Writing database migrations or schema changes
  • Creating or modifying PostgreSQL tables and columns
  • Adding indexes, constraints, or foreign keys
  • Reviewing database schema for performance issues
  • Refactoring existing database structures
  • Optimizing query performance or database design

Rule Categories by Priority

Priority Category Impact Prefix
1 Index Management CRITICAL-HIGH only-concurrent-indexes, add-index-for-foreign-key
2 Constraint Safety HIGH unique-constraint, split-foreign-key, set-column-not-null
3 Schema Design MEDIUM only-jsonb, always-include-columns, limit-non-unique-index
4 Naming Standards LOW index-naming-standards, column-naming-standards

Quick Reference

  • only-concurrent-indexes - Always use CONCURRENTLY to prevent blocking writes during index creation
  • add-index-for-foreign-key - Create indexes for foreign keys to improve query performance
  • unique-constraint - Split unique constraint creation into concurrent index + constraint steps
  • split-foreign-key - Add foreign keys without validation first, then validate separately
  • set-column-not-null - Use check constraints before setting NOT NULL to avoid table locks
  • only-jsonb - Use JSONB instead of JSON for better performance and indexing capabilities
  • always-include-columns - Include id, created_at, and updated_at in all tables for auditability
  • limit-non-unique-index - Limit non-unique indexes to maximum three columns for efficiency
  • index-naming-standards - Use consistent index naming: idx_tablename_columnname
  • column-naming-standards - Maintain consistent snake_case naming and use id suffix for foreign keys

How to Use

Read individual rule files for detailed explanations and code examples:

rules/only-concurrent-indexes.md
rules/add-index-for-foreign-key.md
rules/unique-constraint.md
rules/split-foreign-key.md
rules/set-column-not-null.md
rules/only-jsonb.md
rules/always-include-columns.md
rules/limit-non-unique-index.md
rules/index-naming-standards.md
rules/column-naming-standards.md

Each rule file contains:

  • Brief explanation of why it matters
  • Impact level and description
  • Incorrect migration example with explanation
  • Correct migration example with best practices
  • Additional context and references
general reviews

Ratings

4.510 reviews
  • Shikha Mishra· Oct 10, 2024

    postgresql-expert-best-practices-code-review is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Piyush G· Sep 9, 2024

    Keeps context tight: postgresql-expert-best-practices-code-review is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Chaitanya Patil· Aug 8, 2024

    Registry listing for postgresql-expert-best-practices-code-review matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Sakshi Patil· Jul 7, 2024

    postgresql-expert-best-practices-code-review reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Ganesh Mohane· Jun 6, 2024

    I recommend postgresql-expert-best-practices-code-review for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Oshnikdeep· May 5, 2024

    Useful defaults in postgresql-expert-best-practices-code-review — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Dhruvi Jain· Apr 4, 2024

    postgresql-expert-best-practices-code-review has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Rahul Santra· Mar 3, 2024

    Solid pick for teams standardizing on skills: postgresql-expert-best-practices-code-review is focused, and the summary matches what you get after install.

  • Pratham Ware· Feb 2, 2024

    We added postgresql-expert-best-practices-code-review from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Yash Thakker· Jan 1, 2024

    postgresql-expert-best-practices-code-review fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.