database-reviewer

database-reviewer is an agent for coding agents from hmj1026/dhpk. It costs 95 tokens per session (1,083 once invoked), scanned A, original, MIT.

A database review agent for relational databases and object stores that checks queries, repository code, migrations, and schema changes.

In plain words
What is it for?
Use it as a final review after writing migrations, SQL queries, repository methods, or other database schema changes.
Why use it?
It helps catch unsafe queries, missing indexes, repeated database requests, and incorrect transaction handling before changes are finalized.

Agent

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the dhpk plugin — 19 commands, 36 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/hmj1026/dhpk/database-reviewer
Clone the repo
git clone --depth 1 https://github.com/hmj1026/dhpk

Or install dhpk, the plugin that ships this one along with the rest of its 19 commands, 36 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for database-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/hmj1026/dhpk/database-reviewer.svg)](https://agentmods.dev/agents/hmj1026/dhpk/database-reviewer)
Your own site
<a href="https://agentmods.dev/agents/hmj1026/dhpk/database-reviewer"><img src="https://agentmods.dev/badge/agents/hmj1026/dhpk/database-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 95 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,083 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00095 $0.01083
Opus 5 $0.00048 $0.00541
Sonnet 5 $0.00019 $0.00217
Haiku 4.5 $0.00010 $0.00108

Measured 4d ago against content hash 36841f75fa32, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

database-reviewer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/database-reviewer.md · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Reviewer

Lookup: cx / gitnexus per ${CLAUDE_PLUGIN_ROOT}/rules/tool-routing.md.

Scope

Sentinel-scoped precedence: see ${CLAUDE_PLUGIN_ROOT}/rules/execution-policy.md "Sentinel-scoped precedence" — apply verbatim, sentinel = .pending-db-review (back-stop example: reviewing a Repository method proactively with no sentinel present).

When NOT

  • Migration reversibility / online DDL / up-down symmetry → migration-reviewer
  • Latency / N+1 / EXPLAIN / query-count regressions (performance, not correctness) → performance-analyzer

Stack trap sheet (load on demand)

Detect the active stack, then load ONLY the matching trap sheet(s); ignore other stacks — never check a relational SQL change against Core Data rules, or vice-versa.

1-2. Loader: ${CLAUDE_PLUGIN_ROOT}/agent-traps/_common/trap-sheet-loader.md (<agent-name> = database-reviewer). Manifest detection also covers *.xcdatamodeld and pyproject.toml's sqlalchemy/alembic deps. 3. Engine overlay (independent of framework): if a Postgres driver is present — pg / postgres / @supabase/* in package.json, psycopg / asyncpg / sqlalchemy[postgresql] in pyproject.toml, */pgsql* in composer.json, or a supabase/ dir — also Read database-reviewer/postgres.md for RLS / index / keyset-pagination traps. 4. No sheet matches → apply only the Baseline below.

Baseline (language-agnostic)

  • Parameterize everything — every dynamic query is parameter-bound; never string-concatenate untrusted input into SQL / predicates.
  • Indexing — hot WHERE / ORDER BY columns are indexed; composite-index column order matches the predicate.
  • No N+1 — fetch related rows via eager loading / batch fetch, not a query inside a loop.
  • Transactions — wrap multi-step writes in one transaction; update rows in a consistent order to avoid deadlocks.
  • Reversible migrations — every migration has a working down / rollback path.
  • Query plans — sample EXPLAIN / the query plan for complex queries; watch for full table scans.

Read the full file on GitHub · 83 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 83 lines · 95 tokens per session scan A 36841f75fa32

Subscribe to this mod's changes

database-reviewer is an agent published in the GitHub repository hmj1026/dhpk (2 stars, last pushed 4d ago), licensed MIT. It adds 95 tokens to every session and 1,083 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

dba

Octopus 資料庫專家——關聯式 DB 諮詢,專精 SQL Server / SQLite / PostgreSQL 三方言。schema 設計、dialect 差異、migration 影響、索引與效能。只讀 schema/migration 檔,不連實體 DB。.

SatoruoGojoo/octopus · 70 tokens

data-engineer

Adversarial data and database engineer who assumes the design is mis-normalized and indexed for a workload that does not exist. Audits schemas, migrations, queries, ORM code, document shapes, stream contracts, and pipelines against normalization, dimensional modeling, key-value access patterns, columnar and…

testdouble/han · 216 tokens

ia-database-guardian

Reviews database schema, constraints, and migration code for safety. Use when PRs touch migrations, data models, ID mappings, enum conversions, backfills, or persistent data.

iliaal/whetstone · 41 tokens

reviewer-data-integrity

Use this agent when you need to review database migrations, data models, or any code that manipulates persistent data. This includes checking migration safety, validating data constraints, ensuring transaction boundaries are correct, and verifying that referential integrity and privacy requirements are maintained.…

wsauret/flywheel · 253 tokens

reviewer-performance

Use this agent when you need to analyze code for performance issues, optimize algorithms, identify bottlenecks, or ensure scalability. This includes reviewing database queries, memory usage, caching strategies, and overall system performance. The agent should be invoked after implementing features or when performance…

wsauret/flywheel · 345 tokens

dba

Database specialist adapting to any engine (PostgreSQL, MySQL, SQLite, MongoDB, etc.) — schema design.

cdeust/zetetic-team-subagents · 27 tokens