Agent skill

Database Documentation Gen

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Process use when you need to work with database documentation.

MITAuto-check passedDatabases

Install Database Documentation Gen

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill database-documentation-gen -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace database-documentation-gen --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/database-documentation-gen .claude/skills/database-documentation-gen && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
database-documentation-gen
GitHub stars
2.8k
Token cost
~1.9k tokens
SKILL.md length
746 words
Files
7 (incl. scripts, references, assets)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Process use when you need to work with database documentation.

  • Works in 10 steps: Extract the complete table inventory:… → For each table, extract column details:… → Extract primary key and unique… → …
  • You need to work with database documentation
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Runs Python scripts from its folder; calls pg_dump

What it does

Database Documentation Gen is an agent skill from jeremylongshore/tons-of-skills-marketplace. Process use when you need to work with database documentation. This skill provides automated documentation generation with comprehensive guidance and automation. Trigger with phrases like "generate docs", "document schema", or "create database documentation".

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts, reference files and assets (for example `assets/README.md`, `references/README.md` and `scripts/README.md`). Compatibility notes: Designed for Claude Code

It sits in Databases. It works with PostgreSQL and MySQL. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • You need to work with database documentation
  • With phrases like generate docs
  • Document schema
  • Create database documentation

Example prompts

  • “generate docs”
  • “document schema”
  • “create database documentation”
  • “/database-documentation-gen”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*)

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Extract the complete table inventory: SELECT table_name, obj_description((table_schema || '.' || table_name)::regclass) AS table_comment…
  2. For each table, extract column details: SELECT c.column_name, c.data_type, c.character_maximum_length, c.is_nullable, c.column_default…
  3. Extract primary key and unique constraint definitions: SELECT tc.constraint_name, tc.constraint_type, kcu.column_name FROM…
  4. Extract foreign key relationships to build the relationship map: SELECT tc.table_name AS child_table, kcu.column_name AS child_column…
  5. Extract index definitions: SELECT indexname, indexdef FROM pg_indexes WHERE schemaname = 'public' ORDER BY tablename, indexname…
  6. Extract views and their definitions: SELECT viewname, definition FROM pg_views WHERE schemaname = 'public'. Document each view with its…
  7. Extract functions and stored procedures: SELECT routine_name, routine_type, data_type AS return_type FROM information_schema.routines…
  8. Generate the data dictionary in Markdown format with one section per table containing: table description, column table (name, type…
  9. Generate an entity-relationship summary listing all relationships: parent_table (parent_column) -> child_table (child_column) with…
  10. Generate table statistics for context: SELECT relname, n_live_tup AS row_count, pg_size_pretty(pg_total_relation_size(relid)) AS…

What it can do on your machine

Read from SKILL.md and the folder at commit 80f86df. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(psql:*)
    • Bash(mysql:*)
    • Bash(mongosh:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 4 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • pg_dump

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • postgresql.org
    • schemaspy.org
    • dbdocs.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Database Documentation Gen loads about 1.9k tokens when it runs, and up to ~1.9k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 746 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit 80f86df, republished under its MIT licence (© jeremylongshore). 746 words, ~1,916 tokens.

Download SKILL.mdSave it as .claude/skills/database-documentation-gen/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
database-documentation-gen
description
Process use when you need to work with database documentation. This skill provides automated documentation generation with comprehensive guidance and automation. Trigger with phrases like "generate docs", "document schema", or "create database documentation".
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*)
compatibility
Designed for Claude Code
version
1.29.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
database, database-documentation

Database Documentation Generator

Overview

Generate comprehensive database documentation by introspecting live PostgreSQL or MySQL schemas, extracting table structures, column descriptions, relationships, indexes, constraints, stored procedures, and views. Produces human-readable documentation in Markdown format including entity-relationship descriptions, data dictionary, and column-level metadata.

Prerequisites

  • Database credentials with read access to information_schema, pg_catalog (PostgreSQL), or system tables (MySQL)
  • psql or mysql CLI for executing introspection queries
  • Target output directory for generated documentation files
  • Existing column comments (COMMENT ON COLUMN) enhance output quality significantly
  • Knowledge of the business domain for meaningful table/column descriptions

Instructions

  1. Extract the complete table inventory: SELECT table_name, obj_description((table_schema || '.' || table_name)::regclass) AS table_comment FROM information_schema.tables WHERE table_schema = 'public' AND table_type = 'BASE TABLE' ORDER BY table_name (PostgreSQL). For MySQL: SELECT TABLE_NAME, TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE().

  2. For each table, extract column details: SELECT c.column_name, c.data_type, c.character_maximum_length, c.is_nullable, c.column_default, pgd.description AS column_comment FROM information_schema.columns c LEFT JOIN pg_catalog.pg_description pgd ON pgd.objsubid = c.ordinal_position AND pgd.objoid = (c.table_schema || '.' || c.table_name)::regclass WHERE c.table_name = 'target_table' ORDER BY c.ordinal_position.

  3. Extract primary key and unique constraint definitions: SELECT tc.constraint_name, tc.constraint_type, kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name WHERE tc.table_name = 'target_table' AND tc.constraint_type IN ('PRIMARY KEY', 'UNIQUE').

  4. Extract foreign key relationships to build the relationship map: SELECT tc.table_name AS child_table, kcu.column_name AS child_column, ccu.table_name AS parent_table, ccu.column_name AS parent_column, rc.delete_rule, rc.update_rule FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name JOIN information_schema.referential_constraints rc ON tc.constraint_name = rc.constraint_name JOIN information_schema.constraint_column_usage ccu ON rc.unique_constraint_name = ccu.constraint_name WHERE tc.constraint_type = 'FOREIGN KEY'.

  5. Extract index definitions: SELECT indexname, indexdef FROM pg_indexes WHERE schemaname = 'public' ORDER BY tablename, indexname (PostgreSQL). For MySQL: SELECT TABLE_NAME, INDEX_NAME, COLUMN_NAME, NON_UNIQUE, SEQ_IN_INDEX FROM information_schema.STATISTICS WHERE TABLE_SCHEMA = DATABASE() ORDER BY TABLE_NAME, INDEX_NAME, SEQ_IN_INDEX.

  6. Extract views and their definitions: SELECT viewname, definition FROM pg_views WHERE schemaname = 'public'. Document each view with its purpose, source tables, and any filtering logic.

  7. Extract functions and stored procedures: SELECT routine_name, routine_type, data_type AS return_type FROM information_schema.routines WHERE routine_schema = 'public'. Include function signatures and parameter descriptions.

  8. Generate the data dictionary in Markdown format with one section per table containing: table description, column table (name, type, nullable, default, description), primary key, foreign keys with referenced table, indexes, and any check constraints.

  9. Generate an entity-relationship summary listing all relationships: parent_table (parent_column) -> child_table (child_column) with cardinality (one-to-many, many-to-many via junction tables).

  10. Generate table statistics for context: SELECT relname, n_live_tup AS row_count, pg_size_pretty(pg_total_relation_size(relid)) AS total_size FROM pg_stat_user_tables ORDER BY n_live_tup DESC. Include approximate row counts and table sizes in the documentation.

Output

  • Data dictionary (Markdown) with complete column-level documentation for every table
  • Entity-relationship description listing all foreign key relationships with cardinality
  • Index catalog documenting all indexes with their columns and purpose
  • View definitions with source table references and business logic descriptions
  • Schema statistics including table sizes, row counts, and index sizes
Show full SKILL.md (287 more words)Show less

Error Handling

ErrorCauseSolution
Missing column commentsCOMMENT ON COLUMN not used in the databaseGenerate inferred descriptions based on column name patterns; flag columns needing manual description
Permission denied on pg_catalogRestricted database user without catalog accessRequest pg_read_all_settings role; or use pg_dump --schema-only as an alternative schema source
Large schema with 500+ tablesDocumentation generation takes too long or produces unmanageable outputGenerate per-schema or per-module documentation; create a table-of-contents index; filter to specific table prefixes
Custom types not resolvedPostgreSQL domain types or composite types not in standard introspectionQuery pg_type for custom type definitions; include type documentation in a separate section
Stale documentation after schema changeDocumentation not regenerated after migrationIntegrate documentation generation into CI/CD pipeline; run after migration step

Examples

Generating documentation for a 50-table e-commerce database: Introspect all tables in the public schema, producing a 200-line Markdown data dictionary. Each table section includes column descriptions derived from COMMENT ON COLUMN annotations, foreign key relationship arrows, and index listings. Junction tables are identified and documented as many-to-many relationships.

Creating onboarding documentation for a new team member: Generate schema documentation with table sizes and row counts to help new developers understand which tables are central (large, many relationships) and which are auxiliary (small, few references). The relationship map shows the core entity graph: users -> orders -> order_items -> products.

Audit-ready documentation for compliance: Generate documentation including all constraints, check rules, and default values for each column. Flag columns containing PII (matching patterns like email, phone, ssn, address) and document their data protection controls. Output includes timestamp of generation and database version.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references, assets) in skills/.curated/database-documentation-gen of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • assets/README.md
  • references/README.md
  • scripts/README.md
  • scripts/erd_generator.py
  • scripts/init_db_docs.py
  • scripts/validate_config.py

