database-design

database-design is a skill for Claude Code, Codex from vignesh2027/AI-AGENT-SKILLS. It costs 19 tokens per session (589 once invoked), scanned A, original, MIT.

A guide to designing database tables or collections, migrations, indexes, and queries so they remain maintainable as an application changes.

In plain words
What is it for?
Planning data models, migrations, indexes, query patterns, IDs, and service data layers.
Why use it?
It helps prevent schema choices that make production migrations risky, queries slow, or future changes difficult.

Skill for Claude CodeCodex

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

Good fit Planning data models, migrations, indexes, query patterns, IDs, and service data layers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vignesh2027/ai-agent-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 vignesh2027/AI-AGENT-SKILLS --skill database-design
Clone the repo
git clone --depth 1 https://github.com/vignesh2027/AI-AGENT-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/vignesh2027/ai-agent-skills/database-design/github.svg)](https://agentmods.dev/skills/vignesh2027/ai-agent-skills/database-design)
Your own site
<a href="https://agentmods.dev/skills/vignesh2027/ai-agent-skills/database-design"><img src="https://agentmods.dev/badge/skills/vignesh2027/ai-agent-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/vignesh2027/ai-agent-skills/database-design"><img src="https://agentmods.dev/badge/skills/vignesh2027/ai-agent-skills/database-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 589 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.00019 $0.00589
Opus 5 $0.00010 $0.00295
Sonnet 5 $0.00004 $0.00118
Haiku 4.5 $0.00002 $0.00059

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

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

How it starts

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

Overview

Database schemas are among the hardest things to change in a production system. Migrations run during live traffic. Indexes affect every query. Schema choices made today constrain options for years. This skill gets them right from the start.

When to Use

  • Before designing a new table or collection
  • Before writing a database migration
  • When queries are slow and the cause is suspected to be the schema or indexes
  • When designing a new service's data layer

Process

Step 1: Design for the queries, not just the data

Understand the access patterns before normalizing. Which queries are in the critical path? What are the read/write ratios? This drives index and schema decisions.

Step 2: Normalize first, denormalize deliberately

Start with a normalized design. Denormalize only when profiling shows it's necessary, and document why.

Step 3: Choose IDs carefully

  • Use UUIDs or ULIDs for globally unique IDs (not auto-increment integers for externally visible IDs)
  • Never expose integer sequence IDs to users (enumeration attack)
  • Ensure IDs are indexed

Step 4: Migrations — backward compatible first

Every migration must be backward compatible with the current code:

  1. Deploy migration (add new column, add new table)
  2. Deploy code that uses the new column
  3. Deploy cleanup migration (drop old column) — only after old code is gone

Never drop a column in the same deploy that stops using it.

Step 5: Index strategy

Index columns that appear in WHERE clauses, JOIN conditions, and ORDER BY of hot queries. Don't over-index — each index slows writes.

Run EXPLAIN on every hot query before deploying.

Step 6: Soft deletes vs hard deletes

For audit trails, compliance, or reference integrity: use soft deletes (deleted_at timestamp). For data that must be truly erased (GDPR): implement hard delete + audit log.

Step 7: Timestamps and audit columns

Every table should have: created_at, updated_at. Tables with audit requirements: created_by, updated_by.

Read the full file on GitHub · 65 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. 8d ago First seen · 65 lines · 19 tokens per session scan A 62107e31dee9

Subscribe to this mod's changes

database-design is a skill published in the GitHub repository vignesh2027/AI-AGENT-SKILLS (2 stars, last pushed 10d ago), licensed MIT. It adds 19 tokens to every session and 589 once invoked, about $0.0001 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

mysql

Query the connected MySQL/MariaDB database with the mysql client. Use when the user asks about their database, tables, rows, schema, or to run SQL against MySQL.

intentic/intentic · 39 tokens

postgres

Query the connected PostgreSQL database with psql. Use when the user asks about their database, tables, rows, schema, or to run SQL against Postgres.

intentic/intentic · 35 tokens

data-architecture

A data-architecture guide for designing how application data is structured, changed, stored, and used. A schema is the defined shape of stored data, such as tables and fields.

devcodex-labs/devcodex · 63 tokens

dev-database

A database-development guide focused on safe migrations and schema changes. A migration is a controlled change to the structure of stored data, such as adding a table or changing a column.

devcodex-labs/devcodex · 21 tokens

stale-derived-state

Diagnose a change that does not take effect until a reload, a logout or a navigation away and back, because a cache or a piece of derived state has no invalidation hook on write. Use when a save appears to work but the screen keeps showing the old value. Names the Crumbtrail queries that prove the write landed, and…

CrumbtrailDev/crumbtrail-cli · 85 tokens

database-migration

Use when the user asks to design, review, or execute a database schema change, data backfill, index change, or migration. Inspect the current schema and migration conventions first, plan safe rollout and recovery, and never perform destructive production changes without explicit authorization.

lfyxhappy/lfcode · 56 tokens