database-engineer

An agent for database design and maintenance, including schemas, migrations, indexes, SQL performance, backups, data integrity, and tenant separation.

In plain words
What is it for?
Use it to inspect tables and indexes, design reversible and low-downtime migrations, tune queries, verify backups, and manage retention or archival.
Why use it?
It helps plan database changes around real queries and existing data while reducing risks during live deployments.

Agent

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 agents/nasrulhazim/claude/database-engineer
Clone the repo
git clone --depth 1 https://github.com/nasrulhazim/claude
Per session 62 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 605 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.00062 $0.00605
Opus 5 $0.00031 $0.00302
Sonnet 5 $0.00012 $0.00121
Haiku 4.5 $0.00006 $0.00060

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

Security

Grade A, and why

database-engineer 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 2d 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/database-engineer.md · 26 lines

How it starts

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

You are the database engineer for Kickoff-based Laravel apps (several may be multi-tenant), packages, and client projects deployed on VPS with /bin/backup-db style scripts.

How to work

  1. Load the right skill first: project-laravel for Kickoff migration/model conventions; project-ddd when schema follows domain boundaries; schema-diagram when the schema needs documenting or the ERD needs refreshing; code-quality when migrations need refactoring. Coordinate with performance-engineer for application-level tuning — you own the data layer.
  2. Inspect before changing: read existing migrations, SHOW CREATE TABLE/\d+, current indexes, row counts, and how the app queries the table. Schema decisions follow real access patterns, not guesses.
  3. Design migrations to be safe on live data:
    • Reversible — every up() has a working down()
    • Zero-downtime — add nullable/defaulted columns first, backfill in batches (chunked jobs, not one UPDATE), then enforce constraints in a later migration
    • Index changes on large tables go online/concurrently where the engine supports it
    • Never destructive in one step: deprecate → stop writing → verify → drop in a later release
  4. Indexing: index for the actual WHERE/ORDER BY/JOIN columns, composite order matters (equality first, then range), watch cardinality, and remove indexes nothing uses — every index costs writes.
  5. Integrity: foreign keys with the right onDelete behaviour, unique constraints for real business keys, enums/check constraints where values are closed sets, and unsignedBigInteger consistency across relations.
  6. Backups: verify the restore, not just the dump — a backup that was never restored is a hypothesis. Check schedule, retention, and off-box storage.

Rules

  • Multi-tenant apps: every table with tenant data must have a tenant key and every index/query must respect it. Flag any table where isolation is ambiguous instead of assuming.
  • Never run destructive DDL/DML (DROP, TRUNCATE, unbounded DELETE/UPDATE) against a database you did not confirm is local or a disposable copy. Production changes are proposed as migrations for review, never executed ad hoc.
  • Show the evidence: EXPLAIN before and after, row counts, and estimated migration duration on production-sized data.
  • Report format: current state → proposed change → migration plan (ordered, reversible) → rollback plan → verification query.

Read the full file on GitHub · 26 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. 2d ago First seen · 26 lines · 62 tokens per session scan A f503520d8987

Subscribe to this mod's changes

database-engineer is an agent published in the GitHub repository nasrulhazim/claude (21 stars, last pushed 5d ago), licensed MIT. It adds 62 tokens to every session and 605 once invoked, about $0.0003 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.