Logo: Mermaid Skill

Mermaid Skill

Communautéit
Agents365-ai
mermaid-skill

Erstellt Mermaid-Diagrammer (.mmd) an exportéiert se iwwer d'mmdc-CLI oder d'Kroki-API als PNG/SVG/PDF. DËSE SKILL BENOTZEN, wann de Benotzer Diagramm, Flossdiagramm, Sequenzdiagramm, Klassendiagramm, ER-Diagramm, State Machine, Architektur, Visualiséierung, Git-Graph, 画图, 架构图, 流程图, 时序图, 类图, ER图, 甘特图 oder 状态机 ernimmt. PROAKTIV BENOTZEN, wann Dir e SYSTEM mat 3 oder méi Komponente, API-Flëss, Authentifizéierungssequenzen, Klassenehierarchien, Datebankschemaen oder State Machines erkläert. Ënnerstëtzt méi wéi 17 Diagrammtypen mat komplett automateschem Layout.

Add to TypingMind

Iwwersiicht

EditeurAgents365-ai
Repository365-skills
Skill-Nummmermaid-skill
Stären
99
Forks
16
Matgeliwwert Dateien
10
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.

  • 10 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

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

Installatioun

Installéiert de KI-Skill Mermaid Skill 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/Agents365-ai/365-skills/tree/main/plugins/mermaid/skills/mermaid-skill
  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/Agents365-ai/365-skills.git /tmp/365-skills
mkdir -p .claude/skills
cp -r /tmp/365-skills/plugins/mermaid/skills/mermaid-skill .claude/skills/mermaid-skill
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Mermaid Skill 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 Mermaid Skill automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Mermaid Skill 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 Diagrams

Generate .mmd text files and export to PNG/SVG/PDF using mmdc (local) or Kroki API (no install).

Key advantage: Text-based syntax with fully automatic layout — no x/y coordinates needed.

When to use / when NOT to use

Use this skill for: diagrams-as-code with automatic layout (flowchart, sequence, class, state, ER, gantt, mindmap, architecture) — text source that lives in git and embeds in Markdown.

Do NOT use it — route elsewhere — for:

  • Pixel-precise placement, custom layout, branded icons, or heavy styling → drawio.
  • A hand-drawn / sketchy aesthetic → excalidraw or tldraw.
  • A freeform whiteboard or freehand strokes → tldraw.
  • Strict, conventional UML notation → plantuml.

Prerequisites

Option A: Local (mmdc) — also needs a headless Chrome (mmdc renders via Puppeteer)

bash
npm install -g @mermaid-js/mermaid-cli
npx puppeteer browsers install chrome-headless-shell   # required — mmdc has no bundled browser
mmdc --version

mmdc --version succeeds even with no Chrome installed, but every export then fails with Could not find Chrome. Install the browser above (or set PUPPETEER_EXECUTABLE_PATH to a system Chrome). If you can't, use Kroki (Option B) — it needs no browser.

CI / Docker: mmdc crashes with Running as root without --no-sandbox in containers. Pass the bundled puppeteer config (see scripts/puppeteer-config.json):

bash
mmdc -p scripts/puppeteer-config.json -i diagram.mmd -o diagram.png

Option B: Kroki API (no install)

bash
curl --version  # Just need curl

Workflow

  1. Check deps — validate via Kroki (needs only curl); check mmdc --version and a headless Chrome only when local export (PNG quality / PDF) is wanted
  2. Pick diagram type — choose from table below
  3. Generate — write .mmd file to disk
  4. Validate — Kroki-first (see Validation; REQUIRED before export)
  5. Export — use mmdc or Kroki API to produce PNG/SVG/PDF
  6. Self-check (vision) — read the exported PNG and fix readability/layout defects that automatic layout can't prevent (clipped labels, cramped density, wrong orientation), then re-validate + re-export. Max 2 rounds; skip if no vision. See Self-Check (vision) below.
  7. Review loop — show the image to the user, apply the minimal .mmd edit per request, re-export until approved (5-round safety valve). See Review Loop below.
  8. Report — tell user the output file paths

Validation (Required)

NEVER export a diagram without validating first.

Prefer Kroki for validation — it needs no browser and sidesteps the Could not find Chrome trap entirely. Use mmdc for validation only when offline.

bash
# Validate with Kroki (preferred — no browser needed)
curl -s -X POST -H "Content-Type: text/plain" --data-binary @diagram.mmd https://kroki.io/mermaid/svg -o /tmp/test.svg && echo "Valid" || echo "Invalid"

