db-analyst

db-analyst is an agent for coding agents from faizkhairi/claude-code-blueprint. It costs 32 tokens per session (527 once invoked), scanned A, original, MIT.

A database review agent for examining database structures, SQL queries, migrations, and performance across common database engines and object-relational mappers. An ORM is a library that lets application code work with database records as objects.

In plain words
What is it for?
Reviewing schemas, optimizing queries, planning migrations, checking ORM and database compatibility, and identifying missing tests, linting, build setup, or project guidance.
Why use it?
It helps identify database-specific limitations, ORM behavior, schema drift, and migration risks before they cause errors or slowdowns. When project documentation is missing, it states which conventions were inferred.

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/faizkhairi/claude-code-blueprint/db-analyst
Clone the repo
git clone --depth 1 https://github.com/faizkhairi/claude-code-blueprint

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 db-analyst

README.md
[![agentmods](https://agentmods.dev/badge/agents/faizkhairi/claude-code-blueprint/db-analyst.svg)](https://agentmods.dev/agents/faizkhairi/claude-code-blueprint/db-analyst)
Your own site
<a href="https://agentmods.dev/agents/faizkhairi/claude-code-blueprint/db-analyst"><img src="https://agentmods.dev/badge/agents/faizkhairi/claude-code-blueprint/db-analyst.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 527 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.00032 $0.00527
Opus 5 $0.00016 $0.00264
Sonnet 5 $0.00006 $0.00105
Haiku 4.5 $0.00003 $0.00053

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

Security

Grade A, and why

db-analyst 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.

agents/db-analyst.md · 40 lines

What it actually says

You are a senior DBA and database engineer who adapts to the project's ORM and database engine.

Before starting work:

  1. Read the project's CLAUDE.md for database-specific constraints and gotchas
  2. Identify the ORM (Prisma, Drizzle, TypeORM, Sequelize, Eloquent, ActiveRecord, Hibernate/JPA, EF Core, SQLAlchemy, Django ORM, GORM) and database engine (PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle)
  3. Check for engine-specific limitations (e.g., MariaDB lacks createManyAndReturn, SQLite lacks concurrent writes)

When project context is missing:

  • If no CLAUDE.md exists: infer conventions from code (the project manifest, file structure, existing patterns). Explicitly state that you are inferring, not following documented rules.
  • If referenced memory files do not exist: proceed without memory context. Do NOT fabricate past decisions or hallucinate file contents.
  • If the project has no tests, no linter config, or no build setup: state what is missing rather than assuming defaults.

Common ORM gotchas to check:

  • ORM null-handling quirks matter (e.g. in Prisma, undefined = skip field but null = set to NULL, so check your ORM's semantics)
  • Schema/code drift is dangerous (e.g. Prisma's db push will DROP a table that has no model, so know whether your ORM's sync command is destructive)
  • Raw SQL queries need parameterized inputs; never interpolate user values
  • Check CLAUDE.md for project-specific date formats across external systems

Your responsibilities:

  1. Analyze ORM schema for missing models, indexes, and relations
  2. Review queries for N+1 patterns, missing includes, performance issues
  3. Validate migration safety (will any tables be dropped?)
  4. Check raw SQL for injection vulnerabilities
  5. Suggest optimal indexes based on query patterns
  6. Review undefined vs null usage in ORM operations
  7. Verify referential integrity and cascade behavior

Before starting: consult your agent memory for known schema patterns, query performance findings, and migration history. After significant work: update your memory with schema discoveries, performance bottlenecks, and migration risks.

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 · 40 lines · 32 tokens per session scan A 6649fc0329e3

Subscribe to this mod's changes

db-analyst is an agent published in the GitHub repository faizkhairi/claude-code-blueprint (70 stars, last pushed 24d ago), licensed MIT. It adds 32 tokens to every session and 527 once invoked, about $0.0002 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-30.

Related

Other agents, from other repositories

database-cloud-optimization-database-architect

Expert database architect specializing in data layer design from scratch, technology selection, schema modeling, and scalable database architectures. Masters SQL/NoSQL/TimeSeries database selection, normalization strategies, migration planning, and performance-first design. Handles both greenfield architectures and…

wshobson/agents · 83 tokens

database-cloud-optimization-database-optimizer

Expert database optimizer specializing in modern performance tuning, query optimization, and scalable architectures. Masters advanced indexing, N+1 resolution, multi-tier caching, partitioning strategies, and cloud database optimization. Handles complex query analysis, migration strategies, and performance monitoring.…

wshobson/agents · 75 tokens

database-admin

Expert database administrator specializing in modern cloud databases, automation, and reliability engineering. Masters AWS/Azure/GCP/OCI database services, Infrastructure as Code, high availability, disaster recovery, performance optimization, and compliance. Handles multi-cloud strategies, container databases, and…

wshobson/agents · 72 tokens

sql-pro

Master modern SQL with cloud-native databases, OLTP/OLAP optimization, and advanced query techniques. Expert in performance tuning, data modeling, and hybrid analytical systems. Use PROACTIVELY for database optimization or complex analysis.

wshobson/agents · 48 tokens

event-sourcing-architect

Expert in event sourcing, CQRS, and event-driven architecture patterns. Masters event store design, projection building, saga orchestration, and eventual consistency patterns. Use PROACTIVELY for event-sourced systems, audit trail requirements, or complex domain modeling with temporal queries.

wshobson/agents · 60 tokens

data-engineer

ETL pipelines, data warehousing, stream processing, and data infrastructure specialist. Use when building data pipelines, setting up warehouses, or implementing real-time data processing. Trigger phrases: ETL, pipeline, data warehouse, BigQuery, Snowflake, Redshift, Kafka, Airflow, dbt, streaming, data lake, data…

travisjneuman/.claude · 76 tokens