database-design

database-design is a skill for Claude Code, Codex from medy-gribkov/arcana. It costs 112 tokens per session (3,403 once invoked), scanned A, original, Apache-2.0.

Guidance for designing and tuning PostgreSQL and SQLite databases, including table structure, indexes, migrations, and query performance.

In plain words
What is it for?
Use it when creating or changing schemas, writing migrations, choosing PostgreSQL or SQLite, configuring an object-relational mapper, or diagnosing slow queries, deadlocks, and repeated database requests.
Why use it?
It helps avoid duplicated or poorly organized data and explains how to investigate slow queries and database problems.

Skill for Claude CodeCodex

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

Good fit Use it when creating or changing schemas, writing migrations, choosing PostgreSQL or SQLite, configuring an object-relational mapper, or diagnosing slow queries, deadlocks, and repeated database requests.

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

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin database-design/plugin install database-design after adding the marketplace above.

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/medy-gribkov/arcana/database-design.svg)](https://agentmods.dev/skills/medy-gribkov/arcana/database-design)
Your own site
<a href="https://agentmods.dev/skills/medy-gribkov/arcana/database-design"><img src="https://agentmods.dev/badge/skills/medy-gribkov/arcana/database-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,403 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.00112 $0.03403
Opus 5 $0.00056 $0.01702
Sonnet 5 $0.00022 $0.00681
Haiku 4.5 $0.00011 $0.00340

Measured 8d ago against content hash 22b85ab0f8b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/lint-migration.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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 · 401 lines

How it starts

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

You are a senior database architect who designs schemas that scale and writes queries that stay fast under load.

Use this skill when

  • Designing a new database schema or modifying an existing one
  • Optimizing slow queries using EXPLAIN ANALYZE
  • Creating or reviewing database migrations
  • Choosing between normalization and denormalization
  • Setting up connection pooling or ORM configuration
  • Debugging N+1 queries, deadlocks, or performance issues
  • Deciding between PostgreSQL and SQLite for a project

Schema Design Principles

Normalization to 3NF

1NF: Every column holds atomic values. No arrays, no comma-separated lists. 2NF: Every non-key column depends on the entire primary key (relevant for composite keys). 3NF: No transitive dependencies. If A -> B -> C, then C should be in B's table, not A's.

-- Bad: transitive dependency (city -> state)
CREATE TABLE customers (
    id SERIAL PRIMARY KEY,
    name TEXT NOT NULL,
    city TEXT,
    state TEXT    -- determined by city, not by customer
);

-- Good: normalize to 3NF
CREATE TABLE cities (
    id SERIAL PRIMARY KEY,
    name TEXT NOT NULL,
    state TEXT NOT NULL,
    UNIQUE (name, state)
);
CREATE TABLE customers (
    id SERIAL PRIMARY KEY,
    name TEXT NOT NULL,
    city_id INT REFERENCES cities(id)
);

When to Denormalize

Denormalize when:

  • Read:write ratio exceeds 100:1 and JOINs are the bottleneck
  • Reporting queries scan millions of rows across 5+ tables
  • You need sub-millisecond reads (caching at DB level)

Patterns:

  • Materialized views: precomputed JOINs, refreshed on schedule
  • Computed columns: store full_name alongside first_name + last_name
  • Counter caches: store comment_count on posts, update via trigger
-- Materialized view for dashboard stats
CREATE MATERIALIZED VIEW order_stats AS
SELECT
    date_trunc('day', created_at) AS day,
    COUNT(*) AS order_count,
    SUM(total) AS revenue
FROM orders
GROUP BY 1;

-- Refresh on schedule (or after batch inserts)
REFRESH MATERIALIZED VIEW CONCURRENTLY order_stats;

Read the full file on GitHub · 401 lines

Files

What ships with it

1 file 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. 8d ago First seen · 401 lines · 112 tokens per session scan A 22b85ab0f8b5

Subscribe to this mod's changes

database-design is a skill published in the GitHub repository medy-gribkov/arcana (1 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 112 tokens to every session and 3,403 once invoked, about $0.0006 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.