PostgreSQL Code Review for Openclaw

A specialized AI agent skill designed to audit PostgreSQL schemas and queries for performance, security, and transaction safety.

anderskev
v1.1.1
Apr 22, 2026
1
1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install postgres-code-review

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install postgres-code-review using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is PostgreSQL Code Review?

The PostgreSQL Code Review skill is a robust diagnostic tool for developers using Openclaw Skills to maintain high-performance database layers. It provides an automated yet evidence-bound approach to reviewing SQL queries, DDL migrations, and database connection logic, ensuring that your application follows industry best practices for PostgreSQL.

This skill focuses on critical areas such as indexing strategies, advanced JSONB operations, and the prevention of SQL injection. By integrating this into your development workflow, you can catch connection leaks, inefficient sequential scans, and transaction deadlocks before they reach production, maintaining a stable and scalable data architecture.

PostgreSQL Code Review Use Cases

  • Validating new database migrations for missing or inefficient indexes.
  • Auditing JSONB queries to ensure proper GIN index utilization and operator usage.
  • Reviewing application code for connection pool leaks and improper transaction handling.
  • Identifying potential SQL injection vulnerabilities in dynamic query generation.
  • Troubleshooting deadlock scenarios and long-running locks in high-concurrency environments.

How PostgreSQL Code Review Works

  1. Scope Definition: The skill identifies specific file paths and line ranges for SQL, DDL, and connection-handling code.
  2. Evidence-Based Analysis: It extracts concrete code citations for every performance or security claim to avoid speculative reporting.
  3. Binding Validation: The agent specifically checks how variables are bound to SQL statements to verify injection risks.
  4. Reference Cross-Referencing: It dynamically loads specific reference modules (indexes, jsonb, connections, or transactions) based on the code detected.
  5. Checklist Execution: The agent runs a comprehensive audit against a pre-defined checklist to ensure no critical database safety measures are missed.

PostgreSQL Code Review Setup

To integrate this skill into your Openclaw Skills environment, ensure your project includes the PostgreSQL reference documentation in the references/ directory.

# Example: Running a review on your repository
openclaw run postgres-code-review --path ./src/db

Ensure that indexes.md, jsonb.md, connections.md, and transactions.md are accessible for the skill to pull technical specifications during the review process.

PostgreSQL Code Review Data Schema & Taxonomy

The skill organizes its findings based on a strict evidence-bound taxonomy. Findings are mapped to the following reference structure:

Module Focus Area
indexes.md B-Tree/Hash indexes, sequential scans, and composite index order.
jsonb.md GIN indexes and operators like @>, ?, and ->.
connections.md Pool limits, timeouts, and context manager usage.
transactions.md Isolation levels, advisory locks, and deadlock prevention.

All findings must include a file:line citation and a quoted excerpt from the source code.

PostgreSQL Code Review Advanced Features

  • Multi-stage gating system ensures all findings are backed by code citations.
  • Specialized logic for JSONB operator optimization and GIN index validation.
  • Context-aware loading of reference materials to reduce token usage and increase accuracy.
  • Support for application-level coordination reviews using PostgreSQL advisory locks.
  • Deep analysis of transaction isolation levels (Read Committed vs. Serializable) based on specific use cases.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*