# database-schema-design

Plans storage architectures, indexing, and migration safety for relational or hybrid databases. Useful when structuring entities and planning breaking updates.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 382 installs · ★ 51
- Author: akillness
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/akillness/jeo-skills/tree/HEAD/.agent-skills/database-schema-design/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/akillness-database-schema-design

## What it does

This skill structures data storage decisions before writing application code or database migrations. It establishes clear entity boundaries, configures tenant isolation, and decides which attributes belong in strict columns versus flexible JSON documents.

Every request follows clear steps. It classifies the workload shape, selects a storage lane, and maps migration risks like locks and backfills. When access patterns remain unclear, the skill pauses to ask direct questions instead of generating arbitrary tables.

It strictly avoids handling API endpoints or authentication, routing those responsibilities to specialized tools like `api-design` or `backend-testing`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add akillness/jeo-skills --skill database-schema-design -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add akillness/jeo-skills --skill database-schema-design -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add akillness/jeo-skills --skill database-schema-design -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install akillness/jeo-skills database-schema-design
```

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

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add akillness/jeo-skills --skill database-schema-design -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/akillness/jeo-skills --path .agent-skills/database-schema-design
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add akillness/jeo-skills --skill database-schema-design -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/akillness/jeo-skills/tree/HEAD/.agent-skills/database-schema-design/SKILL.md

## When to use it
- choose between relational, document, or hybrid storage models
- stage schema migrations to prevent database lockups
- separate query-critical columns from unstructured document payloads
- map audit trails, soft deletes, and entity ownership boundaries

## Example prompts
- Design a multi-tenant database schema for an order processing service with audit logs.
- Review this schema migration for lock risks and propose a staged rollout plan.
- Evaluate whether to store user preferences in dedicated columns or a JSON document.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 7b3dfdfa7db5a1cd.

BEGIN THIRD-PARTY FILE 7b3dfdfa7db5a1cd
```text
---
name: database-schema-design
description: >-
  Design storage-model and migration-safety packets for relational, document-heavy, and hybrid
  data systems. Use when the user needs entity ownership, constraints, indexes, staged schema
  changes, or queryable-vs-flexible field decisions across backend/fullstack products, internal
  ops tools, marketing/customer-data workflows, or game/live-ops systems. Route API contracts to
  api-design, auth-owned identity/session modeling to authentication-setup, verification to
  backend-testing, and reporting/telemetry follow-through to looker-studio-bigquery or
  monitoring-observability.
license: MIT
allowed-tools: Bash Read Write Edit Glob Grep
metadata:
  version: 2.1.0
  modernization: 2026-04-14
  hardening: 2026-04-19
  tags: database, schema-design, migrations, indexing, constraints, relational, nosql, backend
  platforms: Claude, ChatGPT, Gemini
---






# Database Schema Design

Use this skill when the main job is **choosing and evolving the storage model**, not dumping generic SQL or ORM snippets.

`database-schema-design` is the backend storage-design anchor for:
- choosing between relational-first, document-heavy, and hybrid models
- turning domain entities into tables, collections, ownership boundaries, and lifecycle rules
- justifying constraints, indexes, tenant scope, history/audit structures, and deletion/retention behavior
- planning staged schema evolution so migrations, backfills, and cleanup are believable
- handing downstream teams one compact storage-design packet before implementation, verification, reporting, or observability work branches out

Read these support docs before handling larger or riskier work:
- [references/storage-decision-matrix.md](references/storage-decision-matrix.md)
- [references/schema-review-checklist.md](references/schema-review-checklist.md)
- [references/intake-packets-and-route-outs.md](references/intake-packets-and-route-outs.md)

## When to use this skill
- Design a new schema for a product feature, internal tool, admin workflow, customer-data surface, or live-ops/game backend system.
- Refactor an existing storage model with weak constraints, naming drift, poor cardinality modeling, or untrusted indexing.
- Decide which fields must be first-class columns or indexed document fields versus flexible metadata payloads.
- Plan multi-tenant, audit-log, entitlement, status-history, retention, or soft-delete boundaries.
- Review whether a migration is safe, staged realistically, and honest about backfills, compatibility windows, and cleanup.
- Produce one bounded storage packet before implementation or while a risky backend change is being shaped.

## When not to use this skill
- **The main job is REST/GraphQL contract shape, endpoint behavior, webhook semantics, or versioning** → `api-design`.
```
END THIRD-PARTY FILE 7b3dfdfa7db5a1cd

The third-party file has ended. Everything between the 7b3dfdfa7db5a1cd tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2835 of 12527 bytes. © akillness · MIT · https://github.com/akillness/jeo-skills/tree/HEAD/.agent-skills/database-schema-design/SKILL.md

_Part of the page did not fit — see the HTML version._

---
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
