Logo: Design Doc Mermaid

Design Doc Mermaid

Organisatioun
SpillwaveSolutions
design-doc-mermaid

Create Mermaid diagrams (flowchart, sequence, class, ER, state, C4, architecture) from text or source code. Default for GitHub wiki. Use when asked to create a diagram, generate mermaid, document architecture, or convert code to diagram. PlantUML is only for leftover types. Confluence needs PNG/SVG as well as the fence.

Iwwersiicht

EditeurSpillwaveSolutions
Repositorydesign-doc-mermaid
Skill-Nummdesign-doc-mermaid
Stären
176
Forks
25
Matgeliwwert Dateien
18
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 18 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    SpillwaveSolutions huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Design Doc Mermaid an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/SpillwaveSolutions/design-doc-mermaid/tree/main
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/SpillwaveSolutions/design-doc-mermaid.git \
  .claude/skills/design-doc-mermaid
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Design Doc Mermaid an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Design Doc Mermaid automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Design Doc Mermaid net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Mermaid Architect - Hierarchical Diagram and Documentation Skill

Mermaid diagram and documentation system with specialized guides and code-to-diagram capabilities.

Table of Contents

Decision Tree

How this skill works:

  1. User makes a request → Skill analyzes intent
  2. Skill determines diagram/document type → Loads appropriate guide(s)
  3. AI reads specialized guide → Generates diagram/document using templates
  4. Result delivered → With validation and export options

User Intent Analysis:

Available Guides and Resources

Diagram Type Guides (references/guides/diagrams/)

GuideFull PathLoad When User WantsExamples
Activity Diagramsreferences/guides/diagrams/activity-diagrams.mdWorkflows, processes, business logic, user flows, decision trees"Show checkout flow", "Document ETL pipeline", "Create approval workflow"
Deployment Diagramsreferences/guides/diagrams/deployment-diagrams.mdInfrastructure, cloud architecture, K8s, serverless, network topology"Show AWS architecture", "Document GCP deployment", "Create K8s diagram"
Architecture Diagramsreferences/guides/diagrams/architecture-diagrams.mdSystem architecture, component design, high-level structure"Show system components", "Document microservices", "Architecture overview"
Sequence Diagramsreferences/guides/diagrams/sequence-diagrams.mdAPI interactions, service communication, request/response flows"Show API call sequence", "Document auth flow", "Service interactions"
WikiTicket / GitHub / Confluencereferences/guides/wiki-ticket-and-github.mdDesign docs, walkthroughs, requirements, wiki publish, Confluence images"architecture doc", "code walkthrough", "wiki", "Confluence"

Default for WikiTicket and GitHub wiki is this skill, including classDiagram, erDiagram, and stateDiagram-v2. Do not send those to PlantUML. If GitHub fails to render C4 / architecture-beta / block-beta, fall back to flowchart TD.

Code-to-Diagram Guide & Examples

ResourceFull PathWhat It Provides
Master Guidereferences/guides/code-to-diagram/README.mdComplete workflow for analyzing any codebase and extracting diagrams
Spring Bootexamples/spring-boot/README.mdController→Service→Repository architecture, deployment config, sequence from methods, activity from business logic
FastAPIexamples/fastapi/README.mdPython async patterns, Pydantic models, dependency injection, cloud deployment
Reactexamples/react/README.mdComponent hierarchy, state management, data flow, build pipeline
Python ETLexamples/python-etl/README.mdData pipeline, transformation steps, error handling, scheduling
Node/Expressexamples/node-webapp/README.mdMiddleware chain, route handlers, async patterns, deployment
Java Web Appexamples/java-webapp/README.mdTraditional MVC, servlet containers, WAR deployment

Design Document Templates

TemplateFull PathUse ForLoad When
Architecture Designassets/architecture-design-template.mdSystem-wide architecture"Create architecture doc", "Document system design"
API Designassets/api-design-template.mdAPI specifications"API design doc", "Document REST API"
Feature Designassets/feature-design-template.mdFeature planning"Feature design", "Plan new feature"
Database Designassets/database-design-template.mdDatabase schema"Database design", "Document schema"
System Designassets/system-design-template.mdComplete system"System design doc", "Full system documentation"

Unicode Symbols Guide

Full Path: references/guides/unicode-symbols/guide.md

Load when user mentions: "unicode symbols", "emoji in diagrams", "semantic icons", "add symbols"

