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.

Good fit 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.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xiaowen-jiang/agent-enterprise/database_schema_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 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/github.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/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 Schema Design

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. 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.00017 $0.00483
Opus 5.5 $0.00007 $0.00193
Sonnet 5.5 $0.00003 $0.00097
Haiku 4.5 $0.00002 $0.00048

Measured 1mo ago against content hash e0253faa902b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 6mo ago), licensed MIT. It adds 17 tokens to every session and 483 once invoked, about $0.0001 per session on Opus 5.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

flux-migrate

Build zero-downtime database migrations — forward SQL, rollback SQL, deployment sequence. Use when asked to "write migration", "schema change", "add column", "rename table", "drop column", or "migrate safely".

tonone-ai/tonone · 51 tokens

forge-infra

Build production-grade infrastructure as code for a service or project. Use when asked to "set up infra", "provision infrastructure", "create cloud resources", "IaC for this project", "terraform for this", or "deploy this service".

tonone-ai/tonone · 53 tokens

flux-schema

Design and build database schema — tables, columns, types, indexes, constraints, relationships. Given a domain description, output the schema and write the files. Use when asked to "design schema", "database design", "create tables", or "data model".

tonone-ai/tonone · 55 tokens

flux-health

Data quality and pipeline health check — freshness, schema drift, null rates, orphaned records, pipeline status. Use when asked about "data quality check", "pipeline health", "is our data fresh", or "schema drift".

tonone-ai/tonone · 49 tokens

flux-pipeline

Build a data pipeline — ETL/ELT with extraction, transformation, loading, error handling, and scheduling. Use when asked to "build ETL", "data pipeline", "move data from X to Y", or "sync data".

tonone-ai/tonone · 53 tokens

flux-query

Optimize slow database queries — analyze execution plans, add indexes, rewrite queries. Use when asked about "slow query", "optimize SQL", "query performance", or "explain this query".

tonone-ai/tonone · 42 tokens