SponsoredSkillry: Agent Skills with taste. Designed and tested in-house, so one prompt gives you polished slides, web pages and launch videos.Skillry: Agent Skills with taste Try free Skills
Agent Skills
  • Skills
  • Picks
  • ShopSoon
  • Solutions
  • Specification
  • Submit
Agent Skills
Agent Skills

Discover and share powerful Agent Skills for AI assistants

GitHubX (Twitter)
Skills
  • View All
  • Install Guide
  • Documentation
  • Solutions
  • Product Launch Video
  • Submit
Tools
  • Claude Code
  • Cursor
  • OpenCode
  • Codex CLI
  • Gemini CLI
Resources
  • anthropics/skills
  • awesome-claude-skills
  • vercel-labs/agent-skills
  • kepano/obsidian-skills
Company
  • About
  • Blog
  • Authors
  • Changelog
  • Privacy Policy
  • Terms of Service

Sponsored by Vectrust @ OpenDev Org & NextRouter Alliance

© 2026 EvergreenAI. Built with JimmyLv
mermaid-diagrams - Agent Skill - Agent Skills
Home/Skills/mermaid-diagrams

mermaid-diagrams

109

Comprehensive guide for creating software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams (domain modeling, object-oriented design), sequence diagrams (application flows, API interactions, code execution), flowcharts (processes, algorithms, user journeys), entity relationship diagrams (database schemas), C4 architecture diagrams (system context, containers, components), state diagrams, git graphs, pie charts, gantt charts, or any other diagram type. Triggers include requests to "diagram", "visualize", "model", "map out", "show the flow", or when explaining system architecture, database design, code structure, or user/application flows.

Download FolderView on GitHub

CLI Install

Recommended

Use the skills CLI to install this skill with one command. Auto-detects all installed AI assistants.

Method 1 - skills CLI

npx skills i softaworks/agent-toolkit/skills/mermaid-diagrams

Method 2 - openskills (supports sync & update)

npx openskills install softaworks/agent-toolkit

Auto-detects Claude Code, Cursor, Codex CLI, Gemini CLI, and more. One install, works everywhere.

Installation Path

Download and extract to one of the following locations:

~/.claude/skills/mermaid-diagrams/
SKILL.md

Skill Instructions

Back

Run with Cloud Agent

No setup needed. Let our cloud agents run this skill for you.

Select Provider

Select Model

ClaudeClaude Sonnet 5.5
$0.20/task

Best for coding tasks

Join Cloud Agent Waitlist

No setup required

Before you install

Read from this skill's files on GitHub on 2026-11-09. These are facts about the files, not a review of how well the skill works.

Files
9 files, 0 scripts, SKILL.md is 811 words
Needs on your machine
Node.js, Docker, Mermaid CLI
Web addresses in its scripts
No URLs in its scripts
Worth a look before running
No sudo, rm -rf, curl | sh or shell=True in its scripts
Agent Skills spec
name and description present, name matches the folder
Last upstream change
2026-02-01

We ran this skill ourselves. Here is what went in and what came out.

Field noteRan on 2026-11-04

How we test skills

Input

Question: what happens when someone opens a skill page on this site? Constraint from the skill: one flowchart, flowchart TD, a decision node, no curly braces inside comments. I had already read the page loader in src/data/skill.ts.

Output

flowchart TD
    Open([Open /skill/slug]) --> Sanity[Load the skill list from Sanity]
    Sanity --> Listed{Slug in the list?}
    Listed -->|No| Missing[404]
    Listed -->|Yes| Raw[Fetch SKILL.md from GitHub]
    Raw --> Found{File fetched?}
    Found -->|No| Missing
    Found -->|Yes| Render[Render the markdown]

What happened

The diagram matches the code path: getSkillBySlug loads every skill from Sanity, finds the slug, then fetches that one file from GitHub, and returns null if GitHub does not answer. mmdc is not installed here, so nothing rendered it to PNG. The skill lists the CLI as an export option, not as a required step. I checked the text against the skill's flowchart example (TD, decision labels, stadium start) and stopped there.

Use it when

A single process you can point at, stored next to the code, when a PNG is optional.

Skip it when

A picture you must hand to someone who will not read the source. Without a renderer you only have text. Also a poor fit when the picture is a slide.

Where this skill sits

  • Architecture diagrams in git

    Second, when the picture should live next to the code. Flowcharts, sequences, and ERDs. One diagram per question.

Mermaid Diagramming

Create professional software diagrams using Mermaid's text-based syntax. Mermaid renders diagrams from simple text definitions, making diagrams version-controllable, easy to update, and maintainable alongside code.

Core Syntax Structure

All Mermaid diagrams follow this pattern:

diagramType
  definition content

Key principles:

  • First line declares diagram type (e.g., classDiagram, sequenceDiagram, flowchart)
  • Use %% for comments
  • Line breaks and indentation improve readability but aren't required
  • Unknown words break diagrams; parameters fail silently
Diagram Type Selection Guide

