database-design

database-design is a skill for Claude Code, Codex from svngoku/coding-agents-skills. It costs 163 tokens per session (4,202 once invoked), scanned A, original, MIT.

A guide to designing data structures for relational databases and deciding when another database type is a better fit. It covers tables, relationships, keys, indexes, constraints, and safe schema changes.

In plain words
What is it for?
Use it to model entities, choose primary and foreign keys, normalize tables, tune queries with indexes and EXPLAIN, and plan low-downtime migrations.
Why use it?
It helps prevent duplicated or inconsistent data and keeps queries maintainable as an application grows.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to model entities, choose primary and foreign keys, normalize tables, tune queries with indexes and EXPLAIN, and plan low-downtime migrations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/svngoku/coding-agents-skills/database-design
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add svngoku/coding-agents-skills --skill database-design
Clone the repo
git clone --depth 1 https://github.com/svngoku/coding-agents-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for database-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/svngoku/coding-agents-skills/database-design/github.svg)](https://agentmods.dev/skills/svngoku/coding-agents-skills/database-design)
Your own site
<a href="https://agentmods.dev/skills/svngoku/coding-agents-skills/database-design"><img src="https://agentmods.dev/badge/skills/svngoku/coding-agents-skills/database-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for database-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/svngoku/coding-agents-skills/database-design"><img src="https://agentmods.dev/badge/skills/svngoku/coding-agents-skills/database-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 163 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,202 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00163 $0.04202
Opus 5.5 $0.00065 $0.01681
Sonnet 5.5 $0.00033 $0.00840
Haiku 4.5 $0.00016 $0.00420

Measured 1mo ago against content hash ae57142b82ea, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

database-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (graders/check.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/database-design/SKILL.md · 299 lines

How it starts

The opening of the file, as written. The whole thing — 299 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Design

Database design turns a domain into a schema that stays fast, correct, and easy to evolve for years. This skill covers the full pipeline — requirements analysis, entity modeling, normalization, keys, constraints, indexes, and safe migrations — plus deciding when a document, wide-column, or graph store beats a relational database.

Quick Reference

Topic Reference
Normalization worked examples, natural vs surrogate keys, UUID vs bigint normalization-and-keys.md
B-tree internals, composite/covering/partial indexes, reading EXPLAIN indexing-and-query-tuning.md
Migration tools (Alembic, Prisma, Flyway), expand-contract, backfilling migrations-zero-downtime.md

Core Workflow

Work through these steps in order — each informs the next, and skipping requirements analysis is the most common source of bad schemas.

  1. Gather requirements. List entities, attributes, and relationships. Note cardinalities and whether each read is CRUD (single-row) or reporting (aggregate). Ask about scale, growth, retention, and compliance (e.g. GDPR erasure).
  2. Model entities and relationships. Draw an ER sketch. Normalize to 3NF by default; denormalize only later, with a measured reason.
  3. Choose keys. Prefer surrogate BIGINT IDENTITY primary keys unless a natural key is genuinely stable. Decide UUID vs bigint now — changing it later is painful.
  4. Add constraints. NOT NULL, UNIQUE, CHECK, defaults, and foreign keys belong in the database, not just in the ORM.
  5. Design indexes. Start with the indexes backing PK/FK/UNIQUE constraints, then add query-driven indexes for the hot paths found in step 1.
  6. Validate with EXPLAIN. Run EXPLAIN (ANALYZE, BUFFERS) against realistic data. Fix the plan, not the schema, before considering denormalization.
  7. Plan migrations. Versioned migrations in code; expand-contract for anything touching a live table. Never hand-edit production.

Read the full file on GitHub · 299 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 299 lines · 163 tokens per session scan A ae57142b82ea

Subscribe to this mod's changes

database-design is a skill published in the GitHub repository svngoku/coding-agents-skills (12 stars, last pushed 3d ago), licensed MIT. It adds 163 tokens to every session and 4,202 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

postgresql-development-cloudbase

Use when building, debugging, or evaluating CloudBase PostgreSQL / CloudBase PG / PG mode apps, including Postgres schema setup, queryPgDatabase/managePgDatabase, JS SDK v3 app.rdb() CRUD/RPC, PG HTTP API fallback, RLS-style permissions, username-password auth, and Web CMS/admin CRUD flows backed by CloudBase PG.

sutchan/Agent-Skills-Hub · 77 tokens

cloudbase-document-database-web-sdk

Use CloudBase document database Web SDK only for confirmed NoSQL collection work. Query, create, update, and delete document data; if the task mentions PostgreSQL / CloudBase PG / app.rdb(), route to postgresql-development instead.

sutchan/Agent-Skills-Hub · 55 tokens

minimal-web-baas-demo

A quick setup path for a small CloudBase web application with a database. CloudBase is a backend service that provides hosting and data storage, while CRUD means creating, reading, updating, and deleting records.

sutchan/Agent-Skills-Hub · 144 tokens

data-model-creation

Sibling CloudBase skills ship beside this skill. Use local relative paths such as ../auth-tool-cloudbase/SKILL.md.

sutchan/Agent-Skills-Hub · 68 tokens

relational-database-mcp-cloudbase

Sibling CloudBase skills ship beside this skill. Use local relative paths such as ../auth-tool-cloudbase/SKILL.md.

sutchan/Agent-Skills-Hub · 94 tokens

relational-database-web-cloudbase

Sibling CloudBase skills ship beside this skill. Use local relative paths such as ../auth-tool-cloudbase/SKILL.md.

sutchan/Agent-Skills-Hub · 68 tokens