# database-design

This skill guides Claude Code through database and ORM selection, schema design, and query tuning. It stops the model from blindly picking PostgreSQL for every project.

- skill · `type=skill` · Claude Code · 994 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/skills/development/database-design
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/database-design

## What it does

The skill provides architectural rules and reference guides for data modeling. Instead of pasting generic SQL templates, the agent evaluates project requirements, asks clarifying questions, and picks the right engine. It will suggest SQLite for small tools rather than defaulting to PostgreSQL.

Its documentation is split into focused files: database evaluation across PostgreSQL, Neon, Turso, and SQLite (`database-selection.md`), ORM comparisons for Drizzle, Prisma, and Kysely (`orm-selection.md`), schema normalization (`schema-design.md`), indexing strategies (`indexing.md`), safe migrations (`migrations.md`), and query optimization with `EXPLAIN ANALYZE` (`optimization.md`). The assistant only inspects the file that answers the immediate question.

The checklist stops bad habits like relying on `SELECT *` in production code or dumping structured entities into JSON columns. The agent will not assemble tables until it confirms the deployment setup and table relationships.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill development/database-design
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill database-design -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/database-design/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/database-design/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/database-design/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates database-design
```

2. **Manually: put the files in place**
- File: `.github/skills/database-design/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/database-design
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/database-design/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

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/skills/development/database-design

## When to use it
- Pick an optimal database engine between SQLite, PostgreSQL, Neon, and Turso
- Compare ORM and query builder options such as Drizzle, Prisma, or Kysely
- Design normalized database schemas, primary keys, and relations
- Plan index configurations and eliminate N+1 query bottlenecks
- Prepare safe migration steps for serverless database environments

## Example prompts
- Help me design a database schema for an e-commerce backend and suggest composite indexes.
- Which stack works better for a serverless API: Turso with Drizzle or PostgreSQL with Prisma?
- Audit my current queries for N+1 issues and explain the execution plan.

## Similar
- [xlsx](https://affpapa.org/en/nevibecode/skills/xlsx.md) — skill · 187223 installs
- [google-agents-cli-observability](https://affpapa.org/en/nevibecode/skills/google-agents-cli-observability.md) — skill · 511300 installs
- [caveman-evidence-review](https://affpapa.org/en/nevibecode/skills/caveman-evidence-review.md) — skill · 104500 installs
- [migration](https://affpapa.org/en/nevibecode/skills/migration.md) — skill · 103900 installs
- [performance-optimization](https://affpapa.org/en/nevibecode/skills/performance-optimization.md) — skill · 65200 installs
- [supabase](https://affpapa.org/en/nevibecode/skills/supabase.md) — skill · 8 installs

## Other versions with the same name
- [database-design · moizibnyousaf](https://affpapa.org/en/nevibecode/skills/moizibnyousaf-database-design.md) — 604 installs
- [database-design · spencerpauly](https://affpapa.org/en/nevibecode/skills/spencerpauly-database-design.md) — 462 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