Choose the right diagram type:

  1. Class Diagrams - Domain modeling, OOP design, entity relationships

    • Domain-driven design documentation
    • Object-oriented class structures
    • Entity relationships and dependencies
  2. Sequence Diagrams - Temporal interactions, message flows

    • API request/response flows
    • User authentication flows
    • System component interactions
    • Method call sequences
  3. Flowcharts - Processes, algorithms, decision trees

    • User journeys and workflows
    • Business processes
    • Algorithm logic
    • Deployment pipelines
  4. Entity Relationship Diagrams (ERD) - Database schemas

    • Table relationships
    • Data modeling
    • Schema design
  5. C4 Diagrams - Software architecture at multiple levels

    • System Context (systems and users)
    • Container (applications, databases, services)
    • Component (internal structure)
    • Code (class/interface level)
  6. State Diagrams - State machines, lifecycle states

  7. Git Graphs - Version control branching strategies

  8. Gantt Charts - Project timelines, scheduling

  9. Pie/Bar Charts - Data visualization

Quick Start Examples
Class Diagram (Domain Model)
classDiagram
    Title -- Genre
    Title *-- Season
    Title *-- Review
    User --> Review : creates
 
    class Title {
        +string name
        +int releaseYear
        +play()
    }
 
    class Genre


Sequence Diagram (API Flow)
sequenceDiagram
    participant User
    participant API
    participant Database
 
    User->>API: POST /login
    API->>Database: Query credentials
    Database-->>API: Return user data
    alt Valid credentials
        API-->>User:


Flowchart (User Journey)
flowchart TD
    Start([User visits site]) --> Auth{Authenticated?}
    Auth -->|No| Login[Show login page]
    Auth -->|Yes| Dashboard[Show dashboard]
    Login --> Creds[Enter credentials



ERD (Database Schema)
erDiagram
    USER ||--o{ ORDER : places
    ORDER ||--|{ LINE_ITEM : contains
    PRODUCT ||--o{ LINE_ITEM : includes
 
    USER {
        int id PK
        string email UK
        string name
        datetime created_at







Detailed References

For in-depth guidance on specific diagram types, see:

  • references/class-diagrams.md - Domain modeling, relationships (association, composition, aggregation, inheritance), multiplicity, methods/properties
  • references/sequence-diagrams.md - Actors, participants, messages (sync/async), activations, loops, alt/opt/par blocks, notes
  • references/flowcharts.md - Node shapes, connections, decision logic, subgraphs, styling
  • references/erd-diagrams.md - Entities, relationships, cardinality, keys, attributes
  • references/c4-diagrams.md - System context, container, component diagrams, boundaries
  • references/architecture-diagrams.md - Cloud services, infrastructure, CI/CD deployments
  • references/advanced-features.md - Themes, styling, configuration, layout options
Best Practices
  1. Start Simple - Begin with core entities/components, add details incrementally
  2. Use Meaningful Names - Clear labels make diagrams self-documenting
  3. Comment Extensively - Use %% comments to explain complex relationships
  4. Keep Focused - One diagram per concept; split large diagrams into multiple focused views
  5. Version Control - Store .mmd files alongside code for easy updates
  6. Add Context - Include titles and notes to explain diagram purpose
  7. Iterate - Refine diagrams as understanding evolves
Configuration and Theming

Configure diagrams using frontmatter:

---
config:
  theme: base
  themeVariables:
    primaryColor: "#ff6b6b"
---
flowchart LR
    A --> B

Available themes: default, forest, dark, neutral, base

Layout options:

  • layout: dagre (default) - Classic balanced layout
  • layout: elk - Advanced layout for complex diagrams (requires integration)

Look options:

  • look: classic - Traditional Mermaid style
  • look: handDrawn - Sketch-like appearance
Exporting and Rendering

Native support in:

  • GitHub/GitLab - Automatically renders in Markdown
  • VS Code - With Markdown Mermaid extension
  • Notion, Obsidian, Confluence - Built-in support

Export options:

  • Mermaid Live Editor - Online editor with PNG/SVG export
  • Mermaid CLI - npm install -g @mermaid-js/mermaid-cli then mmdc -i input.mmd -o output.png
  • Docker - docker run --rm -v $(pwd):/data minlag/mermaid-cli -i /data/input.mmd -o /data/output.png
Common Pitfalls
  • Breaking characters - Avoid {} in comments, use proper escape sequences for special characters
  • Syntax errors - Misspellings break diagrams; validate syntax in Mermaid Live
  • Overcomplexity - Split complex diagrams into multiple focused views
  • Missing relationships - Document all important connections between entities
When to Create Diagrams

Always diagram when:

  • Starting new projects or features
  • Documenting complex systems
  • Explaining architecture decisions
  • Designing database schemas
  • Planning refactoring efforts
  • Onboarding new team members

Use diagrams to:

  • Align stakeholders on technical decisions
  • Document domain models collaboratively
  • Visualize data flows and system interactions
  • Plan before coding
  • Create living documentation that evolves with code
{
+string name
+getTopTitles()
}
200 OK + JWT token
else Invalid credentials
API-->>User: 401 Unauthorized
end
]
Creds --> Validate{Valid?}
Validate -->|Yes| Dashboard
Validate -->|No| Error[Show error]
Error --> Login
}
ORDER {
int id PK
int user_id FK
decimal total
datetime created_at
}