- Home
- Skills
- Data & Databases
- Database Schema ERD and Data Dictionary Generator
Works with the AI Agents you already use
Database Schema ERD and Data Dictionary Generator
Generate Mermaid ER diagrams, optional DBML and a data dictionary from migrations, ORM models or read-only introspection, with schema health checks, graded DOCUMENTED, GAPS or DRIFTED.
$7
Database Schema ERD and Data Dictionary Generator
Example session with this skill installed
Generate an ERD and a data dictionary for our Postgres database from prisma/schema.prisma and the prisma/migrations folder. Tell me whether the schema file and the migrations still agree, and flag anything unhealthy in the schema.
- Read your context and instructions
- Compiled the database schema erd
Database schema - shop-api @ 9b2f41c (PostgreSQL, sources: migrations, Prisma)
Verdict: DRIFTED Tables: 14 in 3 domains Purpose coverage: 9/14
Defaults used: output docs/database/, no DBML Render test: passed 3/3
Drift
| # | Kind | Object | Migrations | schema.prisma | Fix |
|---|---|---|---|---|---|
| D1 | missing-in-migrations | orders.discount_code | not present | schema.prisma:58 | run prisma migrate dev yourself to create the migration |
| D2 | index-missing | products.sku unique | 20260312_sku/migration.sql:4 | schema.prisma:91 has no @unique | add @unique to the model |
npx prisma migrate diff --from-migrations ./prisma/migrations --to-schema ./prisma/schema.prisma --exit-code exited 2 (differences).
Health findings
| # | Sev | Object | Finding | Evidence |
|---|---|---|---|---|
| H1 | HIGH | audit_log | no primary key | 20250901_init/migration.sql:88 |
| H2 | MEDIUM | order_items.product_id | FK without index | 20250901_init/migration.sql:61 |
| H3 | MEDIUM | payments.order_id | FK without index | 20251020_payments/migration.sql:9 |
| H4 | LOW | users.deleted_at | soft delete, but users_email_key is not partial | 20250901_init/migration.sql:7 |
Suggested DDL (not run): CREATE INDEX CONCURRENTLY order_items_product_id_idx ON order_items (product_id);
Commerce (6 of 14 tables)
erDiagram
customers ||--o{ orders : "customer_id"
orders ||--o{ order_items : "order_id"
products ||--o{ order_items : "product_id"
orders ||--o{ payments : "order_id"
orders |o--o| invoices : "order_id"
orders {
bigint id PK
bigint customer_id FK
order_status status
timestamptz created_at
}
Legend: solid = FK declared; |o--o| = unique, nullable FK (one-to-one).
Data dictionary (excerpt)
orders
Purpose: "Customer orders, one per checkout" (schema.prisma:52, /// comment)
| Column | Type | Null | Default | Key |
|---|---|---|---|---|
| id | bigint | NO | identity | PK |
| customer_id | bigint | NO | FK -> customers.id (RESTRICT) | |
| status | order_status | NO | 'pending' |
Next steps
- Wrote docs/database/README.md, erd-accounts.md, erd-commerce.md, erd-content.md, data-dictionary.md, health.md, drift.md, evidence.md
- 5 tables need a purpose comment in source
- CI: rerun the migrate diff check when prisma/** changes
Connects securely to your tools. The creator never sees your data.
About this skill
Database docs fall out of date with every migration. An ERD an AI sketches from table names often guesses relationships, cardinality and ON DELETE rules that the schema does not have. This skill builds the ERD and data dictionary from the actual schema source, and every table, column, key and relationship cites a file:line or a catalog query.
What it does:
- Finds every schema source: SQL migrations and dumps (PostgreSQL, MySQL, SQLite, SQL Server), and models in Prisma, Drizzle, TypeORM, Sequelize, Django, Rails schema.rb, SQLAlchemy/Alembic and EF Core
- Optionally introspects a live database, but only through catalog queries in a read-only session, with the connection read from an env var. It never writes and never reads row data
- Draws Mermaid erDiagrams split by domain (12 entities or fewer each), taking cardinality from nullability and unique constraints rather than column names. DBML for dbdiagram.io is optional
- Writes a Markdown data dictionary covering types, nullability, defaults, PK/FK/unique, indexes, checks, enums and comments. Table purposes come only from the source and are never made up
- Flags schema health issues: tables without a PK, *_id columns with no FK, FKs without an index, duplicate indexes, polymorphic and soft-delete patterns, naming problems and candidate orphan tables
- Checks drift between models, migrations and the live schema using each tool's own diff command where one exists
- Lays out the files under docs/database/ and returns a DOCUMENTED, GAPS or DRIFTED verdict
Who it's for: backend developers, data engineers, tech leads and technical writers who need onboarding docs, a pre-migration review or a schema audit.
Honesty note: the output describes one commit or one catalog snapshot. Suggested DDL is shown and never run. Some ORM drift commands are marked "verify" in the reference because they were not re-checked against official docs.
The output reflects the schema sources at one commit or one catalog snapshot. Table and column meanings come only from comments and docstrings, so undocumented ones stay blank. Live introspection needs a read-only role that you provide. Mermaid features such as nullable types and ER subgraphs depend on the Mermaid version your host runs. Some ORM drift commands should be checked against your tool version.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 29 days ago
Requires