database-schema

database-schema is a skill for Claude Code, Codex from Ozzeron/prompt-pack. It costs 29 tokens per session (2,033 once invoked), scanned A, original, MIT.

A guide for designing how an application stores data in tables or document collections. It covers fields, relationships, names, indexes, deletion records, and separating data between customers.

In plain words
What is it for?
Use it when adding tables or collections, reshaping existing relationships, or designing the data layer before an API.
Why use it?
It helps avoid confusing data structures and costly redesigns as the application grows. It also keeps schema design separate from query tuning and migration work.

Skill for Claude CodeCodex

Part of the backend plugin — 13 skills shipped together , and of supabase, fullstack, all-skills

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/ozzeron/prompt-pack/database-schema
Any agent
npx skills add Ozzeron/prompt-pack --skill database-schema
Clone the repo
git clone --depth 1 https://github.com/Ozzeron/prompt-pack

Made for: Claude Code, Codex.

Or install backend, the plugin that ships this one along with the rest of its 13 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

README.md
[![agentmods](https://agentmods.dev/badge/skills/ozzeron/prompt-pack/database-schema.svg)](https://agentmods.dev/skills/ozzeron/prompt-pack/database-schema)
Your own site
<a href="https://agentmods.dev/skills/ozzeron/prompt-pack/database-schema"><img src="https://agentmods.dev/badge/skills/ozzeron/prompt-pack/database-schema.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,033 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.00029 $0.02033
Opus 5 $0.00015 $0.01017
Sonnet 5 $0.00006 $0.00407
Haiku 4.5 $0.00003 $0.00203

Measured 4d ago against content hash 3c3b2aafbfc4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

database-schema 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 4d 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.

prompts/architecture/database-schema/SKILL.md · 193 lines

How it starts

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

Database Schema Designer

You design or extend a database schema for a feature or product. The goal is a schema that's correct now and bendable later — not perfect upfront, not impossible to evolve. You favour fewer surprises over theoretical purity.

When to use

  • New tables / collections for a feature
  • Restructuring existing data (one-to-many → many-to-many, splitting a god-table)
  • Designing the data layer before writing the API

Do not invoke for query optimisation (use review/database-review) or migration mechanics (use architecture/database-migrations).

Scope

In scope:

  • Tables / collections, columns, types, constraints
  • Primary keys, foreign keys, indexes
  • Soft-delete and audit-column decisions
  • Enums vs lookup tables vs check constraints
  • Multi-tenant / scoping decisions
  • Naming conventions

Out of scope:

  • Migration mechanics — see database-migrations
  • Query patterns and indexing for known queries — see database-review
  • Cache and eventual-consistency strategies — separate concern

Inherits

  • meta/engineering-principles — naming, single responsibility, modern standards apply to schemas too.
  • meta/reuse-before-create — before adding a new table, enum, or join table, look for an existing entity that already covers the shape or that should be extended instead.
  • meta/token-discipline — read existing migrations and one or two adjacent schemas, not the whole history.

Token discipline (specific)

  • Read the project's existing migrations directory only the most recent 5–10 files to learn naming and style.
  • Read 1–2 nearby table definitions to match conventions.
  • Skip seed data, test fixtures, and ORM-generated boilerplate.

Process

  1. Clarify the domain. What entities exist? What are the relationships? What are the read patterns vs write patterns?
  2. Inspect 2–3 canonical examples in this schema before designing. Read:
    • one nearby table in the same domain (column types, naming, FK style)
    • one recent migration that touched a similar shape (how additions are normally rolled out)
    • the project's id strategy (uuid v4 / v7 / bigint serial / nanoid) and timestamp convention (created_at / inserted_at, with or without updated_at, timezone handling) Note conventions for: primary key type, soft-delete column name (or absence), audit columns, enum-vs-lookup-table style, JSON/JSONB usage, naming case (snake vs camel). Match them. If the project has multiple competing styles, pick the most recent and call out the inconsistency in the handoff.
  3. Pick the lowest-friction shape that handles current + obvious-near-future needs. Don't model imagined requirements.
  4. Decide soft-delete. Default to hard delete + audit log, switch to soft-delete when the domain genuinely needs reversibility (medical records, legal documents).
  5. Place indexes for the queries you know exist. Avoid speculative indexes.
  6. Define constraints (NOT NULL, UNIQUE, CHECK, FK) — let the database enforce invariants.
  7. Document the decision — one paragraph in the migration or schema file explaining the non-obvious choices.
  8. Hand off. For non-trivial schema changes, finish with delivery/handoff summarising the entities added/changed, the index strategy, the constraints enforced, what downstream code/migrations will need to follow, and any open questions.

Read the full file on GitHub · 193 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. 4d ago First seen · 193 lines · 29 tokens per session scan A 3c3b2aafbfc4

Subscribe to this mod's changes

database-schema is a skill published in the GitHub repository Ozzeron/prompt-pack (8 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 2,033 once invoked, about $0.0001 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