database-design

database-design is a skill for Claude Code, Codex from Vimalk0703/shipworthy. It costs 32 tokens per session (419 once invoked), scanned A, original, MIT.

A guide to designing database tables, changes, relationships, indexes, and queries. It includes rules for data integrity and ways to avoid N+1 queries, where one list operation causes a separate database query for every item.

In plain words
What is it for?
Use it when creating tables, writing migrations, adding constraints or indexes, and reviewing queries for performance.
Why use it?
It helps prevent invalid data, slow queries, hard-to-reverse schema changes, and unnecessary database load.

Skill for Claude CodeCodex

Part of the shipworthy plugin — 41 skills, 7 commands, 6 agents, 3 hooks 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/vimalk0703/shipworthy/database-design
Any agent
npx skills add Vimalk0703/shipworthy --skill database-design
Clone the repo
git clone --depth 1 https://github.com/Vimalk0703/shipworthy

Made for: Claude Code, Codex.

Or install shipworthy, the plugin that ships this one along with the rest of its 41 skills, 7 commands, 6 agents, 3 hooks.

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/vimalk0703/shipworthy/database-design.svg)](https://agentmods.dev/skills/vimalk0703/shipworthy/database-design)
Your own site
<a href="https://agentmods.dev/skills/vimalk0703/shipworthy/database-design"><img src="https://agentmods.dev/badge/skills/vimalk0703/shipworthy/database-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 419 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.00032 $0.00419
Opus 5 $0.00016 $0.00210
Sonnet 5 $0.00006 $0.00084
Haiku 4.5 $0.00003 $0.00042

Measured 4d ago against content hash 157faa1145f6, 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 4d 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/architecture/database-design/SKILL.md · 49 lines

What it actually says

Database Design

Naming Conventions

  • Tables: plural, snake_case (user_profiles, order_items)
  • Columns: singular, snake_case (first_name, created_at)
  • Primary keys: id
  • Foreign keys: {table_singular}_id (user_id, order_id)
  • Timestamps: always include created_at and updated_at
  • Booleans: prefix with is_ or has_

Data Integrity

  • Every foreign key MUST have a constraint
  • Use appropriate column types (don't store dates as strings)
  • Set NOT NULL on columns that should never be empty
  • Use enums/check constraints for fixed value sets

Migrations

  1. Every schema change goes through a migration — never modify DB directly
  2. Migrations must be reversible (include up and down)
  3. One concern per migration
  4. Name descriptively: add_email_verification_to_users

Indexing

  • Must index: foreign keys, WHERE clause columns, ORDER BY columns, JOIN columns
  • Avoid: indexing every column, missing composite indexes, indexing low-selectivity columns

N+1 Prevention

// BAD: 1 + N queries
for (const user of users) {
  user.orders = await db.orders.findByUserId(user.id);
}
// GOOD: 2 queries
const users = await db.users.findAll({ include: ['orders'] });

Rules

  • Never query inside a loop
  • Set LIMIT on all list queries
  • Use pagination for large result sets
  • Log slow queries (>100ms)
  • Maintain seed data for dev/testing
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. 4d ago First seen · 49 lines · 32 tokens per session scan A 157faa1145f6

Subscribe to this mod's changes

database-design is a skill published in the GitHub repository Vimalk0703/shipworthy (7 stars, last pushed 4mo ago), licensed MIT. It adds 32 tokens to every session and 419 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-08-31.

Related

Other skills, from other repositories

entity-design

Design EF Core entities with navigation properties, value objects, Fluent API configuration, and audit fields. Use when creating new database entities, adding relationships, configuring owned types, designing a domain model for Entity Framework Core, or setting up table-per-hierarchy inheritance.

andresharpe/dotbot · 54 tokens

hedgehog-planning-intake

Use on any core for first-run planning intake — Phase 0 runs the vendored BMAD-METHOD planning shelf, shared by every core, and Phase 1 (mining 04-prd.md into intent records plus the Add-ons/sync-and-remote-entities decision) is full-stack-app's and pwa-app's shared procedure — identical mechanics, a different…

skyf0xx/hedgehog · 0 tokens

create-migration

Create and manage Entity Framework Core database migrations including schema changes, seed data, and rollback strategies. Use when adding or modifying EF Core entities, setting up a new DbContext, applying data seeding, running dotnet ef commands, or troubleshooting migration conflicts.

andresharpe/dotbot · 55 tokens

inbound-triage

Maintainer-only. Use when triaging inbound GitHub issues and pull requests on skyf0xx/hedgehog — "triage the issues", "check the PRs", "review inbound", "what's in the queue". Reads each item read-only, judges it for security and for whether it is real, then fixes and closes or comments and closes. Not part of the…

skyf0xx/hedgehog · 102 tokens

bmad-product-brief

Create, update, or validate a product brief. Use when the user wants help producing, editing, or validating a brief.

skyf0xx/hedgehog · 31 tokens

bmad-revendor

Maintainer-only. Use when re-vendoring vendor-skills/BMAD/ against a newer BMAD-METHOD commit — "update BMAD", "re-vendor BMAD", "bump the BMAD pin". Not part of the Hedgehog discipline a consuming project copies; this only applies to the Hedgehog repo itself.

skyf0xx/hedgehog · 72 tokens