database-design

database-design is a skill for Claude Code from krzysztofsurdy/code-virtuoso. It costs 81 tokens per session (2,458 once invoked), scanned A, original, MIT.

Guidance for designing relational and NoSQL databases, including tables, document structures, relationships, indexes, constraints, migrations, and data history.

In plain words
What is it for?
Use it to model data, choose normalization or denormalization, design indexes, plan migrations, add audit trails, partition tables, and improve database access.
Why use it?
It helps avoid schemas that are slow, inconsistent, or expensive to change as an application grows.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the knowledge-virtuoso plugin — 15 skills shipped together

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/krzysztofsurdy/code-virtuoso/database-design
Any agent
npx skills add krzysztofsurdy/code-virtuoso --skill database-design
Clone the repo
git clone --depth 1 https://github.com/krzysztofsurdy/code-virtuoso

Made for: Claude Code.

Or install knowledge-virtuoso, the plugin that ships this one along with the rest of its 15 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-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/database-design.svg)](https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/database-design)
Your own site
<a href="https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/database-design"><img src="https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/database-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,458 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.00081 $0.02458
Opus 5 $0.00041 $0.01229
Sonnet 5 $0.00016 $0.00492
Haiku 4.5 $0.00008 $0.00246

Measured 6d ago against content hash 44c8563467b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 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.

skills/knowledge/database-design/SKILL.md · 206 lines

How it starts

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

Database Design

Good database design determines the long-term maintainability, performance, and correctness of any data-driven application. Schema decisions made early are expensive to reverse later. Every table, column, index, and constraint should exist for a reason backed by access patterns and business rules.

Data Modeling Principles

Start from Access Patterns

Design tables around how the application reads and writes data, not around how entities look in a domain model. Two questions drive every schema decision:

  1. What queries will run most frequently? - these determine table structure, indexes, and denormalization choices
  2. What consistency guarantees does the data need? - these determine normalization level, constraints, and transaction boundaries

Entity Relationships

Relationship Implementation When to Use
One-to-one Foreign key with UNIQUE constraint on the child table Splitting rarely-accessed columns into a separate table, or enforcing exactly-one semantics
One-to-many Foreign key on the child table referencing the parent Orders to order items, users to addresses
Many-to-many Join table with composite primary key Tags to articles, students to courses
Many-to-many with attributes Join table with its own columns beyond the two foreign keys Enrollment with grade, membership with role
Self-referential Foreign key referencing the same table Org charts, category trees, threaded comments

Naming Conventions

Consistent naming prevents confusion across teams and tools:

  • Tables: plural nouns in snake_case (order_items, user_addresses)
  • Columns: singular snake_case describing the value (created_at, total_amount)
  • Foreign keys: <referenced_table_singular>_id (user_id, order_id)
  • Indexes: idx_<table>_<columns> (idx_orders_user_id_created_at)
  • Constraints: chk_<table>_<rule>, uq_<table>_<columns>, fk_<table>_<referenced>

Read the full file on GitHub · 206 lines

Files

What ships with it

3 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. 6d ago First seen · 206 lines · 81 tokens per session scan A 44c8563467b8

Subscribe to this mod's changes

database-design is a skill published in the GitHub repository krzysztofsurdy/code-virtuoso (20 stars, last pushed 3mo ago), licensed MIT. It adds 81 tokens to every session and 2,458 once invoked, about $0.0004 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

alloydb-basics

Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.

google/skills · 72 tokens

obsidian-bases

Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.

kepano/obsidian-skills · 63 tokens

supabase-postgres-best-practices

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the…

supabase/agent-skills · 182 tokens

db-repo

Работа с хранилищем конфигурации 1С. Используй когда нужно захватить объекты, поместить изменения в хранилище конфигурации, получить изменения из него, подключить базу к хранилищу.

Nikolay-Shirokov/cc-1c-skills · 56 tokens

db-load-xml

Загрузка конфигурации 1С из XML-файлов. Используй когда нужно загрузить конфигурацию из файлов, XML, исходников, LoadConfigFromFiles.

Nikolay-Shirokov/cc-1c-skills · 40 tokens

db-dump-dt

Выгрузка информационной базы 1С в DT-файл (вся база — конфигурация + данные). Используй когда нужно выгрузить информационную базу, выгрузить архив базы, сделать бэкап, выгрузить dt.

Nikolay-Shirokov/cc-1c-skills · 59 tokens