Erd

From KhaiTrang1995/agentic-awesome-kits · View interactive version

Erd is an AI agent skill from the GitHub repository KhaiTrang1995/agentic-awesome-kits. Generate ERD .drawio — entities, attributes, 1-1/1-N/N-N relationships, PK/FK. Hand-authored XML with TechSphereX AI palette; complex SQL DDL → /diagram --from-sql.

How to use this skill

Skill file

/erd — Entity-Relationship Diagram (draw.io)

When to use

Switch to /diagram when: large SQL DDL file (sqlerd.py), auto-layout for dozens of tables, or batch PNG export.

Input examples

/erd Order 1-N OrderLine, Order N-1 Customer, Order 1-1 Payment --feature booking
/erd auth module: User, Role, UserRole (N-N), Permission
/erd @schema.sql   → suggest /diagram --from-sql if >8 tables

Workflow

Phase 1 — Inventory

List:

| Entity | PK | Attributes (short) | Notes |

|--------|----|--------------------|-------|

| | | | |

Relationships: A 1—N B, A N—N B (// associative entity if needed).

Missing relationship names / cardinality → ask 1–2 questions; do not invent FKs.

Phase 2 — L3 layout preview

Node + edge table (ASCII/table). User reviews before XML.

Phase 3 — Generate XML

Use @_templates/erd.drawio as the frame:

Phase 4 — L1 → Write

docs/diagrams/{feature}/erd-{slug}.drawio

Mandatory rules

Output

docs/diagrams/{feature}/erd-{slug}.drawio

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.