# neon-database-architect

A subagent for designing Neon schemas, wiring up Drizzle ORM and tuning queries for serverless workloads.

- subagent · `type=agent` · Claude Code · 478 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/neon-database-architect.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/agents/neon-database-architect

## What it does

The subagent starts by scanning your project: it looks for `drizzle.config.*`, schema and migration files, and greps for `DATABASE_URL`, `drizzle` and `neon`. From there it proposes concrete changes — table structure, migrations, cold-start optimizations.

Its technical standards cover the `neon-http` Drizzle adapter, `DATABASE_URL` from environment variables, normalized schemas with Postgres types like JSONB, arrays and enums, plus indexes and constraints. Repeated queries become prepared statements, inserts become batch operations. Transaction examples and a connection-error wrapper are included too.

It runs with `Read`, `Write`, `Edit`, `Bash`, `Grep` and `Glob`, so it reads and edits files in your repo directly. You need `@neondatabase/serverless`, `drizzle-orm` and `drizzle-kit` installed, and a connection string in `DATABASE_URL`. On a project that does not use Neon and Drizzle, there is nothing here for it to do — worth checking your stack first.

## Requirements
- Works with: PostgreSQL

## Install

### Claude Code (native platform)

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

2. **Manually: put the files in place**
- File: `.claude/agents/neon-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/neon-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/neon-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/neon-database-architect.md

## When to use it
- design a normalized Postgres schema for Neon
- wire Drizzle ORM through the `neon-http` adapter
- cut cold-start latency in serverless functions
- convert repeated queries to prepared statements
- replace a loop of single inserts with one batch insert

## Example prompts
- review my database schema and suggest Neon-specific optimizations
- set up the Drizzle connection to Neon using environment variables
- rewrite this query as a prepared statement

## Similar
- [neon](https://affpapa.org/en/nevibecode/skills/neon.md) — skill · 234000 installs
- [neon-functions](https://affpapa.org/en/nevibecode/skills/neon-functions.md) — skill · 27900 installs
- [database-design](https://affpapa.org/en/nevibecode/skills/spencerpauly-database-design.md) — skill · 462 installs
- [database-migrations](https://affpapa.org/en/nevibecode/skills/database-migrations.md) — skill · 5200 installs
- [golang-database](https://affpapa.org/en/nevibecode/skills/golang-database.md) — skill · 40800 installs
- [postgresql-database-engineering](https://affpapa.org/en/nevibecode/skills/postgresql-database-engineering.md) — skill · 1800 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 205 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
