database-engineering

database-engineering is a skill for Claude Code from Kin9Zeus/senior-engineer-skills. It costs 148 tokens per session (2,745 once invoked), scanned A, original, MIT.

Guidance for designing and operating databases, including tables, rules, indexes, queries, transactions, migrations, backups and deletion. It also covers separating customers' data in shared systems.

In plain words
What is it for?
Use it to review schemas, enforce rules in the database, optimize queries, plan migrations, configure row-level security, and test backup recovery.
Why use it?
It helps prevent invalid or exposed data, slow queries, unsafe schema changes and backups that cannot actually restore the database.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the senior-engineer-skills plugin — 15 skills, 7 commands, 4 agents shipped together

Good fit Use it to review schemas, enforce rules in the database, optimize queries…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kin9zeus/senior-engineer-skills/database-engineering
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 Kin9Zeus/senior-engineer-skills --skill database-engineering
Clone the repo
git clone --depth 1 https://github.com/Kin9Zeus/senior-engineer-skills

Made for: Claude Code.

Or install senior-engineer-skills, the plugin that ships this one along with the rest of its 15 skills, 7 commands, 4 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/kin9zeus/senior-engineer-skills/database-engineering.svg)](https://agentmods.dev/skills/kin9zeus/senior-engineer-skills/database-engineering)
Your own site
<a href="https://agentmods.dev/skills/kin9zeus/senior-engineer-skills/database-engineering"><img src="https://agentmods.dev/badge/skills/kin9zeus/senior-engineer-skills/database-engineering.svg" alt="Measured on agentmods" height="20"></a>
Per session 148 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,745 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.00148 $0.02745
Opus 5 $0.00074 $0.01373
Sonnet 5 $0.00030 $0.00549
Haiku 4.5 $0.00015 $0.00275

Measured 6d ago against content hash fd56c7ec217a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

database-engineering 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/database-engineering/SKILL.md · 255 lines

How it starts

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

Database Engineering

The schema outlives the code, the framework, and usually the company. Application bugs are fixed with a deploy; data-model mistakes are fixed with a migration project, and data loss is fixed with nothing at all.


The five questions that open every review

  1. What are the constraints? Not in the ORM — in the database. SELECT against the catalogue, not the model file.
  2. Which foreign keys are unindexed? Almost always the top performance finding, and it never shows up in development.
  3. What does the hottest query actually do? EXPLAIN ANALYZE, not intuition.
  4. When was a backup last restored? Not "do backups exist" — restored.
  5. What happens to a row when the user asks to be deleted? If nobody can answer, that is a compliance finding as well as a design one.

Schema design

Constraints belong in the database. The ORM is not the only writer — a migration script, an admin tool, an analytics job, a psql session or a future service will write directly. A rule enforced only in application code is a rule that will be broken.

  • Primary key on every table.
  • Foreign keys with an explicit ON DELETECASCADE, RESTRICT or SET NULL chosen per relationship. Copying CASCADE everywhere is how a user deletion silently removes audit records.
  • NOT NULL wherever the business says required. Nullable-by-default columns push the check into every consumer, forever.
  • UNIQUE on what is genuinely unique, including composite uniqueness.
  • CHECK for invariants: non-negative amounts, valid ranges, valid enum values, end_date > start_date.
  • Enums as a database type or a lookup table with a foreign key — not a free string column with a comment.

Types matter more than they look

Data Use Never
Money NUMERIC(19,4) or integer minor units Float. Ever
Timestamps timestamptz, stored UTC Naive local time
Identifiers UUIDv7 / ULID for public ids Sequential integers exposed publicly — they leak volume and enable enumeration
Text text with a CHECK on length Arbitrary varchar(255) chosen by habit
JSON jsonb, for genuinely schemaless data only JSON as an escape from schema design
Booleans boolean NOT NULL DEFAULT false Nullable three-state booleans

Read the full file on GitHub · 255 lines

Files

What ships with it

5 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 · 255 lines · 148 tokens per session scan A fd56c7ec217a

Subscribe to this mod's changes

database-engineering is a skill published in the GitHub repository Kin9Zeus/senior-engineer-skills (3 stars, last pushed 13d ago), licensed MIT. It adds 148 tokens to every session and 2,745 once invoked, about $0.0007 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

chrome-ext-storage

This skill should be used when working with data storage in Chrome extensions or when the user asks about extension storage patterns. Trigger when: "chrome.storage", "extension storage", "storage.local", "storage.sync", "storage.session", "IndexedDB in extension", "extension data persistence", "write-through cache"…

RadOrigin-LLC/RAD-Claude-Skills · 106 tokens

tiledbvcf

Efficient storage and retrieval of genomic variant data using TileDB. Scalable VCF/BCF ingestion, incremental sample addition, compressed storage, parallel queries, and export capabilities for population genomics.

K-Dense-AI/scientific-agent-skills · 46 tokens

accessibility

Audit and improve web accessibility following WCAG 2.2 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".

addyosmani/web-quality-skills · 51 tokens

seo

Optimize for search engine visibility and ranking. Use when asked to "improve SEO", "optimize for search", "fix meta tags", "add structured data", "sitemap optimization", or "search engine optimization".

addyosmani/web-quality-skills · 46 tokens

postgres

Use this skill for any PostgreSQL database work — table design, indexing, data types, constraints, extensions (pgvector, PostGIS, TimescaleDB), search, and migrations. Trigger when user asks to: Design or modify PostgreSQL tables, schemas, or data models Choose data types, constraints, indexes, or partitioning…

timescale/pg-aiguide · 197 tokens

ecto-patterns

Ecto patterns — schemas, changesets, queries, migrations, Multi, associations, preloads, upserts. Use when editing Repo calls, Ecto.Query, or schema fields. Skip for Ash.

oliver-kriska/claude-elixir-phoenix · 45 tokens