π¦ ClawHub
AI Mermaid Diagrams
by @opietaylor911
Generate architecture diagrams (network, system, cloud, microservices) and sequence diagrams (API flows, auth flows, data flows) as PNG files using Mermaid....
TERMINAL
clawhub install ai-mermaid-diagramsπ About This Skill
name: mermaid-diagrams description: > Generate architecture diagrams (network, system, cloud, microservices) and sequence diagrams (API flows, auth flows, data flows) as PNG files using Mermaid. Use when asked to create, draw, or diagram anything including system architecture, network topology, cloud infrastructure, API request flows, authentication flows, CI/CD pipelines, database flows, or any other technical diagram. Triggers on phrases like "create a diagram", "draw", "diagram this", "architecture diagram", "sequence diagram", "flow diagram", "network diagram", "system design diagram".
Mermaid Diagrams Skill
Generates Mermaid diagrams and renders them to PNG using the mmdc CLI.
Reference Files
references/architecture-patterns.mdreferences/sequence-patterns.mdLoad the relevant reference file based on diagram type requested.
Rendering Tool
Use mermaid.ink (free online renderer, no browser/install needed):
mkdir -p /home/bcaddy/.openclaw/workspace/diagrams
ENCODED=$(cat | base64 -w 0)
curl -s "https://mermaid.ink/img/${ENCODED}?bgColor=white&width=2048" \
-o /home/bcaddy/.openclaw/workspace/diagrams/.png
/home/bcaddy/.openclaw/workspace/diagrams/&width=3000)mkdir -p /home/bcaddy/.openclaw/workspace/diagramsWorkflow
1. Identify Diagram Type
flowchart or C4ContextsequenceDiagram2. Load Reference File
references/architecture-patterns.mdreferences/sequence-patterns.md3. Generate Mermaid Code
4. Save .mmd File
Save to:/home/bcaddy/.openclaw/workspace/diagrams/.mmd Use kebab-case, descriptive filenames: auth-flow.mmd, aws-architecture.mmd, api-gateway-sequence.mmd
5. Render to PNG via mermaid.ink
ENCODED=$(cat /home/bcaddy/.openclaw/workspace/diagrams/.mmd | base64 -w 0)
curl -s "https://mermaid.ink/img/${ENCODED}?bgColor=white&width=2048" \
-o /home/bcaddy/.openclaw/workspace/diagrams/.png
6. Confirm Output
Report the full path to the saved PNG. Offer to adjust layout, add components, or generate a.mmd file for further editing in mermaid.live or VS Code.Tips
flowchart LR for left-to-right pipelines and network flowsflowchart TD for top-down hierarchies and cloud stacks-w (width); tall diagrams: increase -H (height)%% Title: ...π Tips & Best Practices
flowchart LR for left-to-right pipelines and network flowsflowchart TD for top-down hierarchies and cloud stacks-w (width); tall diagrams: increase -H (height)%% Title: ...