database-documentation

database-documentation is a skill for Claude Code, Codex from a-tokyo/agent-skills. It costs 159 tokens per session (3,186 once invoked), scanned A, original, MIT.

A process for writing database documentation from the live database, which is the actual system storing the application’s data. It compares that source with models, migrations, generated types, seed data, and application queries.

In plain words
What is it for?
Use it to document tables, columns, relationships, indexes, constraints, and other parts of a database accurately and to find differences between the database and the code that describes it.
Why use it?
It prevents documentation from describing an outdated or incomplete database. A final comparison checks that the written documentation matches the real schema, including constraints and legacy tables.

Skill for Claude CodeCodex

Part of the all-skills plugin — 6 skills shipped together

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

Made for: Claude Code, Codex.

Or install all-skills, the plugin that ships this one along with the rest of its 6 skills.

Its marketplace also offers this one on its own, as the plugin database-documentation/plugin install database-documentation after adding the marketplace above.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/a-tokyo/agent-skills/database-documentation.svg)](https://agentmods.dev/skills/a-tokyo/agent-skills/database-documentation)
Your own site
<a href="https://agentmods.dev/skills/a-tokyo/agent-skills/database-documentation"><img src="https://agentmods.dev/badge/skills/a-tokyo/agent-skills/database-documentation.svg" alt="Measured on agentmods" height="20"></a>
Per session 159 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,186 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.00159 $0.03186
Opus 5 $0.00079 $0.01593
Sonnet 5 $0.00032 $0.00637
Haiku 4.5 $0.00016 $0.00319

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

Security

Grade A, and why

database-documentation 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 5d 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-documentation/SKILL.md · 193 lines

How it starts

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

database-documentation

Document a database so completely and accurately that the docs are provably the schema, not a plausible guess at it. A half-correct schema doc is worse than none: people trust it and write broken code.

The one principle: grounded AND verified

Every statement in the output must be:

  • grounded — traceable to a concrete source, preferring the live database (introspection of the system catalog). ORM models, migrations, generated types, and seeds are claims about the database, not the database; the catalog is what actually runs.
  • verified — confirmed by re-introspecting the live database and diffing it against the generated docs until the diff is empty or every remaining difference is explicitly justified. Never write "documentation is complete" — instead make the diff empty and show it.

A frontier model left to itself reads the ORM, writes confident prose, and ships an incomplete and partly hallucinated schema (missed check-constraint enums, wrong ON DELETE, omitted legacy tables, invented columns). This skill exists to defeat exactly that. Two mechanisms do it: (1) the live DB is the oracle, and (2) judgment is never one agent's call — independent adversaries hunt for what one pass misses.

Scope (v1): relational/SQL only

Targets PostgreSQL, MySQL, SQL Server, SQLite. If you detect a document store (MongoDB) or graph database, say so and stop on that store — do not emit relational docs for it (silent mis-documentation is the worst outcome). Note it as out of scope rather than guessing.

Workflow

Run these phases in order. Each names its exit artifact. Keep all scratch (intermediate extractions, the working CSM) in a single .database-documentation/ scratch dir or your platform scratchpad — the only durable deliverables are the docs and schema.json.

Phase 0 — Discover (read-only)

  1. Fingerprint the engine + version and the ORM(s): look for schema.prisma, *.entity.ts + datasource, drizzle.config.*, knexfile.* + migrations/, Django models.py, Rails schema.rb, raw SQL DDL. Find the engine + version from the datasource/provider, docker-compose.yml image tags, and connection URLs in .env*.
  2. Find the live-DB reachability path, trying in this order and stopping at the first that works: a connected DB MCP serverdocker compose exec / docker exec into the DB container (read creds from compose env) → a local DB CLI (psql/mysql/sqlcmd/sqlite3) against host:port from .env. Prove it with one trivial query (SELECT 1, list tables) before continuing. If the DB is down but a compose file defines it, offer to start it. Never print credentials: treat passwords/DSNs read from .env/compose as secrets — keep them only in the command you execute, and redact them (password=***) in anything you show or write to the docs.
  3. Inventory every other surface: migrations dir (+count), generated client/*.d.ts, seeds/fixtures, and grep the app for raw SQL / query-builder calls. Note existing docs/db/ — if present this is a refresh: load it to diff for drift and to match house style.
  4. Announce the tier you reached (see Degradation ladder) so the reader knows the confidence level.

Read the full file on GitHub · 193 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. 5d ago First seen · 193 lines · 159 tokens per session scan A 382ee3acb529

Subscribe to this mod's changes

database-documentation is a skill published in the GitHub repository a-tokyo/agent-skills (15 stars, last pushed 29d ago), licensed MIT. It adds 159 tokens to every session and 3,186 once invoked, about $0.0008 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.

Related

Other skills, from other repositories

deprecation-and-migration

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset…

addyosmani/agent-skills · 69 tokens

postgres-idioms

PostgreSQL best practices — schema design, query performance, indexing, connection management, RLS, concurrency, monitoring, and migrations. Load when writing SQL, designing schemas, or optimizing PostgreSQL queries.

irahardianto/awesome-agv · 46 tokens

firebase-security-expert

Firebase security expert to audit Security Rules (Firestore/Realtime Database/Storage), authentication, API keys, data leakage prevention, and App Check configuration / Ahli keamanan Firebase untuk audit Security Rules (Firestore/Realtime Database/Storage), autentikasi, API keys, pencegahan kebocoran data, dan…

roedyrustam/vibes-plug · 72 tokens

database-orm-expert

Expert guide for database schema design, ORM tools (Prisma 6, Drizzle ORM, TypeORM), migrations, query optimization, and type-safe SQL patterns in TypeScript / Panduan ahli untuk desain skema database, ORM tools (Prisma 6, Drizzle ORM, TypeORM), migrasi, optimasi query, dan pola SQL type-safe di TypeScript.

roedyrustam/vibes-plug · 82 tokens

supabase-security-expert

Supabase security expert to audit RLS (Row Level Security), RBAC, relational databases, prevent data leakage, and utilize Supabase Linter / Ahli keamanan Supabase untuk audit RLS (Row Level Security), RBAC, database relasional, pencegahan kebocoran data, dan pemanfaatan Supabase Linter.

roedyrustam/vibes-plug · 75 tokens

search-engine-expert

Expert guide for full-text search engines (Typesense, Meilisearch, Elasticsearch), faceted search, and autocomplete / Panduan ahli mesin pencarian full-text (Typesense, Meilisearch, Elasticsearch), pencarian berfaset, dan autocomplete.

roedyrustam/vibes-plug · 56 tokens