Mermaid Architecture Diagram

A prompt that asks an AI to generate Mermaid diagram code for a system architecture diagram based on a described solution.

  • 🤖 ChatGPT, Claude, Gemini
  • 🗂️ Coding

Last verified: write-up checked

Prompt by PickleBoxer · Original source (opens in a new tab)

Mermaid Architecture Diagram — prompt preview

The prompt

prompt
Write the Mermaid code for an architecture diagram for this solution [DESCRIBE SOLUTION]

What it is

Mermaid Architecture Diagram is a prompt that converts a plain-text description of a software solution into Mermaid diagram code. Mermaid is a popular text-based diagramming language that renders in GitHub, GitLab, Notion, and many documentation tools, making it ideal for keeping architecture diagrams alongside code. This prompt is useful when you need to quickly visualize how components in a system interact -- microservices, databases, message queues, external APIs, and frontend clients. Instead of opening a diagramming tool and dragging boxes around, you describe your architecture and get renderable code in seconds. The output typically uses Mermaid's flowchart or graph syntax, but you can steer it toward other formats like C4 diagrams or sequence diagrams by adding that preference to your description. For complex systems, iterate by asking the AI to add or reorganize components after the initial diagram is generated.

Who it's for

  • Developers
  • Software architects creating technical documentation

Requirements

Requirements

  • Any AI chatbot (ChatGPT, Claude, Gemini)

برومبت يطلب من الذكاء الاصطناعي كتابة كود Mermaid لمخطط هندسة النظام بناء على وصف الحل.

Examples

From the source

Prompt
prompt
Write the Mermaid code for an architecture diagram for this solution [DESCRIBE SOLUTION]

Expected output: From PickleBoxer's dev-chatgpt-prompts collection on GitHub.

Pros & cons

Pros

  • Pro:Produces renderable diagram code instantly instead of requiring manual diagramming tools
  • Pro:Mermaid diagrams are text-based and version-controllable, fitting naturally into documentation-as-code workflows

Cons

  • Con:Complex architectures with many services may produce cluttered diagrams that need manual layout adjustments
  • Con:The AI may not know your specific infrastructure components and may use generic labels

Tips

  • Describe the main components, their interactions, and any external services for a more accurate diagram
  • Paste the output into a Mermaid live editor (mermaid.live) to preview and refine it
  • Specify the diagram type you prefer (flowchart, C4, sequence) if the default choice does not suit your needs