postgres-code-review

Review PostgreSQL code for indexing, JSONB usage, and transaction safety.

75|9|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/anderskev/beagle --skill postgres-code-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-code-review
Source: https://github.com/anderskev/beagle/tree/main/skills/postgres-code-review
Command: npx skills add https://github.com/anderskev/beagle --skill postgres-code-review

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It guides examining PostgreSQL queries and schemas for indexing, JSONB usage, and transactional safety.

Core Features & Use Cases

  • Indexing & Performance: Validate WHERE/JOIN indexes and query plans.
  • JSONB Usage: Recommend appropriate operators and GIN indexes.
  • Transactions: Ensure proper isolation levels and safe commits.

Quick Start

Review a SQL script or ORM data access to ensure proper indexing and transaction handling.

Frequently Asked Questions about postgres-code-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review PostgreSQL queries for missing indexes?

Review PostgreSQL queries by examining WHERE and JOIN clauses to identify columns lacking indexes, then validate against query plans to confirm performance impact. The Skill guides analyzing index strategies to eliminate sequential scans and improve execution efficiency.

What's the best way to use JSONB operators and indexes in PostgreSQL?

JSONB operators like @>, ->, and @@ serve different query patterns; pair them with appropriate GIN indexes for fast lookups. The Skill recommends matching operators to your access patterns and validating index applicability to prevent full-table scans on JSON columns.

How do I ensure transaction safety in PostgreSQL applications?

Transaction safety requires choosing correct isolation levels, managing connection pooling to prevent leaks, and applying appropriate locking patterns. The Skill reviews your SQL and connection lifecycle to identify unsafe commits, race conditions, and improper resource handling.

Can I use this to review ORM-generated database code?

Yes. The Skill applies to SQL queries and schemas across application stacks, including ORM data access layers. It identifies indexing gaps, JSONB misuse, and transaction issues whether code is hand-written or framework-generated.

What connection pooling issues does PostgreSQL code review catch?

Connection pooling review detects improper lifecycle handling—unclosed connections, exhausted pool limits, and incorrect configuration. The Skill ensures your application reuses connections safely and avoids resource exhaustion in production.

Why do transaction isolation levels matter in PostgreSQL?

Isolation levels control how concurrent transactions interact; wrong choices cause dirty reads, phantom reads, or unnecessary lock contention. The Skill validates your isolation settings and locking patterns match your data consistency requirements.