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.
npx skills add 05-deepak-patidar/claude-skills --skill database-designgit clone --depth 1 https://github.com/05-deepak-patidar/claude-skillsWrote 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.
[](https://agentmods.dev/skills/05-deepak-patidar/claude-skills/database-design)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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 NULLby default; nullable is an explicit decision meaning "absence is a valid state" (and every reader must handle it).FOREIGN KEYfor every reference.UNIQUEfor every natural key (mobile number, invoice number per tenant, SKU per account).CHECKfor 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 getscreated_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
statuscolumn 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 DELETEbehavior per FK deliberately (RESTRICT is the safe default). - Multi-tenant:
account_id NOT NULLon 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.
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.
- 12d ago First seen · 53 lines · 73 tokens per session scan A 33aa17d8d6e2
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.
Other skills, from other repositories
optimize
Analyze and suggest performance improvements for code, queries, or systems.
database
Database design, query optimization, migrations, and indexing. Use when designing schemas, writing queries, or managing migrations.
db
Database operations via CLI. Replaces Postgres/SurrealDB MCP (saves 3,000-8,000 tokens). Supports PostgreSQL, SurrealDB, SQLite.
postgres
Use this skill for any PostgreSQL database work — table design, indexing, data types, constraints, extensions (pgvector, PostGIS, TimescaleDB), search, and migrations. Trigger when user asks to: Design or modify PostgreSQL tables, schemas, or data models Choose data types, constraints, indexes, or partitioning…
backend-patterns
Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.
system-design-data-architecture
Choose and scale the data layer: SQL versus NoSQL per access pattern, single data ownership, replication and read scaling, partition key choice, hot partition and celebrity key mitigation. Use when selecting a store, planning sharding, or fixing a data-tier bottleneck.