db-schema

db-schema is a skill for Claude Code from Adit-Jain-srm/skill-forge. It costs 68 tokens per session (1,739 once invoked), scanned A, original, MIT.

A set of rules for designing database tables around the queries they must serve, including indexes, safe changes, and checks at large data sizes. A database is the software that stores and retrieves an application's data.

In plain words
What is it for?
Use it when creating tables, changing a database schema, planning migrations, or designing data models. It helps identify needed indexes, avoid unsafe operations, and verify important queries with execution plans.
Why use it?
It helps prevent schemas that work in a demo but become slow, locked, or difficult to change in production. It makes the team consider access patterns, data volume, and migration safety before writing table definitions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the skill-forge plugin — 19 skills shipped together

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/adit-jain-srm/skill-forge/db-schema
Any agent
npx skills add Adit-Jain-srm/skill-forge --skill db-schema
Clone the repo
git clone --depth 1 https://github.com/Adit-Jain-srm/skill-forge

Made for: Claude Code.

Or install skill-forge, the plugin that ships this one along with the rest of its 19 skills.

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 db-schema

README.md
[![agentmods](https://agentmods.dev/badge/skills/adit-jain-srm/skill-forge/db-schema.svg)](https://agentmods.dev/skills/adit-jain-srm/skill-forge/db-schema)
Your own site
<a href="https://agentmods.dev/skills/adit-jain-srm/skill-forge/db-schema"><img src="https://agentmods.dev/badge/skills/adit-jain-srm/skill-forge/db-schema.svg" alt="Measured on agentmods" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,739 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.1 $0.00068 $0.01739
Opus 5 $0.00034 $0.00870
Sonnet 5 $0.00014 $0.00348
Haiku 4.5 $0.00007 $0.00174

Measured 6d ago against content hash 8e1b350f2ef7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

db-schema 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 6d 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/db-schema/SKILL.md · 222 lines

How it starts

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

Overview

Enforce queries-first schema discipline — design every table around its access patterns, index every filter, and verify migrations are safe at production scale.

Database Schema Design

Persistence

ACTIVE on every schema change. Every CREATE TABLE, every ALTER, every migration. Think at scale before writing DDL.

The Discipline

Before writing ANY schema:

1. QUERIES FIRST — what queries will run against this? (schema serves queries, not the other way around)
2. SCALE QUESTION — what happens at 10M rows? 100M? Does this still work?
3. INDEX PLAN — every WHERE, JOIN, ORDER BY gets an index. No exceptions.
4. MIGRATION SAFETY — can this ALTER run without locking the table for minutes?
5. VERIFY — explain analyze the critical queries. Prove they use indexes.

Rules (never break)

  • Never CREATE TABLE without knowing the top 5 queries it serves
  • Never deploy a migration without testing against production-sized data
  • Never use FLOAT for money (DECIMAL or integer cents)
  • Never skip explicit created_at/updated_at on any table
  • Never add a column with DEFAULT on a large table (locks it)
  • Never DROP COLUMN in one step (stop writing → deploy → then drop)

Before creating any table:

  • Define the access patterns FIRST (queries drive schema, not the other way around)
  • Choose normalization level based on read/write ratio
  • Plan for the 10x scale (what happens at 10M rows?)
  • Identify foreign keys and cascade behavior
  • Define indexes for every WHERE/JOIN/ORDER BY clause
  • Plan soft-delete vs hard-delete strategy
  • Consider multi-tenancy needs upfront

Normalization Decision

Situation Strategy Why
Read-heavy, rarely changes Denormalize Avoid JOINs at query time
Write-heavy, consistency critical Normalize (3NF) Single source of truth
Analytics/reporting Star schema (denormalized) Optimized for aggregation
User-facing CRUD 3NF with strategic denorm Balance of integrity + speed

Read the full file on GitHub · 222 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. 6d ago First seen · 222 lines · 68 tokens per session scan A 8e1b350f2ef7

Subscribe to this mod's changes

db-schema is a skill published in the GitHub repository Adit-Jain-srm/skill-forge (2 stars, last pushed 2mo ago), licensed MIT. It adds 68 tokens to every session and 1,739 once invoked, about $0.0003 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

postgresql-table-design

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.

wshobson/agents · 37 tokens

event-store-design

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

wshobson/agents · 33 tokens

cqrs-implementation

Implement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or building event-sourced systems.

wshobson/agents · 35 tokens

projection-patterns

Build read models and projections from event streams. Use when implementing CQRS read sides, building materialized views, or optimizing query performance in event-sourced systems.

wshobson/agents · 36 tokens

architect/data-api-design

Skill "architect/data-api-design" from echoVic/boss-skill, covering 数据模型与api设计方法论, 适用场景, 数据模型设计, 1. 实体识别 and 2. 关系识别.

echoVic/boss-skill · 26 tokens

mongodb-connection

Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language. Use this skill when working/updating/reviewing on functions that instantiate or configure a MongoDB client (eg, when calling connect()), configuring connection pools, troubleshooting connection errors…

fcakyon/claude-codex-settings · 122 tokens