Database Schema Design

Database Schema Design is a skill for Claude Code, Codex from Xiaowen-Jiang/agent-enterprise. It costs 17 tokens per session (483 once invoked), scanned A, original, MIT.

A process for planning a database structure: tables, relationships, indexes, rules, and migrations. A migration is a tracked database change that creates or updates tables safely over time.

In plain words
What is it for?
Designing tables for entities such as users, orders, or products; defining one-to-one, one-to-many, and many-to-many relationships; choosing keys and indexes; and writing `CREATE TABLE` or `ALTER TABLE` migrations.
Why use it?
It turns a feature's data needs into an organized structure that avoids duplicated facts and supports common queries. It also records the SQL changes needed to apply the design.

Skill for Claude CodeCodex

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

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/xiaowen-jiang/agent-enterprise/database_schema_design
Any agent
npx skills add Xiaowen-Jiang/agent-enterprise --skill database_schema_design
Clone the repo
git clone --depth 1 https://github.com/Xiaowen-Jiang/agent-enterprise

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 Schema Design

README.md
[![agentmods](https://agentmods.dev/badge/skills/xiaowen-jiang/agent-enterprise/database_schema_design.svg)](https://agentmods.dev/skills/xiaowen-jiang/agent-enterprise/database_schema_design)
Your own site
<a href="https://agentmods.dev/skills/xiaowen-jiang/agent-enterprise/database_schema_design"><img src="https://agentmods.dev/badge/skills/xiaowen-jiang/agent-enterprise/database_schema_design.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 483 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.00017 $0.00483
Opus 5 $0.00009 $0.00242
Sonnet 5 $0.00003 $0.00097
Haiku 4.5 $0.00002 $0.00048

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

Security

Grade A, and why

Database Schema 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 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.

agent_enterprise/skills_data/database_schema_design/SKILL.md · 61 lines

What it actually says

Process

  1. Identify entities — Map domain objects to tables (users, orders, products, etc.)
  2. Define relationships — One-to-one, one-to-many, many-to-many
  3. Normalize to 3NF — Eliminate redundancy, ensure each fact is stored once
  4. Choose primary keys — UUID vs auto-increment, composite keys when needed
  5. Design indexes — Based on query patterns (WHERE, JOIN, ORDER BY)
  6. Plan constraints — NOT NULL, UNIQUE, FOREIGN KEY, CHECK
  7. Write migration — CREATE TABLE statements, ALTER TABLE for existing schemas

Output Format

## Schema Design: [Feature/Module Name]

### Entity-Relationship Summary
- User (1) → (N) Order
- Order (N) ← → (N) Product (via order_items)

### Tables

#### users
| Column | Type | Constraints | Notes |
|--------|------|-------------|-------|
| id | UUID | PK | |
| email | VARCHAR(255) | UNIQUE, NOT NULL | Login identifier |
| created_at | TIMESTAMP | NOT NULL, DEFAULT NOW() | |

#### orders
| Column | Type | Constraints | Notes |
|--------|------|-------------|-------|
| id | UUID | PK | |
| user_id | UUID | FK → users.id, NOT NULL | |

### Indexes
- users(email) — unique lookup
- orders(user_id, created_at) — user's recent orders

### Migration SQL
[CREATE TABLE / ALTER TABLE statements]

Guidelines

  • Prefer UUIDs for primary keys in distributed systems, auto-increment for simple apps
  • Always add created_at and updated_at timestamps
  • Use soft deletes (deleted_at) for data that might need recovery
  • Index foreign keys — they're used in JOINs
  • Don't over-normalize — denormalize for read-heavy queries when justified
  • Include rollback SQL in migrations (DROP TABLE, ALTER TABLE DROP COLUMN)
  • Consider data volume and growth rate when designing indexes
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 · 61 lines · 17 tokens per session scan A e0253faa902b

Subscribe to this mod's changes

Database Schema Design is a skill published in the GitHub repository Xiaowen-Jiang/agent-enterprise (52 stars, last pushed 5mo ago), licensed MIT. It adds 17 tokens to every session and 483 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-30.

Related

Other skills, from other repositories

core-data-migrations

Core Data model versioning and migration — when a new .xcdatamodel version is required, what lightweight migration actually supports, renaming and retiring attributes without losing data, and how to verify a migration before shipping it. Use when changing an existing Core Data model, adding a model version, renaming…

markdavidgan/apple-dev-skills · 162 tokens

dba

You MUST use this for database decisions - schema design, query optimization, migration planning, indexing strategy, data modeling, and database performance issues.

Jaan-Mustafa/10x-Team · 31 tokens

analytics-reporter

-- Key Business Metrics Dashboard WITH monthlymetrics AS ( SELECT DATETRUNC('month', date) as month, SUM(revenue) as monthlyrevenue, COUNT(DISTINCT customerid) as activecustomers, AVG(ordervalue) as avgordervalue, SUM(revenue) / COUNT(DISTINCT customerid) as revenuepercustomer FROM transactions WHERE date >=…

TravisLeeeeee/awesome-openclaw-personas · 0 tokens

database-optimizer

Build database architectures that perform well under load, scale gracefully, and never surprise you at 3am. Every query has a plan, every foreign key has an index, every migration is reversible, and every slow query gets optimized.

TravisLeeeeee/awesome-openclaw-personas · 0 tokens

engineering-advanced-skills

25 advanced engineering agent skills and plugins for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw. Agent design, RAG, MCP servers, CI/CD, database design, observability, security auditing, release management, platform ops.

csiddhant796-blip/claude-skills-collection · 56 tokens

Backend Architect

Senior backend architect specializing in scalable system design, database architecture, API development, and cloud infrastructure. Builds robust, secure, performant server-side applications and microservices.

GetSkill-Agent/getskill-skills · 35 tokens