💡 🧠One of the many use cases for Large Language Models (LLM) includes diagramming code flow. As a visual learner, it helps me to see a flow control diagram rather than trying to reverse engineer code as text. I've been working on an internal software project in TypeScript recently, and forgot how some functions interacted with each other. I used a very simple, generic prompt to ask for a Mermaid JS diagram of the program's flow.
For the screenshot attached to this post, I cloned the "dua-cli" GitHub repository, which is an open source disk usage analyzer built in Rust. 🦀 I used the following prompt to generate the diagram, with absolutely zero manual modifications: "Generate a Mermaid JS diagram showing the high-level code flow in this Rust project's source code files."
I used the Claude 3.5 Sonnet v2 model, through Amazon Bedrock APIs, to generate this diagram.
Take some time to experiment using LLMs to generate Mermaid diagrams! Add in some color customizations, or other unique instructions, per the Mermaid.js documentation, and see if the model can handle it! Use these diagrams to help you learn how to architect software, from other opensource examples.
Trevor Sullivan
💡 🧠One of the many use cases for Large Language Models (LLM) includes diagramming code flow. As a visual learner, it helps me to see a flow control diagram rather than trying to reverse engineer code as text. I've been working on an internal software project in TypeScript recently, and forgot how some functions interacted with each other. I used a very simple, generic prompt to ask for a Mermaid JS diagram of the program's flow.
For the screenshot attached to this post, I cloned the "dua-cli" GitHub repository, which is an open source disk usage analyzer built in Rust. 🦀 I used the following prompt to generate the diagram, with absolutely zero manual modifications: "Generate a Mermaid JS diagram showing the high-level code flow in this Rust project's source code files."
I used the Claude 3.5 Sonnet v2 model, through Amazon Bedrock APIs, to generate this diagram.
Take some time to experiment using LLMs to generate Mermaid diagrams! Add in some color customizations, or other unique instructions, per the Mermaid.js documentation, and see if the model can handle it! Use these diagrams to help you learn how to architect software, from other opensource examples.
4 months ago | [YT] | 29