database-design

database-design is a skill for Claude Code, Codex from aneja5/forge-skills. It costs 39 tokens per session (1,587 once invoked), scanned A, original, MIT.

A set of conventions for designing database schemas, migrations, indexes, relationships, deletion rules, partitioning, and tenant access. A migration is a controlled change to a database structure.

In plain words
What is it for?
Use it to design schemas, plan migrations, add or audit indexes, review queries, choose soft or hard deletion, and define tenant-scoping rules for relational databases.
Why use it?
It helps avoid unsafe production migrations, slow queries, missing relationships, and inconsistent data rules. It also provides a review process for query performance and migration safety.

Skill for Claude CodeCodex

Part of the forge-skills plugin — 42 skills, 36 commands, 13 agents, 1 hook 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/aneja5/forge-skills/database-design
Any agent
npx skills add aneja5/forge-skills --skill database-design
Clone the repo
git clone --depth 1 https://github.com/aneja5/forge-skills

Made for: Claude Code, Codex.

Or install forge-skills, the plugin that ships this one along with the rest of its 42 skills, 36 commands, 13 agents, 1 hook.

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/aneja5/forge-skills/database-design.svg)](https://agentmods.dev/skills/aneja5/forge-skills/database-design)
Your own site
<a href="https://agentmods.dev/skills/aneja5/forge-skills/database-design"><img src="https://agentmods.dev/badge/skills/aneja5/forge-skills/database-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,587 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.00039 $0.01587
Opus 5 $0.00019 $0.00794
Sonnet 5 $0.00008 $0.00317
Haiku 4.5 $0.00004 $0.00159

Measured yesterday against content hash 027ddc74ec2c, 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 yesterday.

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 · 111 lines

How it starts

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

Database Design

Overview

Define the project's schema conventions and migration safety policy before migrations land in production. Outputs .forge/database-design.md (naming, FK rules, audit columns, soft-delete policy, index strategy, partition strategy, RLS/tenant-scoping rules) and .forge/migrations-policy.md (reversibility, idempotency, locking-aware patterns, the query-review checklist). Consumed by architecture-and-contracts and incremental-implementation.

When to Use

  • A new project starts and the schema is being designed
  • A migration is being written that touches a table >1M rows
  • An ORM is generating N+1 queries in a hot path
  • An audit reveals tables with no FK constraints or missing indexes
  • The team is debating soft delete vs hard delete and there's no policy
  • A production query is timing out and there's no EXPLAIN process

When NOT to Use

  • Adding a column to a tiny dev-only table where conventions already apply
  • Schema-less stores (Mongo, DynamoDB) — see architecture-and-contracts data-model section instead
  • A migration on an existing project that has documented conventions and the change is local

Common Rationalizations

Thought Reality
"We can add indexes later" Missing indexes in production cause outages, not slowdowns. A full table scan on a 50M-row table locks the DB.
"Soft delete is always better" Soft delete without a cleanup job becomes data hoarding. GDPR forces real deletion eventually.
"ORMs handle it" ORMs generate N+1 queries by default. Lazy loading + a loop = production incident.
"One big migration is fine" Irreversible migrations are deployment landmines. Forward-only with a long expand-contract window is the safe path.
"We don't need FK constraints, the app enforces it" The app has bugs. The DB doesn't. FK constraints are the last line of defense against orphan rows.
"Let's just denormalize for speed" Denormalization without a sync job creates two sources of truth that diverge.

Read the full file on GitHub · 111 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. yesterday First seen · 111 lines · 39 tokens per session scan A 027ddc74ec2c

Subscribe to this mod's changes

database-design is a skill published in the GitHub repository aneja5/forge-skills (3 stars, last pushed 3mo ago), licensed MIT. It adds 39 tokens to every session and 1,587 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

add-data-source

Guide the user to add a data source, connection, or API connector to a Canvas App via Power Apps Studio, then verify and continue. USE WHEN the user asks to add a data source, add a connection, add an API, add a connector, connect to SharePoint / Dataverse / SQL / Excel / OneDrive / Teams / Office 365, or any similar…

microsoft/power-platform-skills · 116 tokens

craft-pest

Testing Craft CMS 5 plugins and modules with Pest — test isolation, database safety, and the markhuot/craft-pest-core harness. ALWAYS load when writing, running, fixing, or reviewing tests for a Craft plugin or module, and whenever a suite touches a real Craft install. Covers why rollback is opt-in, tests/Pest.php +…

michtio/craftcms-claude-skills · 353 tokens

ddev

DDEV local development environment for Craft CMS projects. ALWAYS load this skill when running any ddev command, configuring .ddev/config.yaml, or troubleshooting local container issues. Covers config.yaml (project type, PHP/Node versions, database, docroot), shorthand commands, add-ons and built-in Mailpit, custom…

michtio/craftcms-claude-skills · 350 tokens

craft-cloud

Craft Cloud — Pixel & Tonic's serverless hosting platform for Craft CMS. Covers craft-cloud.yaml configuration, the Build → Migrate → Release deploy pipeline, the craftcms/cloud extension package, edge image transforms via Cloudflare, edge static caching with cache.rules + ESI, Cloud-managed S3 filesystem, MySQL 8 /…

michtio/craftcms-claude-skills · 354 tokens

lineage

Use when user invokes /lineage with a column name (optionally qualified with table/schema). Also triggers on "trace this column", "where does X come from", "what reads from Y table". Traces column-level data lineage through SQL, Kafka, Spark, JDBC, and ORM codebases. Produces a structured lineage path with confidence…

harnessprotocol/harness-kit · 94 tokens

advanced-alchemy

Auto-activate for advancedalchemy imports, alembic/, SQLAlchemyAsyncRepositoryService, SQLAlchemyAsyncConfig, repositorytype, serviceclass, filters, or storage. Not for raw SQLAlchemy without Advanced Alchemy — use SQLAlchemy guidance.

litestar-org/litestar-skills · 54 tokens