Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
wentorai avatar

Mermaid Diagram Guide

  • 2 installs
  • 269 repo stars
  • Updated June 19, 2026
  • wentorai/research-plugins

Create flowcharts, sequence diagrams, and architecture diagrams from text using Mermaid syntax for research documentation.

About

Covers the most useful Mermaid diagram types for academic work with syntax references and research-context examples. A developer uses it to add version-controllable diagrams to docs, READMEs, and papers.

  • Provides templates for flowcharts, sequence, class, and Gantt diagrams
  • Emphasizes version-controllable, text-based diagrams that render in GitHub/Notion

Mermaid Diagram Guide by the numbers

  • 2 all-time installs (skills.sh)
  • Ranked #1,294 of 1,879 Documentation skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/wentorai/research-plugins --skill mermaid-diagram-guide

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2
repo stars269
Last updatedJune 19, 2026
Repositorywentorai/research-plugins

What it does

Create flowcharts, sequence diagrams, and architecture diagrams from text using Mermaid syntax for research documentation.

Files

SKILL.mdMarkdownGitHub ↗

Mermaid Diagram Guide

Overview

Mermaid is a text-based diagramming tool that renders diagrams from Markdown-like syntax. For researchers, Mermaid offers a unique combination of version-controllable source code, instant rendering in documentation platforms (GitHub, GitLab, Notion, Obsidian), and enough expressiveness to create flowcharts, sequence diagrams, class diagrams, Gantt charts, and more.

Unlike graphical tools like draw.io or Lucidchart, Mermaid diagrams live as plain text in your documentation, making them easy to maintain alongside code and papers. They are especially valuable for research documentation, README files, software architecture diagrams in methods sections, and graphical abstracts.

This guide covers the most useful Mermaid diagram types for academic work, with complete syntax references and real-world examples from research contexts. Each diagram type includes a template you can copy and modify for your specific needs.

Flowcharts

Flowcharts are the most common diagram type for describing algorithms, experimental procedures, and data processing pipelines.

Basic Syntax

flowchart TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Process A]
    B -->|No| D[Process B]
    C --> E[End]
    D --> E

Node Shapes

ShapeSyntaxUse Case
RectangleA[text]Process step
RoundedA(text)Start/end
DiamondA{text}Decision
HexagonA{{text}}Preparation
ParallelogramA[/text/]Input/output
CircleA((text))Connector
StadiumA([text])Terminal

Research Pipeline Example

flowchart TD
    subgraph Data Collection
        A[Raw Data] --> B[Quality Check]
        B --> C{Pass QC?}
        C -->|No| D[Exclude]
        C -->|Yes| E[Clean Data]
    end

    subgraph Analysis
        E --> F[Feature Extraction]
        F --> G[Model Training]
        G --> H[Cross-Validation]
    end

    subgraph Evaluation
        H --> I{Significant?}
        I -->|Yes| J[Report Results]
        I -->|No| K[Revise Hypothesis]
        K --> F
    end

    style A fill:#3B82F6,color:#fff
    style J fill:#16A34A,color:#fff
    style D fill:#EF4444,color:#fff

Direction Options

DirectionCodeDescription
Top to bottomTD or TBDefault, vertical
Bottom to topBTVertical, upward
Left to rightLRHorizontal
Right to leftRLHorizontal, reversed

Sequence Diagrams

Sequence diagrams show interactions between components over time. They are ideal for describing API calls, protocol steps, and system interactions.

sequenceDiagram
    participant U as User
    participant F as Frontend
    participant A as API Server
    participant DB as Database

    U->>F: Submit experiment
    F->>A: POST /experiments
    A->>DB: INSERT experiment
    DB-->>A: experiment_id
    A->>A: Queue processing job

    Note over A: Async processing begins

    A-->>F: 202 Accepted {id}
    F-->>U: "Experiment submitted"

    loop Every 5 seconds
        F->>A: GET /experiments/{id}/status
        A-->>F: {status: "running"}
    end

    A-->>F: {status: "complete", results: {...}}
    F-->>U: Display results

Arrow Types

ArrowSyntaxMeaning
Solid with arrowhead->>Synchronous call
Dotted with arrowhead-->>Response/return
Solid->Message
Dotted-->Optional message
Cross-xFailed message

Class Diagrams

Class diagrams document code architecture and data models:

classDiagram
    class Experiment {
        +String id
        +String name
        +DateTime created_at
        +Status status
        +run()
        +get_results() Results
    }

    class Dataset {
        +String path
        +int n_samples
        +int n_features
        +load() DataFrame
        +split(ratio) TrainTest
    }

    class Model {
        +String architecture
        +Dict hyperparams
        +train(Dataset)
        +predict(Dataset) Array
        +evaluate(Dataset) Metrics
    }

    Experiment "1" --> "1..*" Dataset : uses
    Experiment "1" --> "1..*" Model : trains
    Model ..> Dataset : depends on

Gantt Charts

Gantt charts are useful for project timelines and research plans:

gantt
    title Research Project Timeline
    dateFormat YYYY-MM-DD
    axisFormat %b %Y

    section Literature Review
        Survey existing work     :done, lit1, 2026-01-01, 30d
        Identify research gap    :done, lit2, after lit1, 14d

    section Methodology
        Design experiments       :active, meth1, after lit2, 21d
        Implement baseline       :meth2, after meth1, 14d

    section Experiments
        Run baseline experiments :exp1, after meth2, 21d
        Run proposed method      :exp2, after exp1, 21d
        Ablation studies         :exp3, after exp2, 14d

    section Writing
        Draft paper              :write1, after exp2, 30d
        Internal review          :write2, after write1, 14d
        Submit to conference     :milestone, after write2, 0d

State Diagrams

State diagrams model entity lifecycles:

stateDiagram-v2
    [*] --> Draft
    Draft --> UnderReview : Submit
    UnderReview --> MinorRevision : Reviewer feedback
    UnderReview --> MajorRevision : Reviewer feedback
    UnderReview --> Rejected : Reviewer feedback
    MinorRevision --> UnderReview : Resubmit
    MajorRevision --> UnderReview : Resubmit
    UnderReview --> Accepted : Final decision
    Accepted --> Published : Camera-ready
    Rejected --> Draft : Revise for new venue
    Published --> [*]

Rendering and Integration

GitHub / GitLab

Both platforms render Mermaid natively in Markdown files:

````markdown

flowchart LR
    A --> B --> C

````

Command-Line Rendering

# Install Mermaid CLI
npm install -g @mermaid-js/mermaid-cli

# Render to PNG
mmdc -i diagram.mmd -o diagram.png -w 1200

# Render to SVG (preferred for papers)
mmdc -i diagram.mmd -o diagram.svg

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

Embedding in LaTeX

% Include the SVG generated by mmdc
\usepackage{svg}
\begin{figure}[h]
  \centering
  \includesvg[width=0.8\textwidth]{diagram}
  \caption{System architecture overview.}
\end{figure}

Best Practices

  • Keep diagrams focused. One concept per diagram. If it exceeds 15-20 nodes, split it.
  • Use subgraphs for grouping. They clarify which components belong together.
  • Label all edges. Unlabeled arrows are ambiguous.
  • Use consistent styling. Define colors for success (green), failure (red), and process (blue) states.
  • Export as SVG for papers. SVG scales perfectly and produces crisp output at any size.
  • Version-control your diagrams. Since Mermaid is text, it diffs cleanly in Git.
  • Test in the live editor. Use mermaid.live to iterate quickly before committing.

References

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.