Agent skill · writing content · jeremylongshore

database-documentation-gen

Process use when you need to work with database documentation.

Why this skill is useful

Adds executable scripts for automated database documentation generation that are not commonly found in public resources.

What it needs

Requires mysql, psql installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

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 informationschema, pgcatalog (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 tablename, objdescription((tableschema '.' tablename)::regclass) AS tablecomment FROM informationschema.tables WHERE tableschema = 'public' AND tabletype = 'BASE TABLE' ORDER BY tablename (PostgreSQL). For MySQL: SELECT TABLENAME, TABLECOMMENT FROM informationschema.TABLES WHERE TABLESCHEMA = DATABASE(). 2. For each table, extract column details: SELECT c.columnname, c.datatype, c.charactermaximumlength, c.isnullable, c.columndefault, pgd.description AS columncomment FROM informationschema.columns c LEFT JOIN pgcatalog.pgdescription pgd ON pgd.objsubid = c.ordinalposition AND pgd.objoid = (c.tableschema '.' c.tablename)::regclass WHERE c.tablename = 'targettable' ORDER BY c.ordinalposition. 3. Extract primary key and unique constraint definitions: SELECT tc.constraintname, tc.constrainttype, kcu.columnname FROM informationschema.tableconstraints tc JOIN informationschema.keycolumnusage kcu ON tc.constraintname = kcu.constraintname WHERE tc.tablename = 'targettable' AND tc.constrainttype IN ('PRIMARY KEY', 'UNIQUE'). 4. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/database-documentation-gen--a956ea

View the source on GitHub

Browse the @skills marketplace