Generate ER Diagrams from Your Database Migrations
Architecture diagrams are great, but when onboarding a new developer it's the ER diagram they actually want. Claude can generate one straight from your migrations in seconds.
Read the database migrations in database/migrations and generate a Mermaid erDiagram
showing all tables, column names with types, primary keys, and foreign key relationships.
Claude outputs a erDiagram block that renders natively on GitHub, in Notion, and in most documentation tools:
erDiagram
users {
int id PK
string email
timestamp deleted_at
}
orders {
int id PK
int user_id FK
decimal total
string status
}
users ||--o{ orders : "places"
Paste it straight into your README and it just works.
If your schema is large, scope it down:
Only include the core domain tables (users, orders, products, order_items).
Exclude audit logs, jobs, and pivot tables.
You can also ask Claude to update the diagram as part of your workflow whenever you add a new migration — or add it as a post-migration hook.
An up-to-date ER diagram in your README turns a new hire's first week into their first day.
Log in to leave a comment.
The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.
The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.
Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.