database-architect — Claude Code subagent: schema design and DB choice
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.
npx claude-code-templates@latest --agent database/database-architectWhat database-architect 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.
What it helps with
- 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 for the agent
- 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
How to install database-architect
1claude-code-templates
npx claude-code-templates@latest --agent database/database-architect2Manually: put the files in place
.claude/agents/database-architect.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/database-architect.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/database-architect.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about database-architect
How do I install database-architect in Claude Code?
Run npx claude-code-templates@latest --agent database/database-architect, then confirm the agent file landed at .claude/agents/database-architect.md.
What does database-architect do?
It designs schemas and data models, plans scalability, selects database technology and maps out migrations. Output includes DDL, rollback scripts and written rationale.
How is database-architect different from postgres-pro?
database-architect handles design and planning. PostgreSQL tuning and Neon-specific work are handed off to other agents.