# database-designer

The database-designer skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode reviews SQL schemas, suggests indexes, and creates migrations. Use it for DDL reviews, index tuning, or schema diffs.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 176 installs · ★ 1183 repo stars
- Author: borghei
- License: LicenseRef-MIT-Commons-Clause · policy=link-only · description only; the file stays with the author
- Source: https://github.com/borghei/Claude-Skills/tree/HEAD/engineering/database-designer/SKILL.md
- Updated: 2026-11-08
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/borghei-database-designer

## What it does

The skill includes three Python scripts: a schema analyzer, an index optimizer, and a migration generator. They work with DDL or JSON schemas; index suggestions also need query patterns.

The analyzer checks normalization, constraints, naming, and data types, and can produce a Mermaid ERD. The optimizer proposes single-column, composite, and covering indexes, while flagging overlap and redundancy. The migration tool compares two JSON schemas and outputs ordered forward and rollback SQL steps, risk levels, and validation queries.

Index suggestions depend on the supplied query patterns, so test each one with `EXPLAIN` on real data. The migration generator has a `--zero-downtime` mode for large or busy tables, but drops and type changes still call for careful review.

## Requirements
- Works with: PostgreSQL, MongoDB

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add borghei/Claude-Skills --skill database-designer -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add borghei/Claude-Skills --skill database-designer -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add borghei/Claude-Skills --skill database-designer -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install borghei/Claude-Skills engineering/database-designer/SKILL.md
```

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

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add borghei/Claude-Skills --skill database-designer -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/borghei/Claude-Skills --path engineering/database-designer
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add borghei/Claude-Skills --skill database-designer -a opencode
```

### 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/borghei/Claude-Skills/tree/HEAD/engineering/database-designer/SKILL.md

## When to use it
- spot normalization and constraint issues in an SQL schema
- choose indexes for known query patterns
- find redundant or overlapping indexes
- turn a schema diff into SQL with rollback steps
- generate a Mermaid ERD from DDL or JSON

## Example prompts
- Review `schema.sql` for normalization and missing constraints.
- Suggest indexes for `schema.json` using the patterns in `queries.json`.
- Compare `old.json` with `new.json` and create SQL with rollback and validation steps.

## Similar
- [database-management-patterns](https://affpapa.org/en/nevibecode/skills/database-management-patterns.md) — skill · 467 installs
- [database-schema-designer](https://affpapa.org/en/nevibecode/skills/onewave-ai-database-schema-designer.md) — skill · 432 installs
- [discover-database](https://affpapa.org/en/nevibecode/skills/discover-database.md) — skill · 125 installs
- [database-admin](https://affpapa.org/en/nevibecode/agents/rohitg00-database-admin.md) — subagent · ★ 2858 repo stars
- [databases](https://affpapa.org/en/nevibecode/skills/databases.md) — skill · 447 installs
- [database-expert](https://affpapa.org/en/nevibecode/agents/database-expert.md) — subagent · ★ 763 repo stars

## Other versions with the same name
- [database-designer · alirezarezvani](https://affpapa.org/en/nevibecode/skills/database-designer.md) — 819 installs

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