# Validate with mmdc (offline fallback — requires headless Chrome)
mmdc -i diagram.mmd -o /tmp/test.svg 2>&1

# If error, fix the .mmd file and validate again
# Only proceed to export after validation passes

Common validation errors:

  • Missing quotes around labels with special characters
  • Wrong arrow syntax (use ->> for sequence, --> for flowchart)
  • Undeclared participants in sequence diagrams

A Could not find Chrome (or puppeteer) error from mmdc is a setup problem, not a diagram error — the .mmd may be perfectly valid. Validate via Kroki instead of "fixing" correct syntax.

Self-Check (vision)

Zero-cost pre-check: before spending a vision call, read the PNG dimensions (sips -g pixelWidth -g pixelHeight diagram.png on macOS, file diagram.png elsewhere). An extreme aspect ratio (longer side > 8x the shorter) is a "wrong orientation" defect — fix it without vision.

Validation (above) only proves the syntax is legal — it says nothing about whether the rendered diagram is readable. After exporting, use the agent's vision capability to read the PNG and catch what automatic layout can't prevent. Mermaid positions everything itself, so the failures here are about content and readability, not overlaps:

CheckWhat to look forFix
Label truncationNode / edge text clipped or cut offShorten the label, or wrap it with <br/>
Cramped, unreadable densityToo many nodes crammed together; tangled linesFlip direction (TD↔LR), split into subgraphs, or reduce nodes
Wrong orientation / aspectDiagram far too wide or too tall to readChange flowchart TD↔LR (or set direction in class/state)
Edge spaghettiMany edges crossing, hard to followReorder node declarations so connected nodes sit adjacent; group with subgraph
Wrong diagram typeType doesn't suit the content (e.g. flowchart for a timeline)Switch type (gantt, sequenceDiagram, stateDiagram-v2, …)
Low contrastText blends into the node fillAdjust classDef / theme so text contrasts the fill
  • Max 2 self-check rounds — if issues remain after 2 fixes, show the user anyway.
  • Re-validate (syntax) and re-export after every fix.
  • If vision is unavailable, skip self-check and show the PNG directly.

Review Loop

After self-check, show the exported image and collect feedback. Apply the minimal .mmd edit for each request, then re-validate and re-export:

User requestEdit action
Change a labelEdit the node / edge text in the .mmd
Add / remove a node or edgeAdd or delete the matching line
Change a colorAdd / adjust a classDef and class <node> <className>
Change layout directionSwap TD↔LR (flowchart) or set direction (class / state)
Restructure / groupWrap related nodes in a subgraph, or regenerate
  • Overwrite the same diagram.mmd / diagram.png each round — don't create v1, v2, …
  • Safety valve: after 5 rounds, generate a mermaid.live handoff link (see next section) so the user fine-tunes the current diagram in the browser.

Mermaid.live Handoff

When the review loop ends (approved or safety-valve), generate a one-click link that opens the current .mmd in the mermaid.live editor for interactive fine-tuning:

bash
python3 scripts/mermaid_live_link.py diagram.mmd
# -> https://mermaid.live/edit#pako:...

Pure zlib + base64 (raw-deflate + URL-safe base64, same encoding mermaid.live uses), works offline. The script self-verifies with a round-trip decode before printing.

Batch Mode (Repo Survey)

When the user asks to diagram a whole repo ("survey this codebase", "map the architecture"):

  1. Scan — locate schemas (SQL / ORM models), API routes, and state machines / lifecycle enums in the codebase
  2. Propose — one diagram per finding: ER for the schema, sequence for a main API flow, state for a lifecycle, flowchart for overall service layout; confirm the set with the user before generating
  3. Generate + export — run the standard workflow per diagram into one output folder
  4. Overview page — inline every exported SVG into a single self-contained index.html (title + one section per diagram, no CDN), so the user opens one file

Same validation and self-check rules apply to every diagram in the batch.

Diagram Types

TypeKeywordUse for
Flowchartflowchart TD/LRprocesses, pipelines, decisions
SequencesequenceDiagramAPI calls, message passing
ClassclassDiagramOOP models, data structures
ERerDiagramdatabase schemas
StatestateDiagram-v2state machines, lifecycle
Ganttganttproject timelines
Piepieproportions
Git GraphgitGraphbranch strategies
C4 ContextC4Contexthigh-level system context
Architecturearchitecture-betacloud / CI/CD service layouts
Mind Mapmindmaptopic breakdowns
User Journeyjourneyuser-experience flows
Use Caseusecase-betaactor–system interactions (UML)
Cynefincynefin-betasense-making / complexity domains
Event Modelingeventmodelingevent-driven system timelines
Tree ViewtreeView-betafile / directory hierarchies
Wardley Mapswardley-betabusiness strategy / value chains

