database

database is a skill for Claude Code, Codex from dayfinggg/openai-codex-agent-skills. It costs 100 tokens per session (4,021 once invoked), scanned A, original, MIT.

A database engineering guide for changing SQL and MongoDB data structures and access code. It covers schemas, queries, indexes, migrations, ORM models, and database connections.

In plain words
What is it for?
Use it to design or review schemas, write and tune queries, manage indexes and migrations, and update ORM or MongoDB access code.
Why use it?
It helps prevent changes that conflict with the database engine, project versions, migration history, or existing callers. It also separates safe inspection from changes that require permission to run.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to design or review schemas, write and tune queries, manage indexes and migrations, and update ORM or MongoDB access code.

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

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 database

README.md
[![agentmods](https://agentmods.dev/badge/skills/dayfinggg/openai-codex-agent-skills/database/github.svg)](https://agentmods.dev/skills/dayfinggg/openai-codex-agent-skills/database)
Your own site
<a href="https://agentmods.dev/skills/dayfinggg/openai-codex-agent-skills/database"><img src="https://agentmods.dev/badge/skills/dayfinggg/openai-codex-agent-skills/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/dayfinggg/openai-codex-agent-skills/database"><img src="https://agentmods.dev/badge/skills/dayfinggg/openai-codex-agent-skills/database.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,021 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.00100 $0.04021
Opus 5.5 $0.00040 $0.01608
Sonnet 5.5 $0.00020 $0.00804
Haiku 4.5 $0.00010 $0.00402

Measured today against content hash 451c13711733, 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 today.

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.

codex/skills/database/SKILL.md · 176 lines

How it starts

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

<data_safety> A destructive or production command runs only after the user confirms it in the conversation. A destructive command drops, truncates, resets, or wipes data, or changes existing rows with UPDATE, DELETE, or MERGE. A production command is any command whose target is not a local or disposable database. Before each such command, read the target host and database name from DATABASE_URL, the ORM config, or the connection string.

These steps apply to every destructive change.

  1. Work on a copy first when one exists, such as a local database, a branch database, or a restored dump.
  2. Back up the data the command touches. Check that the backup exists and holds the expected row count.
  3. Run a SELECT count(*) with the same WHERE clause and note the count.
  4. Tell the user what the command destroys, which database it targets, the row count, and where the backup is. Then wait for confirmation.
  5. Run the change in a transaction where the engine allows it. Compare the affected row count with step 3 before COMMIT.

Store backups in a private directory outside the repository and shared folders. Restrict access to the owner and use encrypted storage for sensitive production data. Keep backups out of logs, chat, and commits. Set BACKUP_FILE to the approved destination before these commands. Use the database's existing secure credential mechanism rather than putting passwords in command arguments.

umask 077
pg_dump --format=custom --table=public.orders --file="$BACKUP_FILE"
mysqldump --single-transaction mydb orders > "$BACKUP_FILE"

A copy inside the same database is enough for a small data fix. It does not survive a lost server, so prefer a dump for large changes.

CREATE TABLE orders_backup_20261107 AS SELECT * FROM orders WHERE status = 'stale';

Investigate a production database inside a read-only transaction. PostgreSQL uses BEGIN READ ONLY, and MySQL uses START TRANSACTION READ ONLY. EXPLAIN ANALYZE executes the statement, so wrap an analyzed write in a transaction that ends with ROLLBACK. </data_safety>

<never_run> These commands wipe data or schema, so you never run them on your own initiative.

  • prisma migrate reset and prisma db push --force-reset|--accept-data-loss
  • drizzle-kit push --force
  • rails db:drop|reset|purge|schema:load
  • manage.py flush and manage.py migrate <app> zero
  • artisan migrate:fresh|reset|refresh|db:wipe
  • alembic downgrade base, flyway clean, and dropdb
  • Raw DROP, TRUNCATE, or a DELETE without WHERE in a database client

If one of these looks necessary, tell the user what it would destroy and which database it points at. Let the user run it. Run it yourself only when the user confirms that exact command and the target is local. prisma migrate dev asks to reset the database when it detects drift. Answer no and report the drift to the user. </never_run>

<how_migrations_fail> A migration takes production down in four ways.

  1. A lock queue forms. DDL needs a lock, and even a brief lock waits behind any long-running query. Every query that arrives later waits behind the DDL, so the site stops even though the migration is "instant".
  2. The database rewrites or scans the whole table while it holds that lock.
  3. Old code meets the new schema during the deploy. Renames and drops break the version that is still running.
  4. Data is lost through drops, type narrowing, ORM renames that are really drop and add, and resets. </how_migrations_fail>

Read the full file on GitHub · 176 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. today Changed · +152 lines · +4 tokens per session 451c13711733
  2. yesterday First seen · 24 lines · 96 tokens per session scan A 34c6bbfac1f1

Subscribe to this mod's changes

database is a skill published in the GitHub repository dayfinggg/openai-codex-agent-skills (8 stars, last pushed today), licensed MIT. It adds 100 tokens to every session and 4,021 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-11-06.

Related

database compared with skills from other repositories

database next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
databasedayfinggg/openai-codex-agent-skillsSkill8todayMITA100Claude Code, Codex
ring:mapping-service-resourcesLerianStudio/ringSkill2187d agoApache-2.0A97Cursor
fastapi-init-skilljiushiwon/wg-skillsSkill136todayApache-2.0A229Claude Code, Codex
database-experttravisjneuman/.claudeSkill107yesterdayMITA36Claude Code, Codex
agent-database-experttravisjneuman/.claudeSkill107yesterdayMITA49Claude Code
database-schema-designerOneWave-AI/claude-skillsSkill41819d agoMITA141Claude Code, Codex
database-migratorOneWave-AI/claude-skillsSkill41819d agoMITA76Claude Code