# database-architect

A subagent for schema design, database selection and migration planning. Reach for it when the question is how data should be stored, not how to write a query.

- subagent · `type=agent` · Claude Code · 12224 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/agents/database/database-architect.md
- Updated: 2026-10-25
- HTML: https://affpapa.org/en/nevibecode/agents/database-architect

## What it does

database-architect runs on the sonnet model inside Claude and can call Read, Write, Edit, Bash, Glob and Grep. On invocation it hunts through the repository for migration files and ORM definitions — Prisma, SQLAlchemy, ActiveRecord — then works out the access patterns: read/write mix, consistency needs, data volume, latency targets. The request gets sorted into one of four buckets: greenfield design, schema evolution, technology selection, or restructuring for performance.

What comes back is deliverables rather than opinions. DDL with constraints and indexes, migration scripts that include rollback, written rationale for a database choice, architecture diagrams. The framework behind it covers domain-driven design, normalization, sharding, CQRS, event sourcing and the database-per-service pattern.

The agent description draws its own boundary: PostgreSQL tuning belongs to postgres-pro, Neon-specific work to neon-database-architect. Bring it a question about index behaviour on a live instance and you have picked the wrong agent.

## Requirements
- Works with: PostgreSQL

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --agent database/database-architect
```

2. **Manually: put the files in place**
- File: `.claude/agents/database-architect.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/database-architect.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/database-architect.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/agents/database/database-architect.md

## When to use it
- design a schema from scratch for a multi-tenant app
- pick between relational, document and vector stores for known access patterns
- split a monolithic database into per-service databases
- write a migration with rollback and consistency checkpoints
- align table structure with business domains

## Example prompts
- Design the database schema for a multi-tenant project management app: projects, tasks, comments, attachments, user permissions
- Help me choose a storage stack for a recommendation engine: behaviour events, ML feature queries, results under 100ms
- Plan splitting a MySQL monolith into five service databases with a cutover that avoids downtime

## Similar
- [database-migrations](https://affpapa.org/en/nevibecode/skills/database-migrations.md) — skill · 5200 installs
- [database-schema-designer](https://affpapa.org/en/nevibecode/skills/database-schema-designer.md) — skill · 692 installs
- [golang-database](https://affpapa.org/en/nevibecode/skills/golang-database.md) — skill · 40800 installs
- [ai-engineer](https://affpapa.org/en/nevibecode/agents/ai-engineer.md) — subagent · 7687 installs
- [business-analyst](https://affpapa.org/en/nevibecode/agents/business-analyst.md) — subagent · 3855 installs
- [sql-pro](https://affpapa.org/en/nevibecode/agents/voltagent-community-sql-pro.md) — subagent · 3602 installs
- [sql-pro](https://affpapa.org/en/nevibecode/agents/sql-pro.md) — subagent · 3602 installs
- [data-scientist](https://affpapa.org/en/nevibecode/agents/voltagent-community-data-scientist.md) — subagent · 3342 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 495 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