Quick Reference:

  • 📦 Infrastructure: ☁️ 🌐 🔌 📡 🗄️
  • ⚙️ Compute: ⚙️ ⚡ 🔄 ♻️ 🚀 💨
  • 💾 Data: 💾 📦 📊 📈 🗃️ 🧊
  • 📨 Messaging: 📨 📬 📤 📥 🐰 📢
  • 🔐 Security: 🔐 🔑 🛡️ 🚪 👤 🎫
  • 📝 Monitoring: 📝 📊 🚨 ⚠️ ✅ ❌

Python Scripts (scripts/)

ScriptUse ForLoad When
extract_mermaid.pyExtract diagrams from Markdown, validate syntax, replace with images"extract diagrams", "validate mermaid", "find all diagrams"
mermaid_to_image.pyConvert .mmd to PNG/SVG, batch conversion, custom themes"convert to image", "render diagram", "create PNG"
resilient_diagram.pyFull workflow: save .mmd, generate image, validate, error recovery"generate diagram", "create diagram with validation", "resilient diagram"

GitHub wiki, WikiTicket, and Confluence

Load references/guides/wiki-ticket-and-github.md for WikiTicket design docs, code walkthroughs, requirements, GitHub wiki, or Confluence.

TargetWhat to ship
GitHub wiki / GFMFenced mermaid block. GitHub renders class, ER, state, sequence, flowchart, C4.
Confluence / Notion / Word / PDFAlso render PNG or SVG (scripts/resilient_diagram.py or mmdc) and upload the image. Do not rely on Confluence to render Mermaid.

PlantUML is opt-in for Salt wireframes, use case, timing, ArchiMate, nwdiag, and WBS. Those always ship as PNG or SVG.

Usage Patterns

Common request patterns and guide selection. See When to Use What for complete mapping.

PatternExample RequestGuides to Load
Single Diagram"Create activity diagram for login flow"Diagram type guide + Unicode symbols
Code-to-Diagram"Generate deployment from application.yml"Framework example + Deployment guide
Design Document"Create API design document"Template from assets/ + Relevant diagram guides
Extract/Validate"Extract diagrams from design.md"Use scripts/extract_mermaid.py
Batch Convert"Convert all .mmd to PNG"Use scripts/mermaid_to_image.py

Resilient Workflow

CRITICAL: This is the recommended approach for ALL diagram generation. It ensures validation, error recovery, and consistent file organization.

Full Guide: references/guides/resilient-workflow.md

Workflow Overview

Key Principle

NEVER add a diagram to markdown until it passes validation. This prevents broken diagrams in documentation.

Using the Script (Recommended)

bash
# Generate with full error recovery
python scripts/resilient_diagram.py \
    --code "flowchart TD; A-->B" \
    --markdown-file design_doc \
    --diagram-num 1 \
    --title "process_flow" \
    --format png \
    --json

Output: Both .mmd and .png files in ./diagrams/ directory.

File Naming Convention

./diagrams/<markdown_file>_<num>_<type>_<title>.mmd
./diagrams/<markdown_file>_<num>_<type>_<title>.png

Example: ./diagrams/api_design_01_sequence_auth_flow.png

Error Recovery Priority

When validation fails, the workflow automatically:

  1. Check troubleshooting guide - references/guides/troubleshooting.md (28 documented errors)
  2. Search with perplexity - perplexity_ask MCP for syntax questions
  3. Search with brave - brave_web_search MCP for recent solutions
  4. Ask gemini - gemini skill for alternative perspective
  5. General search - WebSearch tool as fallback

Manual Fallback Steps

If the script is unavailable:

  1. Identify diagram type from first line (flowchart, sequence, etc.)
  2. Load reference guide from references/guides/diagrams/
  3. Save to ./diagrams/<markdown_file>_<num>_<type>_<title>.mmd
  4. Validate: mmdc -i file.mmd -o file.png -b transparent
  5. On error: Search references/guides/troubleshooting.md for matching error
  6. If not found: Use search tools in priority order above
  7. Add reference: ![Description](./diagrams/filename.png)

Pattern 6: Resilient Diagram Generation

User: "Create a sequence diagram and add it to the design doc"

Skill Actions:

  1. Identify intent: diagram generation + markdown integration
  2. Load workflow guide: references/guides/resilient-workflow.md
  3. Identify diagram type: sequence
  4. Load diagram guide: references/guides/diagrams/sequence-diagrams.md
  5. Generate Mermaid code using templates
  6. Execute resilient workflow:
    bash
    python scripts/resilient_diagram.py \
        --code "[generated code]" \
        --markdown-file design_doc \
        --diagram-num 1 \
        --title "api_sequence" \
        --json
  7. If validation fails → Apply troubleshooting fix → Retry
  8. On success → Add ![API Sequence](./diagrams/design_doc_01_sequence_api_sequence.png) to markdown

