agentleFS
kaynetikkaynetik/skills/mermaid-diagrams/SKILL.md

mermaid-diagrams

Skill1 starsChanged 8 months agoMITView on GitHub

Generate professional, clean, and precise Mermaid diagrams from natural language or technical descriptions. Supports all Mermaid diagram types with proper theming, styling, and layout. Optionally converts output to Excalidraw format. Use when asked to diagram, visualize, chart, draw, map, or illustrate systems, flows, sequences, architectures, relationships, or data structures. Keywords: diagram, flowchart, sequence, class diagram, ER diagram, gitgraph, architecture, mind map, mermaid, excalidraw, visualize, draw, chart.

64 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use analytics-metrics, aws-account-management and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • hoodiniSkill

    analytics-metrics

    Build data visualization and analytics dashboards. Use when creating charts, KPI displays, metrics dashboards, or data visualization components. Triggers on analytics, dashboard, charts, metrics, KPI, data visualization, Recharts.

    Also in 3 projects that use this

  • hoodiniSkill

    aws-account-management

    Manage AWS accounts, organizations, IAM, and billing. Use when setting up AWS Organizations, managing IAM policies, controlling costs, or implementing multi-account strategies. Triggers on AWS Organizations, AWS IAM, AWS billing, Cost Explorer, SCPs, multi-account, AWS SSO, Identity Center.

    Also in 3 projects that use this

  • LangChainSkill

    langchain

    Build agents with a prebuilt architecture and integrations for any model or tool. Use when creating tool-calling agents, switching model providers, or adding structured output.

    Also in 3 projects that use this

  • imehrSkill

    railway

    Railway.com deployment and management - deployment, logs, migrations, troubleshooting, monorepo strategies, security, and CLI reference. Use when deploying to Railway, configuring services, managing environment variables, or debugging deployment issues.

    Also in 3 projects that use this

  • +8 more from hoodini

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 60 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the user requests Excalidraw, follow the Excalidraw Export section

    line 16
  2. Distinctive:

    Every diagram must open with a YAML config block:

    line 20
  3. Very specific:

    Use look: handDrawn only if the user explicitly requests a sketch style.

    line 32
  4. Very specific:

    Direction matters: - use LR for pipelines/flows, TD for hierarchies

    line 37
  5. Distinctive:

    Group with subgraphs: when there are more than 6 nodes in a cluster

    line 39
  6. Distinctive:

    Never use raw IDs as labels: - every visible node needs a human-readable label

    line 41
  7. Distinctive:

    Before delivering a diagram:

    line 77
  8. Distinctive:

    If the user asks to convert to Excalidraw (keywords: "excalidraw", "export to excalidraw", "make it editable"):

    line 87
  9. Distinctive:

    When exporting, always provide the raw Mermaid source as well so the user retains the editable canonical form.

    line 109

“Common” is measured: kept by at least 6 in 10 of the 60 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mermaid Diagrams

Generate clean, professional Mermaid diagrams. Prioritize clarity and precision over decoration.

Workflow

  1. Identify the diagram type (see reference.md)
  2. Extract entities, relationships, and flow from the description
  3. Generate Mermaid source with proper config frontmatter
  4. Render inline in a fenced code block (```mermaid)
  5. If the user requests Excalidraw, follow the Excalidraw Export section

Config Frontmatter (always include)

Every diagram must open with a YAML config block:

---
config:
  theme: neutral
  look: classic
---

Theme options: neutral (default, professional), default, dark, forest, base

Use look: handDrawn only if the user explicitly requests a sketch style.

Core Principles

  • One concept per node - split complex labels across lines with <br/>
  • Direction matters - use LR for pipelines/flows, TD for hierarchies
  • Label every edge that carries semantic meaning
  • Group with subgraphs when there are more than 6 nodes in a cluster
  • Avoid crossing edges - reorder nodes to minimize visual clutter
  • Never use raw IDs as labels - every visible node needs a human-readable label

Styling

Apply styles sparingly for semantic emphasis only (not decoration):

classDef primary fill:#4A90D9,stroke:#2C5F8A,color:#fff
classDef secondary fill:#F5F5F5,stroke:#999,color:#333
classDef warning fill:#E8A838,stroke:#B07820,color:#fff
classDef danger fill:#D94A4A,stroke:#8A2C2C,color:#fff
classDef success fill:#4AAD6A,stroke:#2C7A45,color:#fff

Assign with class NodeA,NodeB primary.

For linkStyle, prefer: linkStyle 0 stroke:#4A90D9,stroke-width:2px

Diagram Type Selection

IntentType
Steps, pipelines, decisionsflowchart
Time-ordered interactionssequenceDiagram
OOP / data modelsclassDiagram
Database schemaerDiagram
Git branchinggitGraph
Schedule / timelinegantt
Concept hierarchy / brainstormmindmap
States and transitionsstateDiagram-v2
Component/system topologyC4Context or flowchart with subgraphs

For detailed syntax of each type, see reference.md.

Quality Checklist

Before delivering a diagram:

  • Config frontmatter present with theme: neutral
  • All nodes have readable labels (not raw IDs)
  • Edge labels present where semantically meaningful
  • No more than ~12 top-level nodes (split into subgraphs if needed)
  • Direction chosen intentionally (LR vs TD)
  • Fenced in ```mermaid block

Excalidraw Export

If the user asks to convert to Excalidraw (keywords: "excalidraw", "export to excalidraw", "make it editable"):

Option A - Browser (recommended, no dependencies):

  1. Go to excalidraw.com
  2. Open the hamburger menu → "Mermaid to Excalidraw"
  3. Paste the Mermaid source → click "Insert"

Option B - CLI with @excalidraw/mermaid-to-excalidraw:

npx @excalidraw/mermaid-to-excalidraw --input diagram.mmd --output diagram.excalidraw

Option C - Programmatic (Node.js):

import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw";
const { elements, files } = await parseMermaidToExcalidraw(mermaidSyntax);

Supported types for conversion: flowchart, sequenceDiagram, classDiagram, stateDiagram, erDiagram, gantt, gitGraph, C4Context

Not supported: mindmap, timeline, requirementDiagram - offer a flowchart equivalent if needed.

When exporting, always provide the raw Mermaid source as well so the user retains the editable canonical form.

Examples

Minimal flowchart

---
config:
  theme: neutral
---
flowchart LR
    A[Client] -->|HTTPS| B[Load Balancer]
    B --> C[App Server 1]
    B --> D[App Server 2]
    C & D -->|SQL| E[(Database)]

Sequence with activation

---
config:
  theme: neutral
---
sequenceDiagram
    actor User
    participant API
    participant Auth
    participant DB

    User->>+API: POST /login
    API->>+Auth: validate(credentials)
    Auth->>+DB: query user
    DB-->>-Auth: user record
    Auth-->>-API: JWT token
    API-->>-User: 200 OK + token

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.