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

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.

agentmods
npx agentmods add skills/svngoku/coding-agents-skills/database-design
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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00163 $0.04202
Opus 5 $0.00081 $0.02101
Sonnet 5 $0.00033 $0.00840
Haiku 4.5 $0.00016 $0.00420

Measured 5d ago against content hash ae57142b82ea, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d 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. 5d 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 (9 stars, last pushed 22d ago), licensed MIT. It adds 163 tokens to every session and 4,202 once invoked, about $0.0008 per session on Opus 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

firebase-security-expert

Firebase security expert to audit Security Rules (Firestore/Realtime Database/Storage), authentication, API keys, data leakage prevention, and App Check configuration / Ahli keamanan Firebase untuk audit Security Rules (Firestore/Realtime Database/Storage), autentikasi, API keys, pencegahan kebocoran data, dan…

roedyrustam/vibes-plug · 72 tokens

saas-multi-tenant

Design and implement multi-tenant SaaS architectures with RLS, tenant isolation, and PostgreSQL / Desain dan implementasikan arsitektur SaaS multi-tenant dengan RLS, isolasi tenant, dan PostgreSQL.

roedyrustam/vibes-plug · 52 tokens

database-orm-expert

Expert guide for database schema design, ORM tools (Prisma 6, Drizzle ORM, TypeORM), migrations, query optimization, and type-safe SQL patterns in TypeScript / Panduan ahli untuk desain skema database, ORM tools (Prisma 6, Drizzle ORM, TypeORM), migrasi, optimasi query, dan pola SQL type-safe di TypeScript.

roedyrustam/vibes-plug · 82 tokens

supabase-security-expert

Supabase security expert to audit RLS (Row Level Security), RBAC, relational databases, prevent data leakage, and utilize Supabase Linter / Ahli keamanan Supabase untuk audit RLS (Row Level Security), RBAC, database relasional, pencegahan kebocoran data, dan pemanfaatan Supabase Linter.

roedyrustam/vibes-plug · 75 tokens

edge-serverless-db-expert

Expert guide for Serverless & Edge Databases (Neon Serverless Postgres, Cloudflare D1, Turso/libsql, Upstash Redis), cold-start mitigation, and connection pooling / Panduan ahli database Serverless & Edge (Neon, Cloudflare D1, Turso, Upstash).

roedyrustam/vibes-plug · 69 tokens

supabase-migration

A skill to create or apply a Supabase database migration / Kemampuan untuk membuat atau menerapkan migrasi database Supabase.

roedyrustam/vibes-plug · 30 tokens