Skip to content

EF Core D2 Database Diagram

Generates D2 database diagrams (ERD source) from Entity Framework Core models

Stars
40,703
Licence
MIT
Files
6 files

What it does

Once installed, the agent reads an Entity Framework Core .NET project (DbContext, entity classes, Fluent API configurations and migrations) and builds a picture of the real database schema: tables, columns, keys, foreign keys, owned types and join tables. It then writes a .d2 text file that draws this as an entity-relationship diagram, and can render it to SVG or PNG using the d2 command-line tool. It asks a set of display questions first, such as which DbContext to diagram and whether to show column types.

Great for

  • .NET developers who want a visual overview of an EF Core database model for documentation or onboarding
  • Teams reviewing table relationships and keys in an existing ASP.NET Core project
  • Developers who want a D2 diagram source file they can edit and version alongside code

Skip it if

  • Running or deploying database migrations, since the skill only reads code and generates diagram text (it is explicitly not for migration execution or schema deployment)
  • Projects not using Entity Framework Core, such as raw SQL or other ORMs, where the extraction rules would not apply
  • Draw.io diagrams or SQL performance tuning, which the skill explicitly excludes

Try asking

  • “Generate a D2 database diagram from the EF Core entities in this repository”
  • “Create an ERD for the AppDbContext showing only primary and foreign keys”
  • “Visualize the many-to-many join tables and owned types in our ASP.NET Core project and render it to SVG”
Step-by-step guide: how to use EF Core D2 Database DiagramInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 6 original files, the MIT licence and an attribution note.

    efcore-d2-db-diagram.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip efcore-d2-db-diagram.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip efcore-d2-db-diagram.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Answer the display questions explicitly (for example, key-only columns or full columns) to avoid cluttered diagrams on large models.
  • Point the agent at a specific DbContext name when a project has several, instead of auto-detect.
  • Install the d2 CLI beforehand so the agent can validate with d2 fmt and render the output.

What's inside

  • references/d2-erd-style.md
  • references/efcore-model-extraction.md
  • references/grouping-modes.md
  • references/quality-gate.md
  • references/relationship-rules.md
  • SKILL.md

Redistributed unmodified from github/awesome-copilot under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.