database-design

database-design is a skill for Claude Code, Codex from CloudAI-X/claude-workflow-v2. It costs 57 tokens per session (2,605 once invoked), scanned A, original, MIT.

A guide to designing and improving databases, including how data is organized into tables or document structures, how relationships are represented, and how queries are made faster.

In plain words
What is it for?
Use it to design schemas, plan indexes and migrations, optimize queries, address repeated database requests, and choose normalization or denormalization strategies.
Why use it?
It helps prevent duplicated or poorly organized data, slow queries, inefficient database access, and risky changes to an existing schema.

Skill for Claude CodeCodex

Part of the claude-workflow-v2 plugin — 14 skills, 26 commands, 7 agents, 6 hooks shipped together

About the project

Project Starter is a workflow plugin that equips coding agents with specialized subagents, reusable skills, commands, hooks, and output styles for software projects. It is for developers who want structured assistance with tasks such as planning, debugging, code review, security, and automation across several coding-agent platforms. Catalogue add-ons are components of its own workflow.

CloudAI-X/claude-workflow-v2 · 1,413 stars · on GitHub

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/cloudai-x/claude-workflow-v2/database-design
Any agent
npx skills add CloudAI-X/claude-workflow-v2 --skill database-design
Clone the repo
git clone --depth 1 https://github.com/CloudAI-X/claude-workflow-v2

Made for: Claude Code, Codex.

Or install claude-workflow-v2, the plugin that ships this one along with the rest of its 14 skills, 26 commands, 7 agents, 6 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/cloudai-x/claude-workflow-v2/database-design.svg)](https://agentmods.dev/skills/cloudai-x/claude-workflow-v2/database-design)
Your own site
<a href="https://agentmods.dev/skills/cloudai-x/claude-workflow-v2/database-design"><img src="https://agentmods.dev/badge/skills/cloudai-x/claude-workflow-v2/database-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,605 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.00057 $0.02605
Opus 5 $0.00028 $0.01303
Sonnet 5 $0.00011 $0.00521
Haiku 4.5 $0.00006 $0.00261

Measured 5d ago against content hash 256654449e0c, 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 5d 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/database-design/SKILL.md · 390 lines

How it starts

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

Database Design

When to Load

  • Trigger: Schema design, migrations, query optimization, indexing strategies, data modeling, N+1 fixes
  • Skip: No database work involved in the current task

Database Design Workflow

Copy this checklist and track progress:

Database Design Progress:
- [ ] Step 1: Identify entities and relationships
- [ ] Step 2: Normalize schema (3NF minimum)
- [ ] Step 3: Evaluate denormalization needs
- [ ] Step 4: Design indexes for query patterns
- [ ] Step 5: Write and optimize critical queries
- [ ] Step 6: Plan migration strategy
- [ ] Step 7: Configure connection pooling
- [ ] Step 8: Validate against anti-patterns checklist

Schema Design Principles

Normalization Forms

1NF: Atomic values, no repeating groups
2NF: 1NF + no partial dependencies (all non-key columns depend on full PK)
3NF: 2NF + no transitive dependencies (non-key columns don't depend on other non-key columns)
-- WRONG: Unnormalized
CREATE TABLE orders (
  id SERIAL PRIMARY KEY,
  customer_name TEXT,
  customer_email TEXT,        -- duplicated across orders
  product1_name TEXT,         -- repeating groups
  product1_qty INT,
  product2_name TEXT,
  product2_qty INT
);

-- CORRECT: Normalized to 3NF
CREATE TABLE customers (
  id SERIAL PRIMARY KEY,
  name TEXT NOT NULL,
  email TEXT UNIQUE NOT NULL
);

CREATE TABLE orders (
  id SERIAL PRIMARY KEY,
  customer_id INT REFERENCES customers(id),
  created_at TIMESTAMPTZ DEFAULT NOW()
);

CREATE TABLE order_items (
  id SERIAL PRIMARY KEY,
  order_id INT REFERENCES orders(id),
  product_id INT REFERENCES products(id),
  quantity INT NOT NULL CHECK (quantity > 0)
);

When to Denormalize

Denormalize only when you have measured proof of performance issues:

-- Acceptable denormalization: precomputed counter to avoid COUNT(*)
ALTER TABLE posts ADD COLUMN comment_count INT DEFAULT 0;

-- Update via trigger or application code
CREATE FUNCTION update_comment_count() RETURNS TRIGGER AS $$
BEGIN
  IF TG_OP = 'INSERT' THEN
    UPDATE posts SET comment_count = comment_count + 1 WHERE id = NEW.post_id;
  ELSIF TG_OP = 'DELETE' THEN
    UPDATE posts SET comment_count = comment_count - 1 WHERE id = OLD.post_id;
  END IF;
  RETURN NULL;
END;
$$ LANGUAGE plpgsql;

Read the full file on GitHub · 390 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. 5d ago First seen · 390 lines · 57 tokens per session scan A 256654449e0c

Subscribe to this mod's changes

database-design is a skill published in the GitHub repository CloudAI-X/claude-workflow-v2 (1,413 stars, last pushed 10d ago), licensed MIT. It adds 57 tokens to every session and 2,605 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-30.