database

Guidance for working with databases, including table structures, migrations, indexes, transactions, query plans, and locking. A migration is a controlled change to the structure or stored data of a database.

In plain words
What is it for?
Use it when designing schemas, writing migrations, adding indexes, tuning queries, changing transaction behavior, handling connection pools, or modifying production data.
Why use it?
It helps protect production data and plan changes that can be difficult to reverse. It emphasizes checking SQL and locking behavior, then rolling changes out in separate, verifiable stages.

Skill for Claude CodeCodex

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

Made for: Claude Code, Codex.

Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,368 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.00019 $0.01368
Opus 5 $0.00010 $0.00684
Sonnet 5 $0.00004 $0.00274
Haiku 4.5 $0.00002 $0.00137

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

Security

Grade A, and why

database 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 yesterday.

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/.agents/skills/database/SKILL.md · 120 lines

How it starts

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

Database

Iron Law

PROTECT PRODUCTION DATA FIRST: PROVE ROLLOUT, LOCKING, AND RECOVERY BEFORE CHANGE.

When to Use

  • Schema design, migrations, indexes, query plans, isolation levels, connection pools, soft delete, N+1 fixes, online DDL, transactional outbox/CDC, or production data changes.

When NOT to Use

  • API contract design; use api.
  • Rollout sequencing outside the database; pair with release.
  • Cache freshness and invalidation; use performance.

Core Ideas

  1. Destructive and hard-to-reverse database changes are the user's call. Route schema and migration changes that other code or stored data binds to through contract-first, which owns the approval scope; data deletion and non-reversible backfills always need explicit approval for data safety. An additive, easily reversed change on a development-stage schema proceeds with the shape stated in the close-out.
  2. Use the project's existing database unless the task is choosing a store. For greenfield defaults and store-selection caveats, use architecture.
  3. Expand, migrate, verify, switch, then contract in separate deployable steps.
  4. Review SQL and lock behavior, not just ORM code.
  5. Backfills are batched, resumable, observable, and reversible.
  6. Constraints enforce invariants. Every uniqueness invariant needs a DB-level UNIQUE, EXCLUDE, composite, or partial equivalent. Application-layer checks race under concurrency.
  7. Indexes and plans follow real access paths. New foreign keys and known WHERE, JOIN, or ORDER BY predicates need supporting indexes in the same migration, or a stated reason they do not; query changes need EXPLAIN/ANALYZE plans on production-shaped data.
  8. Isolation level is a design decision; retries are part of serializable correctness.
  9. State changes and durable publication need atomicity through transactional outbox, CDC, or an equivalent handoff when the two cannot silently diverge.
  10. Data recovery is part of the change: backup/PITR must cover the blast radius.

Read the full file on GitHub · 120 lines

Files

What ships with it

3 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. yesterday First seen · 120 lines · 19 tokens per session scan A fdd3bdf404f1

Subscribe to this mod's changes

database is a skill published in the GitHub repository kreek/consult (1 stars, last pushed 6d ago), licensed MIT. It adds 19 tokens to every session and 1,368 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

argent-tv-interact

Control and inspect TV apps via argent — Apple TV (tvOS), Android TV (leanback), and Amazon Fire TV (Vega). Boot the target, read focus, navigate with the D-pad remote, type, screenshot, and on Vega debug the JS runtime (evaluate, console logs, network inspector). Use when a task targets a TV (runtimeKind "tv", or…

software-mansion/argent · 107 tokens

review

5-pass structured code review — correctness, security, performance, readability, consistency.

SethGammon/Citadel · 17 tokens

live-preview

Mid-build visual verification loop. Takes screenshots of components during construction, not just after. Catches visual regressions and invisible features before they compound. Requires Playwright or similar screenshot tool.

SethGammon/Citadel · 40 tokens

marshal

Meta-orchestrator that takes any direction — broad, specific, or vague — and autonomously chains skills and context into actionable work. Gathers context from codebase, docs, and memory. Only asks the user when it genuinely cannot proceed. Single-session orchestrator.

SethGammon/Citadel · 56 tokens

wiki

Markdown-first knowledge base where the LLM acts as librarian. Ingests raw sources, compiles and interlinks topic files, self-maintains an index. No vector DB or embeddings required -- uses LLM-native navigation over structured markdown up to 400K words.

SethGammon/Citadel · 56 tokens

review-offered-task

Review a task that has been offered to you and decide whether to accept or reject it.

desplega-ai/agent-swarm · 22 tokens