Skip to content
Agentmart
Submit a tool

mermaid-syntax

Correct Mermaid diagram syntax reference covering all types (flowchart, sequence, class, ERD, state, C4, git, gantt, pie).

Skill by hugobatista

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/hugobatista-mermaid-syntax

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Correct Mermaid diagram syntax reference covering all types (flowchart, sequence, class, ERD, state, C4, git, gantt, pie). Emphasizes parser-compatible patterns to avoid rendering errors in GitHub, Obsidian, VS Code, and other tools. Use when creating, visualizing, or documenting software architecture through diagrams.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/mermaid-syntax

What's inside

Skill name
mermaid-syntax
Description
Correct Mermaid diagram syntax reference covering all types (flowchart, sequence, class, ERD, state, C4, git, gantt, pie). Emphasizes parser-compatible patterns to avoid rendering errors in GitHub, Obsidian, VS Code, and other tools. Use when creating, visualizing, or documenting software architecture through diagrams.
License
MIT
Instructions
321 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Mermaid Syntax Reference

## Syntax Compatibility Rules

These 5 rules prevent parser errors across common rendering tools (GitHub, Obsidian, VS Code extensions):

1. **Subgraphs**: use `subgraph "Title"` — NOT `subgraph ID["Title"]` (named subgraphs require mermaid ≥10.3)
2. **Diamond nodes**: always give an explicit ID — `DECISION{"text"}` — NOT anonymous `{"text"}` after `-->`
3. **Line breaks**: `\n` works inside `["text"]`; avoid `\n` inside `{"text"}` — keep diamond labels single-line
4. **Sequence notes**: plain text only — no `<br/>`, `<br>`, or other HTML tags
5. **Special characters**: replace `&` with `and` to avoid HTML entity issues

## Core Syntax

Every diagram starts with a type declaration on the first line:

```mermaid
flowchart LR
sequenceDiagram
classDiagram
erDiagram
stateDiagram-v2
gitGraph
gantt
pie
```

Use `%%` for comments. Indentation improves readability but isn't required.

## Flowchart

### Node shapes

| Syntax | Shape |
|---|---|
| `A[text]` | Rectangle |
| `A(text)` | Rounded rectangle |
| `A([text])` | Stadium / pill |
| `A[[text]]` | Subroutine |
| `A[(text)]` | Database / cylinder |
| `A((text))` | Circle |
| `A{text}` | Rhombus / decision |
| `A{{text}}` | Hexagon |
| `A>text]` | Asymmetric / flag |
| `A[/text/]` | Parallelogram |
| `A[\text\]` | Parallelogram (reverse) |
| `A[/text\]` | Trapezoid |

### Edges

| Syntax | Type |
|---|---|
| `A --> B` | Arrow |
| `A --- B` | Link (no arrow) |
| `A -.-> B` | Dotted arrow |
| `A ==> B` | Thick arrow |
| `A -->\|label\| B` | Labeled arrow (preferred) |
| `A -- label --> B` | Labeled arrow (alt) |

### Subgraphs

Always use quoted titles:

```mermaid
flowchart LR
    subgraph "Group Name"
        A --> B
    end
```

### Example

```mermaid
flowchart TD
    Start([Start]) --> Auth{Authenticated?}
    Auth -->|Yes| Dashboard[Show dashboard]
    Auth -->|No| Login[Show login form]
    Login --> Auth
```

## Sequence Diagram

### Participants

```mermaid
sequenceDiagram
    participant A
    participant B as "Display Name"
    actor User
```

### Messages

| Syntax | Type |
|---|---|
| `->>` | Synchronous call |
| `-->>` | Synchronous response |
| `-)` | Asynchronous call |
| `--)` | Asynchronous response |
| `-x` | Delete / loss |

### Structure blocks

```mermaid
sequenceDiagram
    participant A
    participant B

    alt Condition
        A->>B: branch
    else Other
        A->>B: other branch
    end

    opt Optional
        A->>B: optional
    end

    loop Every N seconds

From hugobatista/agent-skills, MIT.

More from hugobatista/agent-skills

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Sep 20, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from hugobatista

Cite this page

mermaid-syntax skill. Agent Mart. https://agentmart.dev/skills/hugobatista-mermaid-syntax (last updated 2026-10-24)