database-design

database-design is a skill for Claude Code, Codex from 05-deepak-patidar/claude-skills. It costs 73 tokens per session (1,173 once invoked), scanned A, original, MIT.

A guide for designing relational database structures, including tables, relationships, rules, indexes, and migrations. A migration is a controlled change to an existing database structure.

In plain words
What is it for?
Use it when creating or changing tables, modeling money, stock, or ledgers, writing migrations, or checking database queries.
Why use it?
It helps prevent invalid, duplicated, or corrupted data and catches problems that application code alone may miss. It also addresses when a non-relational database may fit better.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating or changing tables, modeling money, stock, or ledgers, writing migrations, or checking database queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/05-deepak-patidar/claude-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 05-deepak-patidar/claude-skills --skill database-design
Clone the repo
git clone --depth 1 https://github.com/05-deepak-patidar/claude-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/05-deepak-patidar/claude-skills/database-design/github.svg)](https://agentmods.dev/skills/05-deepak-patidar/claude-skills/database-design)
Your own site
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/database-design"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-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/05-deepak-patidar/claude-skills/database-design"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/database-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,173 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.00073 $0.01173
Opus 5 $0.00036 $0.00587
Sonnet 5 $0.00015 $0.00235
Haiku 4.5 $0.00007 $0.00117

Measured 12d ago against content hash 33aa17d8d6e2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 12d ago.

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.

database-design/SKILL.md · 53 lines

How it starts

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

Database Design

The schema outlives every framework, every rewrite, and every AI model that touches the codebase. Code bugs ship and get fixed; schema mistakes and corrupted data are forever. Design the schema as if the application code were hostile — because one day, some version of it will be.

Principle: the database defends its own invariants

Any rule the business cannot tolerate being violated goes in the schema, not only in application code:

  • NOT NULL by default; nullable is an explicit decision meaning "absence is a valid state" (and every reader must handle it).
  • FOREIGN KEY for every reference. UNIQUE for every natural key (mobile number, invoice number per tenant, SKU per account). CHECK for domains (quantity >= 0, status in allowed set, rate between 0 and 100).
  • Application-level checks are UX; database constraints are truth. You need both, but only one of them holds under race conditions, bad deploys, and manual fixes.

Modeling rules that prevent the classic disasters

  • Money and quantity are exact decimals (NUMERIC), never float — no exceptions, including "it's just a percentage". Store currency explicitly if there could ever be more than one.
  • Timestamps: store UTC (timestamptz), render in local zone. Name columns *_at. Every mutable table gets created_at/updated_at.
  • IDs: surrogate primary key (UUID or bigint — pick per project and stay consistent); enforce natural keys with UNIQUE constraints, don't make them the PK. Never expose sequential IDs where enumeration leaks business volume (invoice counts, user counts) unless numbering is a product requirement.
  • State machines as data: a status column needs its legal transitions written down (in code comments/docs) and enforced in exactly one service function. If history matters, an append-only events/audit table beats overwriting.
  • Financial and inventory data is append-only at heart: model corrections as new compensating rows (credit notes, stock adjustments with reasons), not UPDATEs that destroy what happened. If a regulator, accountant, or angry customer could ask "what was it before?", keep the before.
  • Soft delete vs hard delete is a product decision — but referencing rows must never dangle either way; decide ON DELETE behavior per FK deliberately (RESTRICT is the safe default).
  • Multi-tenant: account_id NOT NULL on every tenant table, composite indexes leading with it, and row-level security or a mandatory scoping mechanism so a missing WHERE clause fails closed, not open.

Read the full file on GitHub · 53 lines

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. 12d ago First seen · 53 lines · 73 tokens per session scan A 33aa17d8d6e2

Subscribe to this mod's changes

database-design is a skill published in the GitHub repository 05-deepak-patidar/claude-skills (4 stars, last pushed 2mo ago), licensed MIT. It adds 73 tokens to every session and 1,173 once invoked, about $0.0004 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.