Open the folder on GitHubat commit 80f86df

Compare with similar skills

Database Documentation Gen next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Database Documentation Gen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Database Documentation Gen this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.9kAutomated safety check: PassMIT
How To Communicatedatabasus/databasus8.8k—~3.9kAutomated safety check: PassMIT
SQL Database Support for pRESTprest/prest4.6k—~1.6kAutomated safety check: PassMIT
Chdb SQLvemetric/vemetric3951 repos~1.2kAutomated safety check: PassApache-2.0
Database DesignMoizIbnYousaf/ai-agent-skills1.1k1 repos~1.2kAutomated safety check: PassMIT
Sql2erystemsrx/sql_to_ER188—~1.1kAutomated safety check: PassAGPL-3.0

Similar skills

  • How To Communicate

    databasus/databasus

    Communicate clearly in every response, progress update and agent-authored document.

    8.8k GitHub stars~3.9k tokensUpdated 17 days ago
    DatabasesAuto-check passed
  • Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.

    4.6k GitHub stars~1.6k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Chdb SQL

    vemetric/vemetric

    A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…

    395 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Database Design

    MoizIbnYousaf/ai-agent-skills

    Database schema design, optimization, and migration patterns for PostgreSQL, MySQL, and NoSQL databases.

    1.1k GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Sql2er

    ystemsrx/sql_to_ER

    A skill your agent uses when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview…

    188 GitHub stars~1.1k tokensUpdated 9 days ago
    DatabasesAuto-check passed
  • Migration

    gocronx-team/gocron

    Create, review, or verify gocron database migrations across SQLite, MySQL, and PostgreSQL.

    808 GitHub stars~1.1k tokensUpdated 7 days ago
    DatabasesAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated yesterday
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Database Documentation Gen

