Using Mermaid Diagrams to Learn a Codebase

5 August 2025

Mermaid diagram sampleOne of the very useful ways I’ve put AI to work is for getting familiar with an existing (but new to me) project, or area of it.

This can be done using a codebase-aware AI tool such as Cursor or Claude Code. These tools can scour the entire codebase or portion of it, depending on your prompt, and generate code in Mermaid’s Diagram Syntax.

You can then bring this code into Mermaid to visualize the types, properties, relationships and functionality. Just specify with your prompt what you’d like to show.

Example prompt:

“Create a diagram of the app structure using Mermaid syntax. This should show data types and relationships. Make any important notes about the relationships such as ‘uses’ or ‘conforms to’.”

Tip: Select Playground on Mermaid’s website if you want to use it without creating an account.