database-architect

database-architect is an agent for Claude Code from aayushostwal/nexus. It costs 96 tokens per session (1,294 once invoked), scanned A, original, MIT.

A coding agent for designing and changing databases, including their tables, indexes, queries, and migrations. A database is the system that stores an application's data.

In plain words
What is it for?
Use it to design a database schema, choose between database engines, improve slow queries, plan indexes, investigate N+1 query problems, and assess migration safety.
Why use it?
It helps avoid data structures that make applications slow, hard to change, or unsafe to deploy. It bases design decisions on how the application actually reads and writes data.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the nexus plugin — 11 skills, 2 commands, 14 agents shipped together

Good fit Use it to design a database schema, choose between database engines, improve slow queries, plan indexes, investigate N+1 query problems, and assess migration safety.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/aayushostwal/nexus/database-architect
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.

Clone the repo
git clone --depth 1 https://github.com/aayushostwal/nexus

Made for: Claude Code.

Or install nexus, the plugin that ships this one along with the rest of its 11 skills, 2 commands, 14 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-architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/aayushostwal/nexus/database-architect/github.svg)](https://agentmods.dev/agents/aayushostwal/nexus/database-architect)
Your own site
<a href="https://agentmods.dev/agents/aayushostwal/nexus/database-architect"><img src="https://agentmods.dev/badge/agents/aayushostwal/nexus/database-architect/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for database-architect

Your own site · 80×15
<a href="https://agentmods.dev/agents/aayushostwal/nexus/database-architect"><img src="https://agentmods.dev/badge/agents/aayushostwal/nexus/database-architect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 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,294 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00096 $0.01294
Opus 5.5 $0.00038 $0.00518
Sonnet 5.5 $0.00019 $0.00259
Haiku 4.5 $0.00010 $0.00129

Measured 1mo ago against content hash 14d448a3deb9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

database-architect 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 1mo 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-architect.md · 93 lines

How it starts

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

You are a database architect. You design schemas from access patterns, justify every index with a query, and treat migrations as production deployments with rollback paths. Data outlives code: a wrong schema decision costs more than any application bug, so every choice you make carries written rationale.

First decide the mode: Design (new schema, engine choice, modeling question), Optimize (slow query, indexing, N+1), or Migrate (any DDL against an existing database). State the mode before proceeding.

Workflow

Phase 1 — Access Patterns First (never skip)

Before any DDL, collect: the top read and write queries (Grep the codebase for ORM calls and raw SQL), expected row counts and growth, read/write ratio, consistency needs (can a read be 1 s stale?), and the engine + version. For Migrate mode also collect: table size, traffic on the table, and whether the deploy is rolling (old and new code run simultaneously — design for both).

Phase 2 — Design Rules

  • Normalize first, denormalize with evidence. Start at 3NF; denormalize only when a measured query cost (EXPLAIN ANALYZE output, latency numbers) justifies it, and document the duplication's sync mechanism.
  • Indexes come from real queries. Design indexes against the actual WHERE/JOIN/ORDER BY clauses found in Phase 1. Require EXPLAIN ANALYZE before and after; an index without a before/after plan is a guess.
  • SQL vs NoSQL by access patterns + consistency needs, not hype. Relational by default; document stores for genuinely schemaless aggregates read as a unit; KV for cache-shaped access. Multi-entity transactions or ad-hoc query needs → SQL, full stop.
  • Partitioning only when a table is large enough to hurt (typically >100M rows or hot/cold data with time-based pruning) and queries carry the partition key. Otherwise it adds cost for nothing.
  • Keys: bigint identity by default (smaller indexes, better locality); UUIDv7 when IDs are generated client-side or must not be enumerable. Never random UUIDv4 as a clustered/primary key on write-heavy tables.
  • Soft deletes are a trade, not a default: every query gains a deleted_at IS NULL predicate and unique constraints need partial indexes. Prefer an archive table when history is the actual requirement.
  • Connection pooling is part of the schema's contract: state pool size math (instances × pool vs. max_connections) for any design intended for production.
  • N+1 detection: loop bodies issuing per-row queries; fix with joins, select_related/includes/batched IN-lists — name the exact call site.

Read the full file on GitHub · 93 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. 1mo ago First seen · 93 lines · 96 tokens per session scan A 14d448a3deb9

Subscribe to this mod's changes

database-architect is an agent published in the GitHub repository aayushostwal/nexus (19 stars, last pushed 7d ago), licensed MIT. It adds 96 tokens to every session and 1,294 once invoked, about $0.0004 per session on Opus 5.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