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
explanation-docs
Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do
tutorial-docs
Tutorial patterns for documentation - learning-oriented guides that teach through guided doing
pytest-code-review
Reviews pytest test code for async patterns, fixtures, parametrize, and mocking. Use when reviewing test_*.py files, checking async test functions, fixture usage, or mock patterns.
reference-docs
Reference documentation patterns for API and symbol documentation. Use when writing reference docs, API docs, parameter tables, or technical specifications. Triggers on reference docs, API reference, function reference, parameters table, symbol documentation.
serde-code-review
Reviews serde serialization code for derive patterns, enum representations, custom implementations, and common serialization bugs. Use when reviewing Rust code that uses serde, serde_json, toml, or any serde-based serialization format. Covers attribute macros, field renaming, and format-specific pitfalls.