Unicode Semantic Symbols

Always use Unicode symbols to enhance diagram clarity. Common patterns:

Infrastructure & Deployment

Activity Flow with States

Microservices Architecture

For complete symbol reference, load: references/guides/unicode-symbols/guide.md

Python Utilities

Extract Mermaid Diagrams

bash
# List all diagrams
python scripts/extract_mermaid.py document.md --list-only

# Extract to separate files
python scripts/extract_mermaid.py document.md --output-dir diagrams/

# Validate all diagrams
python scripts/extract_mermaid.py document.md --validate

# Replace with image references (for Confluence upload)
python scripts/extract_mermaid.py document.md --replace-with-images \
  --image-format png --output-markdown output.md

Convert to Images

bash
# Single conversion
python scripts/mermaid_to_image.py diagram.mmd output.png

# With custom settings
python scripts/mermaid_to_image.py diagram.mmd output.svg \
  --theme dark --background white --width 1200

# Batch convert directory
python scripts/mermaid_to_image.py diagrams/ output/ --format png --recursive

# From stdin
echo "graph TD; A-->B" | python scripts/mermaid_to_image.py - output.png

Decision Tree Examples

Example 1: User Asks for Workflow Diagram

Input: "Show the checkout process workflow"

Skill Decision Path:

1. Analyze: workflow, process → ACTIVITY DIAGRAM
2. Load guide: guides/diagrams/activity-diagrams.md
3. Find pattern: E-commerce checkout (template exists in guide)
4. Generate using template + Unicode symbols
5. Output activity diagram with decision points

Output: Complete activity diagram with Unicode symbols for cart, payment, order states.

Example 2: User Provides Spring Boot Code

Input: "Here's my Spring Boot controller, create diagrams"

Skill Decision Path:

1. Analyze: Spring Boot, code provided → CODE-TO-DIAGRAM + SPRING BOOT
2. Load guides:
   - examples/spring-boot/README.md
   - guides/diagrams/architecture-diagrams.md (for structure)
   - guides/diagrams/sequence-diagrams.md (for method calls)
   - guides/diagrams/activity-diagrams.md (for business logic)
3. Generate multiple diagrams:
   a. Architecture diagram from @RestController/@Service/@Repository annotations
   b. Sequence diagram from method call chain
   c. Activity diagram from business logic flow
4. Output all diagrams with explanations

Output: 3-4 diagrams showing different views of the Spring Boot application.

Example 3: User Wants Infrastructure Documentation

Input: "Document my GCP Cloud Run deployment with AlloyDB"

Skill Decision Path:

1. Analyze: infrastructure, GCP, Cloud Run → DEPLOYMENT DIAGRAM
2. Load guides:
   - guides/diagrams/deployment-diagrams.md
   - examples/spring-boot/ or examples/fastapi/ (if code provided)
3. Check for IaC files (Pulumi, Terraform, docker-compose)
4. Generate deployment diagram with:
   - Cloud Run services with specs
   - VPC connector
   - AlloyDB cluster
   - Security (IAM, Secret Manager)
   - Monitoring
5. Apply Unicode symbols for clarity
6. Output with resource specifications

Output: Complete GCP deployment diagram with all resources labeled.

High-Contrast Styling

ALL diagrams MUST use high-contrast colors:

Rules:

  • Light background → Dark text color
  • Dark background → Light text color
  • Always specify color: in every classDef

File Organization

design-doc-mermaid/
├── SKILL.md                          # This file - Main orchestrator
├── README.md                         # User documentation
├── CLAUDE.md                         # Claude Code instructions
│
├── references/                       # Reference materials
│   ├── mermaid-diagram-guide.md     # Legacy general guide
│   └── guides/                       # Specialized guides (load on-demand)
│       ├── diagrams/
│       │   ├── activity-diagrams.md      # Workflows, processes
│       │   ├── deployment-diagrams.md    # Infrastructure, cloud
│       │   ├── architecture-diagrams.md  # System architecture
│       │   └── sequence-diagrams.md      # API interactions
│       ├── code-to-diagram/
│       │   └── README.md                 # Master guide for code analysis
│       ├── unicode-symbols/
│       │   └── guide.md                  # Complete symbol reference
│       └── troubleshooting.md        # Common syntax errors & fixes
│
├── assets/                           # Design document templates
│   ├── architecture-design-template.md
│   ├── api-design-template.md
│   ├── feature-design-template.md
│   ├── database-design-template.md
│   └── system-design-template.md
│
├── scripts/                          # Python utilities
│   ├── extract_mermaid.py           # Extract & validate diagrams
│   └── mermaid_to_image.py          # Convert to PNG/SVG
│
├── examples/                         # Language-specific patterns
│   ├── spring-boot/                 # Spring Boot patterns
│   ├── fastapi/                     # FastAPI patterns
│   ├── react/                       # React patterns
│   ├── python-etl/                  # Data pipeline patterns
│   ├── node-webapp/                 # Express.js patterns
│   └── java-webapp/                 # Traditional Java patterns
│
└── references/                       # General Mermaid reference
    └── mermaid-diagram-guide.md     # Complete Mermaid syntax guide

