postgres-code-review skill
✓ VerifiedReviews PostgreSQL code for indexing strategies, JSONB operations, connection pooling, and transaction safety.
- GitHub stars
- 87
- Files
- 5
- Last commit
- Sep 15, 2026
- License
- Apache-2.0
- Allowed tools
- —
What does the postgres-code-review skill do?
postgres-code-review reviews PostgreSQL code for indexing strategies, JSONB operations, connection pooling, and transaction safety.
Summary generated from the skill's SKILL.md.
About the postgres-code-review skill
Analyzing PostgreSQL code for performance and safety is what this skill enables for developers and database engineers. An agent should load this tool when reviewing SQL queries, database schemas, JSONB usage, or connection management logic. It produces evidence-bound critiques by checking for missing indexes, improper JSONB operators, connection leaks, and transaction isolation issues.
The process relies on specific reference documents including indexes.md, jsonb.md, connections.md, and transactions.md to validate findings. It requires the agent to cite exact file paths and line ranges for every critique to ensure conclusions are grounded in the actual code. The tool specifically checks for composite index column order, GIN index usage for JSONB, connection pool limits, and the presence of parameterized statements to prevent SQL injection.
What an agent can do with it
- 1Optimize SQL query performanceAn agent can evaluate if SELECT queries with WHERE or JOIN clauses will trigger sequential scans instead of using appropriate indexes.
- 2Audit JSONB implementationDevelopers can use this to ensure JSONB columns are utilizing GIN indexes and the correct operators like @> or ->>.
- 3Prevent database connection leaksThe skill helps verify that database connections are properly released using context managers or try/finally blocks.
- 4Identify transaction and locking risksAn AI client can check for long-running transactions that might hold locks or cause deadlocks.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the postgres-code-review skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the postgres-code-review skill in Plugin
/plugin marketplace add existential-birds/beagle /plugin install beagle-python@existential-birds
Install the postgres-code-review skill in Claude Code
~/.claude/skills/postgres-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/postgres-code-review ~/.claude/skills/postgres-code-reviewInstall the postgres-code-review skill in Claude Code (project)
.claude/skills/postgres-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/postgres-code-review .claude/skills/postgres-code-reviewInstall the postgres-code-review skill in Codex
~/.agents/skills/postgres-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/postgres-code-review ~/.agents/skills/postgres-code-reviewInstall the postgres-code-review skill in Gemini CLI
~/.gemini/skills/postgres-code-review/SKILL.md
$ npx degit existential-birds/beagle/plugins/beagle-python/skills/postgres-code-review ~/.gemini/skills/postgres-code-reviewInstall the postgres-code-review skill in Claude.ai
npx degit existential-birds/beagle/plugins/beagle-python/skills/postgres-code-review postgres-code-review && zip -r postgres-code-review.zip postgres-code-review # claude.ai → Customize → Skills → + → Create skill → Upload a skill → postgres-code-review.zip
Automated checks
Ran Nov 15, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachableexistential-birds/beagle/plugins/beagle-python/skills/postgres-code-review is public and reachablegithub.com/existential-birds/beagle/tree/HEAD/plugins/beagle ↗Pass
- Open source license (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Pass
- Commit or release in the last yearLast commit 2026-09-15github.com/existential-birds/beagle/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/existential-birds/beagle/blob/HEAD/plugins/beagle ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/existential-birds/beagle/blob/HEAD/plugins/beagle ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 54 linesgithub.com/existential-birds/beagle/blob/HEAD/plugins/beagle ↗Pass
SKILL.md
View on GitHubPostgreSQL Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| Missing indexes, wrong index type, query performance | references/indexes.md |
| JSONB queries, operators, GIN indexes | references/jsonb.md |
| Connection leaks, pool configuration, timeouts | references/connections.md |
| Isolation levels, deadlocks, advisory locks | references/transactions.md |
Review Checklist
- WHERE/JOIN columns have appropriate indexes
- Composite indexes match query patterns (column order matters)
- JSONB columns use GIN indexes when queried
- Using proper JSONB operators (
->,->>,@>,?) - Connection pool configured with appropriate limits
- Connections properly released (context managers, try/finally)
- Appropriate transaction isolation level for use case
- No long-running transactions holding locks
- Advisory locks used for application-level coordination
- Queries use parameterized statements (no SQL injection)
Gates (before reporting findings)
Use this sequence so conclusions stay evidence-bound (not “I checked mentally”):
- Scope — Record the concrete paths (and line ranges or symbols if helpful) for the SQL, DDL/migrations, and connection code under review. Pass: every subsystem you critique (queries, JSONB, pool, transactions) has at least one cited path.
- SQL/DDL citation for performance claims — Index, sequential-scan, JSONB-operator, and plan-related findings must point to the exact statement or schema (quoted excerpt or
file:line). Pass: each such finding includes that citation. - Binding check before injection flags — Only assert SQL-injection risk after locating how SQL and values are combined (bound parameters vs string concat/format/f-strings). Pass: you name the mechanism you saw in code for each flagged callsite.
Then load the relevant reference doc from Quick Reference and walk the Review Checklist.
When to Load References
- Reviewing SELECT queries with WHERE/JOIN → indexes.md
- Reviewing JSONB columns or JSON operations → jsonb.md
- Reviewing database connection code → connections.md
- Reviewing BEGIN/COMMIT or concurrent updates → transactions.md
Review Questions
- Will this query use an index or perform a sequential scan?
- Are JSONB operations using appropriate operators and indexes?
- Are database connections properly managed and released?
- Is the transaction isolation level appropriate for this operation?
- Could this cause deadlocks or long-running locks?
Files in this skill
5postgres-code-review skill questions
How do I install the postgres-code-review skill in Claude Code?
Run npx degit existential-birds/beagle/plugins/beagle-python/skills/postgres-code-review ~/.claude/skills/postgres-code-review. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the postgres-code-review skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What specific aspects of PostgreSQL does this skill review?
The skill reviews SQL queries, database schemas, JSONB usage, connection management, indexing strategies, and transaction safety.
How does the skill handle SQL injection findings?
The skill only asserts SQL injection risks after identifying the specific mechanism used to combine SQL and values, such as string concatenation versus bound parameters.