Catalog
softaworks/mermaid-diagrams

softaworks

mermaid-diagrams

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.

global
0installs0uses~1.9k
v1.1Saved Apr 20, 2026

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 {
        +string name
        +getTopTitles()
    }

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: 200 OK + JWT token
    else Invalid credentials
        API-->>User: 401 Unauthorized
    end

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]
    Creds --> Validate{Valid?}
    Validate -->|Yes| Dashboard
    Validate -->|No| Error[Show error]
    Error --> Login

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
    }

    ORDER {
        int id PK
        int user_id FK
        decimal total
        datetime created_at
    }

Detailed References

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

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
Files9
9 files · 77.4 KB

Select a file to preview

Overall Score

88/100

Grade

A

Excellent

Safety

95

Quality

92

Clarity

85

Completeness

82

Summary

A comprehensive skill for creating professional software diagrams using Mermaid's text-based syntax. It guides agents through selecting appropriate diagram types (class, sequence, flowchart, ERD, C4, state, git, gantt, pie charts), writing correct syntax, configuring themes and layouts, and exporting diagrams. The skill includes 7 detailed reference documents covering all diagram types with extensive examples.

Detected Capabilities

class diagram generation for domain modelingsequence diagram generation for flow visualizationflowchart generation for process and algorithm mappingentity relationship diagram generation for database designC4 architecture diagram generation (context, container, component levels)state diagram generation for state machinesgit graph generation for branching strategiesgantt chart and pie chart generationdiagram theming and styling (multiple built-in themes, custom variables)layout configuration (dagre, ELK)hand-drawn look option for informal diagramsexport to PNG, SVG via Mermaid Live or CLIGitHub/GitLab native rendering support

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

create diagramvisualize system architecturemodel domain entitiesdocument database schemamap user flowexplain api flowdesign class diagramc4 architecture diagramsequence diagram interactionflowchart process

Risk Signals

INFO

Referenced external domains (api.example.com, dashboard.example.com, docs.example.com) used as placeholder examples

SKILL.md header, multiple reference files
INFO

CDN reference to cdn.jsdelivr.net for icon loading with Mermaid

references/architecture-diagrams.md, advanced-features.md
INFO

External icon resource reference (iconify.design) for diagram icons

references/architecture-diagrams.md
INFO

References to mermaid.live, mermaid.js.org for online tools and documentation

Multiple reference files and README.md
INFO

No destructive operations, privilege escalation, credential access, or code execution patterns detected

All files

Referenced Domains

External domains referenced in skill content, detected by static analysis.

api.example.comcdn.jsdelivr.netdashboard.example.comdocs.example.comgithub.comiconify.designmermaid.js.orgmermaid.live

Use Cases

  • document system architecture with C4 diagrams
  • model domain entities and relationships with class diagrams
  • visualize API request/response flows with sequence diagrams
  • map user journeys and workflows with flowcharts
  • design database schemas with entity relationship diagrams
  • explain code structure and dependencies
  • communicate technical decisions to stakeholders
  • create living documentation alongside code

Quality Notes

  • Excellent documentation completeness: skill clearly states what it does, when to use it, and provides 9+ diagram type examples
  • Supporting reference files are comprehensive and well-organized with detailed syntax guides for each diagram type
  • Strong practical examples: 50+ working Mermaid diagram examples across all file types demonstrate real-world use cases (e-commerce, microservices, authentication flows, CI/CD pipelines, etc.)
  • Clear scope boundaries: skill is explicitly scoped to Mermaid diagram creation with no file system writes or modifications
  • Excellent error handling guidance: common pitfalls section documents breaking characters, syntax errors, complexity issues
  • Edge cases addressed: skill mentions handling empty inputs, large diagrams, special characters, and provides strategies (split into multiple diagrams, use comments, validate syntax)
  • Well-structured reference hierarchy: main skill file links to 7 detailed reference documents covering diagram types, advanced features, styling, architecture patterns
  • Best practices clearly articulated: 'Start Simple', 'Use Meaningful Names', 'Comment Extensively', 'Keep Focused', 'Version Control'
  • Trigger keywords and activation conditions explicitly documented in description and README
  • Integration guidance comprehensive: GitHub, GitLab, VS Code, Notion, Obsidian, Confluence, React, HTML examples provided
  • Advanced features thoroughly documented: themes (default, forest, dark, neutral, base), layout options (dagre, ELK), styling, accessibility considerations
  • Tool-agnostic examples: exports, CLI usage, Docker containerization for batch processing all documented
  • Accessibility considerations included: color contrast, non-color-based meaning, testing guidance
  • Performance tips provided: ELK layout for large diagrams, edge merging, subgraph organization
  • Reference domains are all placeholders or legitimate third-party services (GitHub, Mermaid official, Iconify) — no suspicious external URLs
Model: claude-haiku-4-5-20251001Analyzed: Apr 20, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Version History

v1.1

Content updated

2026-04-20

Latest
v1.0

No changelog

2026-04-12

Add softaworks/mermaid-diagrams to your library

Command Palette

Search for a command to run...