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.
npx agentmods add skills/a-tokyo/agent-skills/database-documentationnpx skills add a-tokyo/agent-skills --skill database-documentationgit clone --depth 1 https://github.com/a-tokyo/agent-skillsWrote 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.
[](https://agentmods.dev/skills/a-tokyo/agent-skills/database-documentation)<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>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.
| Model | Per session | Once 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 |
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.
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)
- Fingerprint the engine + version and the ORM(s): look for
schema.prisma,*.entity.ts+ datasource,drizzle.config.*,knexfile.*+migrations/, Djangomodels.py, Railsschema.rb, raw SQL DDL. Find the engine + version from the datasource/provider,docker-compose.ymlimage tags, and connection URLs in.env*. - Find the live-DB reachability path, trying in this order and stopping at the first that works:
a connected DB MCP server →
docker compose exec/docker execinto 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. - Inventory every other surface: migrations dir (+count), generated client/
*.d.ts, seeds/fixtures, and grep the app for raw SQL / query-builder calls. Note existingdocs/db/— if present this is a refresh: load it to diff for drift and to match house style. - Announce the tier you reached (see Degradation ladder) so the reader knows the confidence level.
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.
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.
- 5d ago First seen · 193 lines · 159 tokens per session scan A 382ee3acb529
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.
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…
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.
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…
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.
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.
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.