efcore-d2-db-diagram
Generate D2 database diagrams from Entity Framework Core models. USE FOR: EF Core database diagram, Entity Framework Core ERD, DbContext diagram, C# entity relationship diagram, PostgreSQL schema visualization, generate .d2 file from EF Core entities, Fluent API mapping diagram, migrations-based database diagram, table relationships, owned types, many-to-many join tables, indexes and constraints. DO NOT USE FOR: runtime debugging, database migration execution, schema deployment, SQL performance tuning, or draw.io diagrams.
Target: Databases. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original English text
Topics in the source
- EF Core D2 Database Diagram Generator
- When to Use
- Goal
- Tools
- Recommended Workflow
- Mandatory Questions Before Diagram Generation
- Reference Documents
- EF Core Extraction Rules
Use this skill when the user wants to generate a database / ERD diagram from an Entity Framework Core codebase. Typical requests: Generate a D2 database diagram from EF Core entities. Visualize tables, columns, primary keys, foreign keys and relationships. Analyze DbContext, DbSet , IEntityTypeConfiguration , Fluent API and migrations. Produce a .d2 file renderable to SVG/PNG with the d2 CLI. Document the database model of an ASP.NET Core / .NET project. Create a readable D2 entity-relationship diagram that reflects the actual EF Core persistence model, not only the raw C# class shape. The diagram must prioritize: 1. Database tables and relationships. 2. Primary keys, foreign keys, required/optional columns. 3. Owned types and value objects. 4. Many-to-many relationships and join tables. 5. Indexes, unique constraints and table names. 6. EF Core conventions only when explicit mapping is absent. Output is .d2 source code. It can be rendered to SVG or PNG via the d2 CLI. d2 CLI: render .d2 files to SVG/PNG. d2 input.d2 output.svg d2 --layout=elk input.d2 output.svg d2 fmt: format D2 files. d2 fmt input.d2 No MCP server is required. The skill generates D2 source code as text. 1. Read
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- OKHP3/skillz
- Source file
- community/efcore-d2-db-diagram/SKILL.md
- Fixed revision
- 7b187777d42ab7bc7bab1e5f2c940cd3139ecebf
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: OKHP3/skillz · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-10T10:00:54.201Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.