Syntax Reference

Flowchart: See reference/FLOWCHART.md Sequence: See reference/SEQUENCE.md Class & ER: See reference/CLASS-ER.md Architecture: See reference/ARCHITECTURE.md Use Case: See reference/USECASE.md Other types: See reference/OTHER-TYPES.md Themes & styling: See reference/THEMES.md

Examples

See reference/EXAMPLES.md for four worked examples (JWT auth sequence, microservices architecture, order state machine, cloud architecture) — each with the user prompt, the generated .mmd, and the output files.

Export Commands

Option 1: Local Export (mmdc)

Requires mmdc installed locally. Best for offline use.

bash
# PNG (recommended: 2048px wide, white background)
mmdc -i diagram.mmd -o diagram.png -w 2048 --backgroundColor white

# PNG with theme — valid -t values: default | dark | neutral | forest
# (`base` is NOT a valid -t value; it only works inside a %%{init: {'theme':'base'}}%% directive)
mmdc -i diagram.mmd -o diagram.png -w 2048 --backgroundColor white --theme neutral

# SVG
mmdc -i diagram.mmd -o diagram.svg

# PDF
mmdc -i diagram.mmd -o diagram.pdf

Option 2: Kroki API (No Install Required)

Use Kroki when mmdc is not available. No local dependencies needed.

bash
# SVG via Kroki
curl -X POST -H "Content-Type: text/plain" --data-binary @diagram.mmd https://kroki.io/mermaid/svg -o diagram.svg

# PNG via Kroki
curl -X POST -H "Content-Type: text/plain" --data-binary @diagram.mmd https://kroki.io/mermaid/png -o diagram.png

# PDF is NOT supported by Kroki for Mermaid — POSTing to /mermaid/pdf returns
# HTTP 400 ("Unsupported output format: pdf for mermaid. Must be one of png or svg").
# For PDF, use the local mmdc path instead:  mmdc -i diagram.mmd -o diagram.pdf

Kroki advantages:

  • No local installation required
  • Works on any system with curl
  • Supports 20+ diagram types (PlantUML, GraphViz, D2, etc.)

When to use Kroki:

  • mmdc installation fails
  • Quick one-off diagrams
  • CI/CD pipelines without Node.js

Common Mistakes

MistakeFix
mmdc not foundnpm install -g @mermaid-js/mermaid-cli
mmdc error Could not find ChromeInstall the headless browser: npx puppeteer browsers install chrome-headless-shell (or use Kroki)
Kroki PDF fails with HTTP 400Kroki does PNG/SVG only for Mermaid; use local mmdc for PDF
Valid diagram reported "invalid" by mmdcThe error is a Chrome/puppeteer setup failure, not a syntax error — don't rewrite correct .mmd; fix the browser or validate via Kroki
Wrong arrow in sequenceUse ->> for request, -->> for response
Special chars in labelWrap in quotes: A["Label: value"]
Blank/small outputAdd -w 2048 flag
Participant order wrongDeclare participant explicitly at top
Subgraph name with spacesWrap in quotes: subgraph "My Layer"

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 Mermaid Skill?

Erstellt Mermaid-Diagrammer (.mmd) an exportéiert se iwwer d'mmdc-CLI oder d'Kroki-API als PNG/SVG/PDF. DËSE SKILL BENOTZEN, wann de Benotzer Diagramm, Flossdiagramm, Sequenzdiagramm, Klassendiagramm, ER-Diagramm, State Machine, Architektur, Visualiséierung, Git-Graph, 画图, 架构图, 流程图, 时序图, 类图, ER图, 甘特图 oder 状态机 ernimmt. PROAKTIV BENOTZEN, wann Dir e SYSTEM mat 3 oder méi Komponente, API-Flëss, Authentifizéierungssequenzen, Klassenehierarchien, Datebankschemaen oder State Machines erkläert. Ënnerstëtzt méi wéi 17 Diagrammtypen mat komplett automateschem Layout.

Firwat Mermaid Skill op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Mermaid Skill 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 Mermaid Skill an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/Agents365-ai/365-skills/tree/main/plugins/mermaid/skills/mermaid-skill 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 Mermaid Skill 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 Mermaid Skill benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Mermaid Skill 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 Mermaid Skill gratis?

Agents365-ai 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 👇