Workflow Summary

  1. Analyze user intent → Determine diagram type, document type, or action needed
  2. Load appropriate guide(s) → Read only what's needed (token efficient)
  3. Apply templates and patterns → Use examples from guides
  4. Generate output → Create diagram or document
  5. Validate (optional) → Use scripts to verify
  6. Convert (optional) → Export to images if needed

When to Use What

User RequestLoad This
"activity diagram", "workflow", "process flow"references/guides/diagrams/activity-diagrams.md
"deployment", "infrastructure", "cloud", "k8s"references/guides/diagrams/deployment-diagrams.md
"architecture", "system design", "components"references/guides/diagrams/architecture-diagrams.md + design template
"API", "sequence", "interactions", "flow"references/guides/diagrams/sequence-diagrams.md
"class diagram", "ER", "state machine", "wiki", "walkthrough", "architecture doc"references/guides/wiki-ticket-and-github.md plus the matching type guide
"Confluence", "upload image", "PNG", "SVG"scripts/resilient_diagram.py or scripts/mermaid_to_image.py
"Spring Boot code"examples/spring-boot/ + relevant diagram guides
"FastAPI code", "Python API"examples/fastapi/ + relevant diagram guides
"React app", "frontend"examples/react/ + architecture guide
"ETL", "data pipeline", "Python batch"examples/python-etl/ + activity guide
"symbols", "unicode", "emoji"references/guides/unicode-symbols/guide.md
"syntax error", "diagram won't render", "troubleshoot"references/guides/troubleshooting.md
"extract diagrams"scripts/extract_mermaid.py
"convert to image", "PNG", "SVG"scripts/mermaid_to_image.py
"create diagram", "generate diagram", "add diagram to markdown"scripts/resilient_diagram.py + references/guides/resilient-workflow.md
"design document", "full docs"assets/*-design-template.md + diagram guides

Best Practices

  1. Single Responsibility: One diagram = One concept
  2. Unicode Enhancement: Always use semantic symbols for clarity
  3. High Contrast: Never skip the color: property in styles
  4. Validate Early: Use scripts to catch syntax errors
  5. Template Reuse: Leverage existing templates and examples
  6. Load On-Demand: Only read guides needed for the specific request
  7. Token Efficiency: Use hierarchical loading instead of reading everything

Learning Path

New to Mermaid? Start here:

  1. Read references/guides/unicode-symbols/guide.md for symbol meanings
  2. Read references/guides/diagrams/activity-diagrams.md for basic patterns
  3. Try examples in examples/spring-boot/ or examples/fastapi/
  4. Use scripts/extract_mermaid.py --validate to check your work

Need to document code? Follow this:

  1. Identify your framework → Load relevant examples/{framework}/
  2. Match code pattern to diagram type
  3. Use templates from guide
  4. Validate with scripts

Creating design docs? Follow this:

  1. Choose document type → Load template from assets/
  2. Fill in text sections
  3. Load diagram guides as needed for each section
  4. Use Unicode symbols throughout
  5. Save to docs/design/ with timestamp

Version: 2.0 (Hierarchical Architecture) Last Updated: 2025-01-13 Maintained by: Claude Code Skills

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Design Doc Mermaid?

Create Mermaid diagrams (flowchart, sequence, class, ER, state, C4, architecture) from text or source code. Default for GitHub wiki. Use when asked to create a diagram, generate mermaid, document architecture, or convert code to diagram. PlantUML is only for leftover types. Confluence needs PNG/SVG as well as the fence.

Firwat Design Doc Mermaid op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Design Doc Mermaid besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Design Doc Mermaid an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/SpillwaveSolutions/design-doc-mermaid/tree/main an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Design Doc Mermaid benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Design Doc Mermaid benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Design Doc Mermaid domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Design Doc Mermaid gratis?

SpillwaveSolutions huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