database-erd

SkillDatabases & data

Regenerate docs/database-erd.md from MySQL information_schema (Mermaid ERD: foreign keys and key columns). Use after Flyway schema changes, new migrations, or when the diagram is stale. Triggers on: database ERD, database-erd.md, export_database_erd, schema diagram, ER diagram after migration.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the database-erd skill

What this skill tells your AI

The instructions your AI receives, as published by nerds-odd-e/doughnut in .agents/skills/database-erd/SKILL.md and read by ahel’s review.

Purpose: Keep the schema diagram accurate after Flyway migrations — never hand-edit the Mermaid block.

Output: Updated docs/database-erd.md + summary ending with ## ERD EXPORTED.

Run when:

  • A new or changed Flyway migration alters tables, columns, or constraints
  • The ERD needs to match the current migrated schema

Git does not use the Nix prefix. All other repo tooling does: CURSOR_DEV=true nix develop -c …

Implementation:

  • Script: scripts/export_database_erd.py
  • Output: docs/database-erd.md
  • Omits flyway_schema_history from the diagram

Overrides (optional):

VariableDefault
DONUT_ERD_SCHEMA(auto: development → test → e2e)
DONUT_ERD_MYSQL_HOST127.0.0.1
DONUT_ERD_MYSQL_PORT3309
DONUT_ERD_MYSQL_USERdoughnut
DONUT_ERD_MYSQL_PASSWORDdoughnut
CURSOR_DEV=true nix develop -c python3 scripts/export_database_erd.py

Or:

CURSOR_DEV=true nix develop -c pnpm export:database-erd

<success_criteria>

  • MySQL reachable on 127.0.0.1:3309 with user doughnut
  • At least one migrated schema available (or DONUT_ERD_SCHEMA set)
  • Exporter run with Nix prefix
  • docs/database-erd.md updated and ready to commit
  • Final output includes ## ERD EXPORTED </success_criteria>
  1. Schema catalog used (auto-selected or DONUT_ERD_SCHEMA override).
  2. Whether docs/database-erd.md changed.
## ERD EXPORTED

<out_of_scope>

  • Do not hand-edit the Mermaid block in docs/database-erd.md. </out_of_scope>

Signals

GitHub stars
49
Forks
72
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
database-erd
Source
github.com/nerds-odd-e/doughnut