Pretty Good UML
Pretty Good UML reads a C# solution with the compiler and draws UML of what the code actually does: which classes an endpoint goes through, what it can throw, and what a change did to that flow. Open the sidebar, click an item, and the diagram opens in a new tab.
Everything is generated on your machine. No AI, no tokens, and the same code always gives the same diagram.
.NET only for now (C# .sln / .slnx / .csproj).
What you get
Sequence diagrams for every HTTP endpoint
Click an endpoint under APIs and see the path of a request through your code:

- Controllers, minimal APIs and FastEndpoints, including minimal-API handlers written as lambdas and routes that get their prefix from a route group.
- MediatR / Mediator:
Send is followed through the pipeline behaviours, in the order they are registered, to the handler.
- Validation: the FluentValidation rules of the request, for example
validate Name NotEmpty, MaximumLength(100).
- Failure paths: every
throw is drawn as a break frame with its condition and the HTTP status your exception middleware maps it to, for example category is null → 404 NotFoundException.
- Database calls: Entity Framework queries are drawn as one call on your DbContext.
- Domain events: an event is followed to its notification handlers.
- The response: the success status of the endpoint.
Git diagrams: what did this change do?
Under Git, pick a changed file to see the difference between your working tree and HEAD as a diagram:

- Sequence: calls and failure paths that were added (green), removed (red) or changed (yellow), in the order they happen. A new guard clause two classes away from the line you edited shows up here.
- Class: added, removed and changed members.
- Activity: the changed steps of a method.
Class, database and component diagrams
- Classes: a class with its properties, methods and neighbours. Constructor dependencies (including primary constructors) are drawn as "uses", properties that hold another class as associations, with
* for collections.
- Overview: whole-solution class diagram, component diagram, and a database (ER) diagram from your
DbSets.
Activity diagrams
Under Methods explorer, the control flow of a single method: conditions, loops, calls and exits.
Usecases
Under Usecases explorer, a high-level view of a handler: primary actor, handler, database and external systems.
How to use
- Open a folder that contains a
.sln, .slnx or .csproj.
- Click Refresh in the Pretty Good UML view. The solution is analysed once and saved; diagrams open from that analysis until you click Refresh again.
- Pick Mermaid or PlantUML in the status bar.
- Click a class, endpoint, method, usecase or git change.
In the preview you can drag or scroll to move the diagram, zoom with Ctrl/Cmd + scroll or pinch, and press Fit to see all of it. Export as PNG, SVG or PDF, copy the diagram model with IR JSON, or send the diagram to chat with Ask AI.
Requires .NET 8 or later.
On every pull request
The same analysis runs in your pipeline. On each pull request it finds the endpoints whose behaviour changed and posts one comment: what was added, removed or changed in each, with a sequence diagram per endpoint. A guard added in an entity shows up on every endpoint that passes through it, including the ones whose handlers nobody touched.
- uses: gaumengangster/pretty-good-uml@v1
with:
solution: MySolution.sln
Free for public repositories; private repositories need a licence. It works with GitHub Actions and Azure Pipelines, and never blocks a pull request.
Setup and pricing: prettygooduml.com
Mermaid or PlantUML
|
Mermaid |
PlantUML |
| Rendering |
Inside the editor, nothing to install |
Needs a PlantUML server for the PNG preview |
| Works in GitHub comments and Markdown |
Yes |
No |
For PlantUML, set UML: PlantUML server URL (status bar) to a running server:
- Local Docker:
http://localhost:8080 after docker run -d -p 8080:8080 plantuml/plantuml-server:jetty
- Hosted:
https://www.plantuml.com/plantuml
The URL is the base, without /png on the end. With a hosted server, the diagram text (class, method and route names) is sent to that server. With Mermaid or a local server, nothing leaves your machine.
Settings
| Setting |
What it does |
dotnetUml.projectPath |
The .sln / .csproj to analyse. Empty = the first solution in the workspace |
dotnetUml.format |
mermaid, plantuml or json |
dotnetUml.plantUmlServer |
Base URL of the PlantUML server |
dotnetUml.includePrivateMethods |
Show private members in class diagrams and method lists |
dotnetUml.gitSplitDiagrams |
Git diagrams as two diagrams (before / after) instead of one merged diagram |
dotnetUml.cliPath |
Path to the analyser. Empty = the one bundled with the extension |
Compare diagrams
UML: Compare diagrams (precision / recall) opens a panel where you paste two diagrams (IR JSON, PlantUML or Mermaid) and get precision and recall of the second measured against the first, with a list of what each one has that the other lacks. Useful for checking a hand-drawn or AI-drawn diagram against the code.
What it does not do
- It is static analysis. It shows what the code can do, not what happened in one particular run. When several implementations of an interface exist, it picks the one it finds.
- Framework steps are not drawn: authentication and authorization attributes, middleware, and Entity Framework interceptors.
- Minimal-API lambdas written directly in
Program.cs (top-level statements) are not followed yet.
- Patterns it has not seen may give a shorter diagram. It is tested mostly on projects that use MediatR or Mediator with Entity Framework Core.
Troubleshooting
If analysis fails, open Output → Pretty Good UML and check dotnetUml.projectPath and dotnetUml.cliPath. Run dotnet restore on the solution first: unresolved packages make diagrams less complete.
If Refresh still mentions pretty-good-uml-0.1.0, uninstall that old version and run Developer: Reload Window.