database-schema-design

database-schema-design is a skill for Claude Code from timwukp/agent-skills-best-practice. It costs 52 tokens per session (1,633 once invoked), scanned A, original, MIT.

A guide for planning how data is stored in database tables and how those tables relate to each other. It supports SQL databases and tools including Flyway, Liquibase, Prisma, and Alembic.

In plain words
What is it for?
Use it to design schemas for data such as users, orders, and products, including one-to-one, one-to-many, and many-to-many relationships. It can also produce migration scripts for PostgreSQL, MySQL, or SQLite.
Why use it?
It removes guesswork when choosing tables, columns, relationships, indexes, and database changes. It starts with an organized design and explains when a deliberately duplicated structure may help reporting or heavy reads.

Skill for Claude Code

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

Part of the engineering-skills plugin — 18 skills shipped together

Good fit Use it to design schemas for data such as users, orders, and products, including one-to-one, one-to-many, and many-to-many relationships. It can also produce migration scripts for PostgreSQL, MySQL, or SQLite.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/timwukp/agent-skills-best-practice/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 timwukp/agent-skills-best-practice --skill database-schema-design
Clone the repo
git clone --depth 1 https://github.com/timwukp/agent-skills-best-practice

Made for: Claude Code.

Or install engineering-skills, the plugin that ships this one along with the rest of its 18 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 database-schema-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/timwukp/agent-skills-best-practice/database-schema-design/github.svg)](https://agentmods.dev/skills/timwukp/agent-skills-best-practice/database-schema-design)
Your own site
<a href="https://agentmods.dev/skills/timwukp/agent-skills-best-practice/database-schema-design"><img src="https://agentmods.dev/badge/skills/timwukp/agent-skills-best-practice/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/timwukp/agent-skills-best-practice/database-schema-design"><img src="https://agentmods.dev/badge/skills/timwukp/agent-skills-best-practice/database-schema-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,633 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00052 $0.01633
Opus 5 $0.00026 $0.00816
Sonnet 5 $0.00010 $0.00327
Haiku 4.5 $0.00005 $0.00163

Measured 9d ago against content hash 335caff2ccc9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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/skills/database-schema-design/SKILL.md · 227 lines

How it starts

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

Database Schema Design

Instructions

Step 1: Gather Requirements

Ask:

  1. What entities need to be stored? (e.g., users, orders, products)
  2. What are the relationships? (one-to-one, one-to-many, many-to-many)
  3. What queries will be most common? (affects indexing decisions)
  4. Expected scale? (thousands vs millions of rows)
  5. Database engine? (PostgreSQL, MySQL, SQLite)
  6. Migration tool? (raw SQL, Flyway, Liquibase, Prisma, Alembic)

Step 2: Design Normalized Schema

Apply normalization rules:

First Normal Form (1NF):

  • Eliminate repeating groups
  • Each column holds atomic values
  • Each row is unique (has primary key)

Second Normal Form (2NF):

  • Meet 1NF
  • Remove partial dependencies on composite keys

Third Normal Form (3NF):

  • Meet 2NF
  • Remove transitive dependencies

When to denormalize:

  • Read-heavy workloads with expensive joins
  • Reporting tables (materialize aggregations)
  • Caching frequently computed values with clear update triggers

Always start normalized, then denormalize with documented justification.

Step 3: Define Tables

Use this format for each table:

CREATE TABLE orders (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    status VARCHAR(20) NOT NULL DEFAULT 'pending'
        CHECK (status IN ('pending', 'confirmed', 'shipped', 'delivered', 'cancelled')),
    total_cents BIGINT NOT NULL CHECK (total_cents >= 0),
    currency CHAR(3) NOT NULL DEFAULT 'USD',
    shipping_address_id UUID REFERENCES addresses(id),
    notes TEXT,
    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

COMMENT ON TABLE orders IS 'Customer purchase orders';
COMMENT ON COLUMN orders.total_cents IS 'Order total in smallest currency unit';

Conventions:

  • Use UUID for primary keys (or BIGSERIAL if performance-critical)
  • Store money as integers (cents) to avoid floating point issues
  • Use TIMESTAMPTZ (not TIMESTAMP) for all time columns
  • Add CHECK constraints for enum-like values
  • Include created_at and updated_at on every table
  • Use ON DELETE CASCADE or SET NULL explicitly

Read the full file on GitHub · 227 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 227 lines · 52 tokens per session scan A 335caff2ccc9

Subscribe to this mod's changes

database-schema-design is a skill published in the GitHub repository timwukp/agent-skills-best-practice (10 stars, last pushed 2d ago), licensed MIT. It adds 52 tokens to every session and 1,633 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

dynamodb

AWS DynamoDB NoSQL database for scalable data storage. Use when designing table schemas, writing queries, configuring indexes, managing capacity, implementing single-table design, or troubleshooting performance issues.

itsmostafa/aws-agent-skills · 39 tokens

rds

AWS RDS relational database service for managed databases. Use when provisioning databases, configuring backups, managing replicas, troubleshooting connectivity, or optimizing performance.

itsmostafa/aws-agent-skills · 31 tokens

golang-security

Security best practices and vulnerability prevention for Golang. Covers injection (SQL, command, XSS), cryptography, filesystem safety, network security, cookies, secrets management, memory safety, and logging. Apply when writing, reviewing, or auditing Go code for security, or when working on any risky code involving…

FilippoDeSilva/skills · 86 tokens

postgresql-indexing

PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing…

prowler-cloud/prowler · 108 tokens

amazon aurora dsql

Deprecated compatibility redirect for Aurora DSQL guidance. Use when a request concerns DSQL, Aurora DSQL, distributed SQL, DSQL schemas, migrations, queries, authentication, performance, or application development.

awslabs/mcp · 46 tokens

cognito

AWS Cognito user authentication and authorization service. Use when setting up user pools, configuring identity pools, implementing OAuth flows, managing user attributes, or integrating with social identity providers.

itsmostafa/aws-agent-skills · 38 tokens