# db-review

db-review is a Claude Code skill that reviews database schemas, queries, and migrations. It activates for schema design, index choices, query tuning, and migration safety checks.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 88 repo stars
- Author: alexj11324
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/alexj11324/Mikka/tree/HEAD/.claude/skills/db-review/SKILL.md
- Updated: 2026-11-17
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/db-review

## What it does

db-review examines table structures, SQL, and migration plans for correctness, performance, and safety. For query analysis, it calls for comparing actual execution through `EXPLAIN ANALYZE` with the estimates in `EXPLAIN`. It also covers N+1 query patterns, broad `SELECT *` reads, and transaction lock scope.

For PostgreSQL migrations, the skill describes approaches such as creating indexes with `CREATE INDEX CONCURRENTLY` and changing a column name through a staged switch to a replacement field. Changing a column’s type usually rewrites the table. Migration review also covers compatibility with the previous application version and rollback planning.

The skill recommends indexes for foreign keys and columns used by frequent filters, sorts, and joins. A composite index on `(a, b, c)` does not serve a query that filters on `b` alone. Migration checks include timing the change against a dataset resembling production.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add alexj11324/Mikka --skill db-review -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add alexj11324/Mikka --skill db-review -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add alexj11324/Mikka --skill db-review -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install alexj11324/Mikka .claude/skills/db-review
```

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

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add alexj11324/Mikka --skill db-review -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/alexj11324/Mikka --path .claude/skills/db-review
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/db-review/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/alexj11324/Mikka/tree/HEAD/.claude/skills/db-review/SKILL.md

## When to use it
- design table schemas and choose primary keys
- trace a slow SQL query through its execution plan
- order columns in a composite index
- assess migration locks and compatibility during deployment
- plan a rollback for a schema change

## Example prompts
- Review this database schema and suggest suitable primary keys.
- Analyze the `EXPLAIN ANALYZE` output and find why the query is slow.
- Assess a column-rename migration and outline a rollback plan.

## Similar
- [postgres-best-practices](https://affpapa.org/en/nevibecode/skills/neondatabase-postgres-best-practices.md) — skill · 2100 installs
- [postgresql-expert-best-practices-code-review](https://affpapa.org/en/nevibecode/skills/postgresql-expert-best-practices-code-review.md) — skill · 392 installs
- [db-wasp-drone](https://affpapa.org/en/nevibecode/agents/db-wasp-drone.md) — subagent · ★ 96 repo stars
- [postgres-patterns](https://affpapa.org/en/nevibecode/skills/postgres-patterns.md) — skill · 7200 installs
- [sql-pro](https://affpapa.org/en/nevibecode/skills/httpsgithubcomjeffallan-sql-pro.md) — skill · 6900 installs
- [postgresql-best-practices](https://affpapa.org/en/nevibecode/skills/postgresql-best-practices.md) — skill · 1600 installs

From the same set: [alexj11324/mikka](https://affpapa.org/en/nevibecode/by/alexj11324/mikka.md) — 47 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
