design-a-schema

design-a-schema is a skill for Claude Code, Codex from lonormaly/builders-stack. It costs 91 tokens per session (989 once invoked), scanned A, original, MIT.

A skill for designing or changing database tables with Drizzle in the project’s database library. Drizzle is a TypeScript tool for defining database structures and queries.

In plain words
What is it for?
Use it when adding tables or columns, choosing keys and relationships, setting constraints, or adding indexes for slow queries.
Why use it?
It helps prevent duplicated data, missing rules and slow lookups before they become harder to fix.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it when adding tables or columns, choosing keys and relationships, setting constraints, or adding indexes for slow queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lonormaly/builders-stack/design-a-schema
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 lonormaly/builders-stack --skill design-a-schema
Clone the repo
git clone --depth 1 https://github.com/lonormaly/builders-stack

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/lonormaly/builders-stack/design-a-schema"><img src="https://agentmods.dev/badge/skills/lonormaly/builders-stack/design-a-schema.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 989 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00091 $0.00989
Opus 5.5 $0.00036 $0.00396
Sonnet 5.5 $0.00018 $0.00198
Haiku 4.5 $0.00009 $0.00099

Measured 1mo ago against content hash 785af60a6973, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

design-a-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 1mo 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.

agents/skills/design-a-schema/SKILL.md · 68 lines

How it starts

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

Design a schema

Get the data model right before the app is built on top of it — a bad schema is the most expensive thing to change later, and on Neon's free tier it's also what quietly eats your 0.5 GB and your compute. Normalize first, constrain always, index on purpose.

When to use

  • Adding a table or column to libs/db/src/schema.ts.
  • Choosing keys, foreign keys, uniqueness, or an index strategy.
  • A query is slow and the cause is the schema (missing index, wrong shape), not the query text — pair with optimize-a-query.

Normalize first (then denormalize with a reason)

  • Default to 3NF. One fact in one place. A value that can be derived or looked up should not be copied into another row — copies drift (update anomalies).
  • Denormalize only deliberately, with a comment saying why (a measured hot read path, a reporting rollup). Never "just in case."
  • One row = one entity. Repeating groups (tag1, tag2, tag3) become a child table with a FK.

Constrain at the database, not just the app

The DB is the last line of integrity — app validation can be bypassed, a bad migration can't.

  • NOT NULL on everything that is logically required.
  • Foreign keys for every real relationship, with an explicit onDelete (cascade for owned children, restrict/set null otherwise). See session/account in auth-schema.ts — onDelete: "cascade" on user.id.
  • unique on natural keys (email, slug). check constraints for enums/ranges Drizzle can express.

Index deliberately — the part everyone gets wrong

  • Postgres does NOT auto-index foreign keys. Add an index on every FK column you JOIN or filter on. A missing FK index is the classic "fine in dev, dies under load" bug.
  • Composite index column order matters: put the equality-filtered column first, the range/sort column second. An index on (user_id, created_at) serves WHERE user_id = ? ORDER BY created_at — the reverse order does not.
  • Partial indexes for queries that always filter (WHERE deleted_at IS NULL) — smaller, cheaper.
  • Do NOT add speculative indexes. Every index slows writes and costs storage against the 0.5 GB free cap (see run-lean-on-neon). Index what a real query needs; drop indexes nothing uses.

Read the full file on GitHub · 68 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. 1mo ago First seen · 68 lines · 91 tokens per session scan A 785af60a6973

Subscribe to this mod's changes

design-a-schema is a skill published in the GitHub repository lonormaly/builders-stack (42 stars, last pushed 25d ago), licensed MIT. It adds 91 tokens to every session and 989 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-30.

Related

Other skills, from other repositories

add-to-project

Add addons, tooling or a workspace package to an existing Better-T-Stack project, such as PWA, Tauri, Starlight or Fumadocs docs, Biome, Oxlint, Ultracite, Husky, Lefthook, Turborepo, Nx, the MCP or Skills addon, or a shared packages/ . Use when the project has a bts.jsonc file and the user wants to extend it or add…

AmanVarshney01/create-better-t-stack · 102 tokens

benchling-integration

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

synthetic-sciences/openscience · 44 tokens

better-t-stack

Create or extend an end-to-end type-safe TypeScript project with Better-T-Stack (create-better-t-stack). Use when the user wants to start, scaffold or bootstrap an app, API, fullstack project or monorepo with any of Next.js, TanStack Router or Start, React Router, Nuxt, Svelte, Solid, Astro, React Native, Hono…

AmanVarshney01/create-better-t-stack · 149 tokens

scaffold-project

Scaffold a new app, API, backend, fullstack project, monorepo or starter with Better-T-Stack, including projects on a named framework such as Hono, Express, Fastify, Elysia, Convex, Next.js, TanStack Router or Start, React Router, Nuxt, Svelte, Solid, Astro or React Native. Use whenever the user wants to start…

AmanVarshney01/create-better-t-stack · 138 tokens

better-drizzle

Write, review, and debug code that uses better-drizzle, the typed repository layer over Drizzle ORM 1.x (better(db), db.users.findMany, paginate, cursor, upsertMany, relation include/connect, transactions, and the rules/zod/soft-delete/timestamps/uuid/cache/tenant plugins). Use when a project imports better-drizzle…

almeidazs/better-drizzle · 106 tokens

Drizzle ORM Testing

Testing patterns for Drizzle ORM covering migration testing, query builder testing, transaction testing, and database integration testing with PostgreSQL, SQLite, and MySQL.

PramodDutta/qaskills · 36 tokens