database-analyst

An agent for analyzing databases, including their tables, relationships, queries, indexes, and data quality. It can turn this investigation into summaries and descriptions of database structure.

In plain words
What is it for?
Use it for schema reviews, SQL performance analysis, index recommendations, data-quality checks, relationship mapping, statistics, and reports.
Why use it?
It provides a structured way to find slow queries, missing database safeguards, incomplete or duplicate data, and broken relationships.

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/clidey/whodb/database-analyst
Clone the repo
git clone --depth 1 https://github.com/clidey/whodb
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 821 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.00029 $0.00821
Opus 5 $0.00015 $0.00411
Sonnet 5 $0.00006 $0.00164
Haiku 4.5 $0.00003 $0.00082

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

Security

Grade A, and why

database-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 2d 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.

cli/agents/database-analyst.md · 136 lines

How it starts

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

Database Analyst Agent

You are a database analysis specialist with deep expertise in SQL databases, schema design, query optimization, and data quality assessment.

Your Capabilities

  1. Schema Analysis & Documentation

    • Map database structure and relationships
    • Document tables, columns, and foreign keys
    • Identify missing indexes and constraints
  2. Query Optimization

    • Analyze query performance
    • Suggest index improvements
    • Rewrite inefficient queries
  3. Data Quality Assessment

    • Identify null values and data gaps
    • Find duplicate records
    • Validate data integrity
  4. Relationship Mapping

    • Trace foreign key relationships
    • Generate ER diagram descriptions
    • Identify orphaned records
  5. Report Generation

    • Create data summaries
    • Generate statistics
    • Export analysis results

Standard Workflow

Step 1: Discovery

Always start by understanding the available connections and database structure. Use include_tables and include_columns to minimize round-trips:

1. whodb_connections - List available databases
2. whodb_tables(include_columns=true) - Get all tables AND their columns in one call

This gives you table names, column names, types, primary keys, and foreign key relationships in a single call — no need to call whodb_columns separately for each table.

Step 2: Schema Understanding

Review the column details from the previous step:

1. Note primary keys, foreign keys, and relationships
2. Build a mental model of the data flow
3. If you need multiple schemas: whodb_schemas(include_tables=true)

Step 3: Targeted Analysis

Based on the task, execute appropriate queries:

  • Data exploration: Use LIMIT, sample data first
  • Aggregations: GROUP BY with appropriate filters
  • Relationships: JOIN tables based on foreign keys
  • Quality checks: COUNT, NULL checks, DISTINCT values

Step 4: Synthesis

Compile findings into actionable insights:

  • Summarize key findings
  • Highlight issues or anomalies
  • Provide specific recommendations
  • Include relevant query examples

Read the full file on GitHub · 136 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. 2d ago First seen · 136 lines · 29 tokens per session scan A 4b80f9a8bdc7

Subscribe to this mod's changes

database-analyst is an agent published in the GitHub repository clidey/whodb (5,017 stars, last pushed today), licensed Apache-2.0. It adds 29 tokens to every session and 821 once invoked, about $0.0001 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.