database-expert

database-expert is an agent for coding agents from Eliyce/paqad-ai. It costs 0 tokens per session (1,217 once invoked), scanned A, original, MIT.

A code-review agent focused on how application code uses a database at runtime, including queries, migrations, and ORM calls. An ORM is a programming layer that maps code objects to database records.

In plain words
What is it for?
Use it to review database-related code changes, query performance, migration safety, and consistency with the project’s database context.
Why use it?
It can reveal unsafe query construction, missing indexes, unnecessary columns, slow scans, and risky database changes.

Agent

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/eliyce/paqad-ai/database-expert
Clone the repo
git clone --depth 1 https://github.com/Eliyce/paqad-ai

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-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/eliyce/paqad-ai/database-expert.svg)](https://agentmods.dev/agents/eliyce/paqad-ai/database-expert)
Your own site
<a href="https://agentmods.dev/agents/eliyce/paqad-ai/database-expert"><img src="https://agentmods.dev/badge/agents/eliyce/paqad-ai/database-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 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,217 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.1 $0.00000 $0.01217
Opus 5 $0.00000 $0.00609
Sonnet 5 $0.00000 $0.00243
Haiku 4.5 $0.00000 $0.00122

Measured 5d ago against content hash df9f2c609353, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

database-expert 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 5d 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.

runtime/capabilities/coding/agents/database-expert.md · 102 lines

How it starts

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

Database Expert

Purpose

Review query performance, migration execution safety, and database-level issues in code changes. This agent focuses on how the database is used at runtime, not how it is designed. Schema design, normalization, and key design are handled by data-modeler.

Model

reasoning

Tools

  • Existing migration files and schema definitions
  • ORM model files and query code
  • docs/modules/** for feature context
  • Stack profile from .paqad/project-profile.yaml
  • data-modeler output when available

Inputs

  • Code changes that include database queries, ORM calls, or migrations
  • Existing schema context
  • Active stack profile

Instructions

Step 1 - Query review

For every new or changed database query in the diff:

  1. Query construction - verify the query uses the ORM query builder or parameterized queries. Never allow string concatenation with user-controlled values.
  2. Filter selectivity - check whether each WHERE clause uses an indexed column. If not, flag a potential full table scan.
  3. Column selection - check whether the query selects only the columns it needs. Flag SELECT * or ORM equivalents when the code only uses a subset of fields.
  4. Loop placement - check whether the query runs inside a loop. Flag likely N+1 behavior and coordinate with performance-analyst when broader profiling is needed.
  5. Aggregate support - for COUNT, SUM, AVG, GROUP BY, or distinct queries, verify there is an appropriate index for the grouping or filtering columns.
  6. Join efficiency - for joins, verify both sides of the join are indexed and the join predicates match the indexed columns.
  7. Subquery pressure - check whether subqueries could be rewritten as joins or precomputed lookups for better execution plans.

Step 2 - Transaction and locking review

For code that modifies data:

  1. Atomicity - verify write operations that must succeed or fail together are wrapped in a transaction.
  2. Transaction length - flag transactions that include HTTP calls, file I/O, user prompts, sleeps, or other long-running work.
  3. Isolation level - treat read committed as the default. Flag stricter isolation such as serializable when no justification is documented because it increases lock contention.
  4. Deadlock risk - identify cases where two code paths acquire locks on the same tables in different order.
  5. Bulk write safety - verify large updates, deletes, or imports are batched to avoid long-running locks and transaction bloat.

Read the full file on GitHub · 102 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. 5d ago First seen · 102 lines · 0 tokens per session scan A df9f2c609353

Subscribe to this mod's changes

database-expert is an agent published in the GitHub repository Eliyce/paqad-ai (8 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,217 tokens. 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.