database

database is a skill for Codex from kreek/consult. It costs 22 tokens per session (912 once invoked), scanned A, original, MIT.

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 Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when designing schemas, writing migrations, adding indexes, tuning queries, changing transaction behavior, handling connection pools, or modifying production data.

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

Made for: 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 database

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kreek/consult/database"><img src="https://agentmods.dev/badge/skills/kreek/consult/database.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 912 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.00022 $0.00912
Opus 5.5 $0.00009 $0.00365
Sonnet 5.5 $0.00004 $0.00182
Haiku 4.5 $0.00002 $0.00091

Measured 16d ago against content hash 70c8856d50d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 16d 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/.agents/skills/database/SKILL.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 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.

Rules

  1. Destructive and hard-to-reverse database changes are the user's call. Schema and migration changes that other code or stored data binds to route through contract-first, which owns the approval scope. Data deletion and non-reversible backfills always need explicit approval, because a rollback cannot undo them. An additive, easily reversed change on a development-stage schema proceeds with its shape stated in the close-out.
  2. Use the project's existing database unless the task is choosing a store; architecture owns store selection.
  3. Destructive or tightening changes ship as separate deployable expand-contract phases: expand, migrate, verify, switch, contract.
  4. Review the migration SQL and its lock behavior directly, not just the ORM code. Index and constraint creation uses the target engine's online mechanism. SQLite passing is not proof of Postgres behavior; verify engine-specific DDL against the target engine.
  5. Every uniqueness invariant is enforced by a DB-level UNIQUE, EXCLUDE, composite, or partial constraint, because application-layer checks race under concurrency.
  6. New foreign keys and known WHERE, JOIN, or ORDER BY predicates get supporting indexes in the same migration, or a stated reason they do not. Important query changes include EXPLAIN/ANALYZE on production-shaped data.
  7. Backfills are batched, resumable, observable, and reversible, and each batch holds locks briefly.
  8. Isolation level and retry behavior are explicit for transactional changes. State changes and durable publication (events, jobs) share a transactional outbox, CDC, or equivalent when the two must not silently diverge.
  9. Rollback and backup/PITR coverage for the blast radius are documented with the change.

Read the full file on GitHub · 80 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. 16d ago Changed · +3 tokens per session 70c8856d50d5
  2. 1mo ago Changed · -40 lines 4e12909f7e5e
  3. 1mo ago 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 17d ago), licensed MIT. It adds 22 tokens to every session and 912 once invoked, about $0.0001 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-31.