db-docs

Generates database structure documentation with per-table articles and Mermaid ER diagrams.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/lfuuu/claude-rules --skill db-docs-lfuuu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-docs
Source: https://github.com/lfuuu/claude-rules/tree/main/global-skills/db-docs
Command: npx skills add https://github.com/lfuuu/claude-rules --skill db-docs-lfuuu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing and maintaining database documentation by hand is slow and quickly drifts out of sync with the actual schema. This Skill extracts the real schema from your project's source of truth and produces a complete, standardized data-model documentation set. ## Core Features & Use Cases - Stack-agnostic schema extraction: Reads the source of truth from Prisma, SQLAlchemy/Alembic, Django ORM, TypeORM, Drizzle, Sequelize, raw SQL/DDL, or a live database connection. - Standardized layout: Creates docs/data-model/ with an index, a table reference, one article per table (columns, indexes, constraints, relations), plus ER and flow diagrams rendered via Mermaid. - Planned workflow: Classifies tables into primary and auxiliary groups by domain, agrees the plan with the architect before writing, and bootstraps a docs index even in nearly empty projects. - Use Case: Point it at a Prisma project and get a full docs/data-model/ tree with 14 per-table articles, a rendered ER diagram, and cross-links from your architecture docs. ## Quick Start Ask the AI to document the database structure of this project using the db-docs skill, starting from the ORM schema or migrations.

Frequently Asked Questions about db-docs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I document a database schema automatically?

Use this Skill to extract the schema from your ORM, migrations, or live database and generate a docs/data-model/ tree. It creates one article per table covering columns, indexes, constraints, and relations, plus ER and flow diagrams.

How to generate an ER diagram from a Prisma schema?

The Skill reads model blocks, relations, and attributes from schema.prisma, then writes a Mermaid erDiagram file and renders it to PNG via the diagram skill or mmdc. Real foreign keys use solid lines and soft references use dotted lines.

Which ORMs and database stacks are supported?

Supported sources include Prisma, SQLAlchemy with Alembic, Django ORM, TypeORM, Drizzle, Sequelize, Knex or raw SQL migrations, SQL dumps, and live databases queried through psql or information_schema.

Can it document a project with multiple physical databases?

Yes. Each physical database, such as a main database plus a separate raw or journal database, is documented in the tables reference with its own connection, and cross-database logical links are shown as dotted lines without implying foreign keys.

What if mmdc is not installed for diagram rendering?

If mermaid-cli is unavailable, the Skill falls back to npx with @mermaid-js/mermaid-cli on Node 18 or later, using a puppeteer config pointing at system Chrome with no-sandbox flags.

Does it work when the docs folder is almost empty?

Yes. The Skill bootstraps an entry point such as docs/INDEX.md or docs/README.md linking to data-model/README.md as the source of truth for the database structure, without requiring an existing docs index.