database-design

database-design is a skill for Claude Code, Codex from phuonghx/aim-cli. It costs 89 tokens per session (558 once invoked), scanned A, original, MIT.

A guide to designing the part of an application that stores and retrieves data. It covers database tables, indexes, database engines, tools that connect code to databases, queries, and data migrations.

In plain words
What is it for?
Use it when modeling tables and relationships, choosing a database or ORM, adding indexes, tuning queries, checking Prisma or Drizzle schemas, or planning migrations.
Why use it?
It helps avoid choosing a database or data model by habit and helps identify causes of slow queries or risky changes to a live database.

Skill for Claude CodeCodex

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

Good fit Use it when modeling tables and relationships, choosing a database or ORM, adding indexes, tuning queries, checking Prisma or Drizzle schemas, or planning migrations.

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

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-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/phuonghx/aim-cli/database-design/github.svg)](https://agentmods.dev/skills/phuonghx/aim-cli/database-design)
Your own site
<a href="https://agentmods.dev/skills/phuonghx/aim-cli/database-design"><img src="https://agentmods.dev/badge/skills/phuonghx/aim-cli/database-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-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/phuonghx/aim-cli/database-design"><img src="https://agentmods.dev/badge/skills/phuonghx/aim-cli/database-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 558 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.00089 $0.00558
Opus 5.5 $0.00036 $0.00223
Sonnet 5.5 $0.00018 $0.00112
Haiku 4.5 $0.00009 $0.00056

Measured 1mo ago against content hash 2d95dcf4d54c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/schema_validator.py), 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.

aim/templates/aim-agents/skills/database-design/SKILL.md · 60 lines

How it starts

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

Database Design

Reason about the workload first. Patterns follow from requirements, not habit.

Load Reference Files On Demand

Each topic lives in its own file. Open only the ones the current task touches.

File Covers Open it when
database-selection.md Engine trade-offs across Postgres, Neon, Turso, SQLite, and friends Picking where data lives
orm-selection.md Drizzle, Prisma, Kysely, raw SQL Picking how code talks to the DB
schema-design.md Normalization, keys, relationships, soft deletes Modeling tables
indexing.md Index families and composite ordering Speeding up reads
optimization.md N+1, query plans, tuning order Hunting down slow queries
migrations.md Expand/contract, online changes, managed engines Evolving a live schema

Runtime Helper

A lightweight checker flags common Prisma/Drizzle schema smells. Run it; don't read it.

python scripts/schema_validator.py <project_path>

Guiding Mindset

  • Surface the user's constraints (scale, latency, hosting) before committing to an engine.
  • Match the tool to the actual access patterns of this project.
  • Treat Postgres as a strong option, not an automatic one — a smaller store often fits better.

Pre-Build Questions

Work through these (or ask) before writing any DDL:

  • Have database preferences been confirmed with the user?
  • Is the engine choice justified by this project's needs?
  • Does the target runtime (edge, serverless, container) shape the decision?
  • Is there an index plan for the expected queries?
  • Are the relationships and their cardinalities settled?

Mistakes to Steer Clear Of

❌ Reaching for Postgres on a tiny app where embedded SQLite would do ❌ Leaving frequently-filtered columns unindexed ❌ Shipping SELECT * to production paths ❌ Dumping structured fields into a JSON blob out of laziness ❌ Letting ORM relation loads fan out into N+1 query storms

Read the full file on GitHub · 60 lines

Files

What ships with it

7 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. 1mo ago First seen · 60 lines · 89 tokens per session scan A 2d95dcf4d54c

Subscribe to this mod's changes

database-design is a skill published in the GitHub repository phuonghx/aim-cli (1 stars, last pushed 3mo ago), licensed MIT. It adds 89 tokens to every session and 558 once invoked, about $0.0004 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-31.

Related

Other skills, from other repositories

data-governance

Use this skill when designing or reviewing data governance: schema ownership, PII handling, retention, lineage, access policy, and migration safety for services and data stores. Triggers: user says "data governance", "PII", "schema ownership", "retention policy", "data lineage", "migration safety".

WrongStack/WrongStack · 68 tokens

backup-recovery

Design and verify backups and restoration for owned databases, files and application state. Use when preparing recovery, migrating data or testing backups; protect the source and prove restore into an isolated destination before calling recovery ready.

WrongStack/WrongStack · 45 tokens

database-development

Implement database access, models and queries with explicit consistency, transactions and bounded results. Use when working with SQL, document databases, Redis or ORM clients; use database-migrations for schema rollout/recovery and verify actual engine/client compatibility.

WrongStack/WrongStack · 49 tokens

database-migrations

Design and verify schema migrations, bounded backfills and deployment compatibility for databases. Use when adding constraints or indexes, changing column types, evolving schemas or recovering failed migrations; distinguish reversible application rollback from data restoration.

WrongStack/WrongStack · 45 tokens

api-baas-firebase

Firebase backend-as-a-service — Firestore, Authentication, Cloud Functions v2, Storage, Hosting, Admin SDK, security rules, emulator suite.

agents-inc/skills · 34 tokens

api-baas-neon

Serverless PostgreSQL with branching, autoscaling, and edge-compatible driver.

agents-inc/skills · 20 tokens