# db-wasp-drone

db-wasp-drone — a PostgreSQL architecture subagent for schema design, indexes, migrations, ORM decisions, query plans, and serverless database selection.

- subagent · `type=agent` · Claude Code, Codex, Cursor · ★ 96 repo stars
- Author: Legion Code Inc.
- License: AGPL-3.0-or-later · policy=link-only · description only; the file stays with the author
- Source: https://github.com/legioncodeinc/vibe-coding-tools/tree/HEAD/plugins/data-and-ai-tools/agents/db-wasp-drone.md
- Updated: 2026-10-18
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/agents/db-wasp-drone

## What it does

db-wasp-drone reviews PostgreSQL data architecture across schema design, indexing, migration safety, query performance, pooling, ORM selection, and serverless database choice. It compares Drizzle, Prisma, and raw SQL, reads `EXPLAIN (ANALYZE, BUFFERS)` plans, and covers Supabase, Neon, Turso, PlanetScale, CockroachDB, and Tiger Data.

The workflow starts with the project’s DDL or ORM schema, recent migrations, query plans, pooler settings, and ORM versions. Index reviews distinguish B-tree, GIN, GiST, BRIN, partial, and covering indexes; the package also includes `scripts/audit-missing-indexes.sql`. Tables larger than 1M rows require an expand-backfill-contract migration plan, with `pgroll` available for online changes.

This subagent routes PRD writing, RLS or PII security audits, encryption-at-rest checks, and RAG retrieval work to other agents. A serious review needs the relevant schema, migration, or query plan first.

## Requirements
- Works with: PostgreSQL, Supabase

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add legioncodeinc/vibe-coding-tools
```
In the agent chat (not a shell):
```text
/plugin install data-and-ai-tools@wasp-nest
```

2. **Manually: put the files in place**
- File: `.claude/agents/db-wasp-drone.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/db-wasp-drone.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/db-wasp-drone.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/legioncodeinc/vibe-coding-tools/tree/HEAD/plugins/data-and-ai-tools/agents/db-wasp-drone.md

## When to use it
- design a relational PostgreSQL schema
- choose an index for a workload and column type
- plan a safe migration for a large table
- diagnose a slow query from `EXPLAIN` output
- compare Drizzle, Prisma, and raw SQL

## Example prompts
- Design a PostgreSQL schema for this feature and recommend its indexes.
- Review this migration for a table larger than 1M rows and split it into safe phases.
- Read this `EXPLAIN (ANALYZE, BUFFERS)` plan and identify the missing index.

## Similar
- [postgres-patterns](https://affpapa.org/en/nevibecode/skills/postgres-patterns.md) — skill · 7200 installs
- [postgres-best-practices](https://affpapa.org/en/nevibecode/skills/neondatabase-postgres-best-practices.md) — skill · 2100 installs
- [database-designer](https://affpapa.org/en/nevibecode/skills/borghei-database-designer.md) — skill · 176 installs
- [dsql](https://affpapa.org/en/nevibecode/skills/dsql.md) — skill · 952 installs
- [prisma-8](https://affpapa.org/en/nevibecode/skills/prisma-8.md) — skill · 325 installs
- [Supabase Developer](https://affpapa.org/en/nevibecode/skills/supabase-developer.md) — skill · 187 installs

From the same set: [legioncodeinc/vibe-coding-tools](https://affpapa.org/en/nevibecode/by/legioncodeinc/vibe-coding-tools.md) — 172 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