What does Database Documentation Gen do?

Process use when you need to work with database documentation. Database Documentation Gen is an agent skill from jeremylongshore/tons-of-skills-marketplace. Process use when you need to work with database documentation.

When should I use Database Documentation Gen?

Database Documentation Gen fits situations like: you need to work with database documentation; with phrases like generate docs; document schema; create database documentation.

How do I install Database Documentation Gen in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill database-documentation-gen -a claude-code`. Or copy the skill folder (skills/.curated/database-documentation-gen in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/database-documentation-gen in your project. Claude Code loads it when a task matches its description.

How do I install Database Documentation Gen in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill database-documentation-gen -a codex`. Or copy the skill folder (skills/.curated/database-documentation-gen in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/database-documentation-gen in your project. Codex loads it when a task matches its description.

Can I use Database Documentation Gen in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill database-documentation-gen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/database-documentation-gen, .gemini/skills/database-documentation-gen, .github/skills/database-documentation-gen and .opencode/skills/database-documentation-gen in your project.

What does Database Documentation Gen need to run?

Going by SKILL.md and its folder, Database Documentation Gen needs Python for the scripts in its folder and the command-line tools its instructions call (pg_dump). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Database Documentation Gen access the network?

SKILL.md names 3 domains. As links in the text: postgresql.org, schemaspy.org and dbdocs.io. This is read from the text; nothing was executed.

Is Database Documentation Gen safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Database Documentation Gen use?

Database Documentation Gen is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Database Documentation Gen use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 18 tokens, read only when the agent opens those files.

What are the alternatives to Database Documentation Gen?

Skills that share tags, products or a category with Database Documentation Gen: How To Communicate (databasus/databasus, 8.8k stars), SQL Database Support for pREST (prest/prest, 4.6k stars), Chdb SQL (vemetric/vemetric, 395 stars) and Database Design (MoizIbnYousaf/ai-agent-skills, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Database Documentation Gen?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,825 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 9, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.