Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

database-documentation-gen数据库文档生成

Agent Skill

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

总安装

667

周安装

27

GitHub Stars

2,089

下载量

210
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:database-documentation-gen(数据库文档生成)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/database-documentation-gen
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill database-documentation-gen
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill database-documentation-gen

简介

通过元数据探查自动生成结构化的数据库文档与数据字典。

  • 支持 PostgreSQL 和 MySQL 的 schema 解析及关系图谱展示。
  • 输出 Markdown 格式报告,包含表结构、约束、索引和存储过程信息。
  • 要求具备数据库只读权限并能执行 CLI 查询命令。
  • database-documentation-gen 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

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

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

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.02%
按下载量换算76

Claude

31.06%
按下载量换算65

Cursor

20.5%
按下载量换算43

Gemini CLI

10.28%
按下载量换算22

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills