postgres-code-review
Reviews PostgreSQL code for indexing strategies, JSONB operations, connection pooling, and transaction safety. Use when reviewing SQL queries, database schemas, JSONB usage, or connection management.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/anderskev/postgres-code-reviewWhat This Skill Does
The postgres-code-review skill is a specialized diagnostic tool designed to analyze PostgreSQL-specific code patterns, database schemas, and application-level database interaction logic. It acts as an expert DBA reviewer that inspects your implementation for common bottlenecks, security risks, and architectural anti-patterns. By focusing on four pillars—indexing, JSONB utilization, connection management, and transaction safety—the skill ensures that your database layer remains performant, resilient, and secure.
Installation
To integrate this skill into your OpenClaw environment, execute the following command in your terminal:
clawhub install openclaw/skills/skills/anderskev/postgres-code-review
Use Cases
This skill is ideal for:
- Auditing performance of SELECT queries involving complex JOINs and WHERE clauses.
- Optimizing JSONB field access, including verifying appropriate GIN or BTREE index support for document storage.
- Debugging connection leakage in high-concurrency environments or ensuring proper cleanup in Python/Node/Go database drivers.
- Analyzing transactional logic to identify race conditions, deadlocks, or inappropriate isolation level usage.
- Verifying the implementation of application-level locking using advisory locks.
Example Prompts
- "Review this code snippet for potential connection leaks and check if the WHERE clause will hit an index: [Paste Code]"
- "I am seeing high CPU usage on my Postgres instance with JSONB queries. Can you check if my schema and operators are optimized?"
- "Analyze these three functions for transaction safety and potential deadlocks: [Link or Code]"
Tips & Limitations
To get the best results, provide the schema definition alongside your application code. The skill is highly accurate at identifying static code issues, but cannot execute queries against your live database to measure latency. Always test suggested index changes in a staging environment using EXPLAIN ANALYZE before applying them to production. If your database uses custom extensions like PostGIS or Citus, explicitly mention these in your prompt, as optimization strategies may differ significantly from standard Postgres configurations.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-anderskev-postgres-code-review": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Related Skills
tutorial-docs
Tutorial patterns for documentation - learning-oriented guides that teach through guided doing
fetch-pr-feedback
Fetch review comments from a PR and evaluate with receive-feedback skill
swift-testing-code-review
Reviews Swift Testing code for proper use of
rust-testing-code-review
Reviews Rust test code for unit test patterns, integration test structure, async testing, mocking approaches, and property-based testing. Covers Rust 2024 edition changes including async fn in traits for mocks,
explanation-docs
Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do