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

Mermaid Diagrams

  • 841 installs
  • 29.9k repo stars
  • Updated July 27, 2026
  • davila7/claude-code-templates

This is a copy of mermaid-diagrams by softaworks - installs and ranking accrue to the original listing.

mermaid-diagrams is an agent skill that generates version-controlled Mermaid diagrams for architecture, data models, user flows, and system designs for developers who document technical concepts in text-based diagrams.

About

mermaid-diagrams is a comprehensive agent skill for creating professional software diagrams using Mermaid's text-based syntax directly from natural language prompts. The skill covers system architecture, code structure, database models, user flows, and component diagrams that render from simple text definitions and stay version-controlled alongside source code. Diagrams update easily in pull requests because they are plain text, not binary image exports. Developers reach for mermaid-diagrams when they need to visualize C4 contexts, ER models, sequence flows, or system designs without opening a separate diagramming tool.

  • Generates 8 core Mermaid diagram types including flowcharts, sequence, class, ERD, and C4 architecture
  • Transforms natural language prompts like "diagram the authentication flow" into production-ready Mermaid syntax
  • Diagrams are text-based and can be committed to git alongside code for living documentation
  • Supports system context, container, component, and deployment visualizations
  • Activates automatically on trigger phrases such as "diagram", "visualize", "ERD", or "show the flow"

Mermaid Diagrams by the numbers

  • 841 all-time installs (skills.sh)
  • +33 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/davila7/claude-code-templates --skill mermaid-diagrams

Add your badge

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

Listed on Skillselion
Installs841
repo stars29.9k
Security audit3 / 3 scanners passed
Last updatedJuly 27, 2026
Repositorydavila7/claude-code-templates

How do you generate architecture diagrams as version-controlled text?

Generate clear, version-controlled Mermaid diagrams for architecture, data models, user flows, and system designs directly from natural language prompts.

Who is it for?

Developers documenting system design in markdown repos who want PR-reviewable, text-based diagrams.

Skip if: Pixel-perfect UI mockups, photo editing, or diagrams that require proprietary binary design tools.

When should I use this skill?

A user needs architecture, ER, sequence, flowchart, or system design diagrams in Mermaid syntax.

What you get

Mermaid diagram source files for architecture, data models, flows, and system designs.

  • Mermaid diagram source
  • architecture documentation

Files

SKILL.mdMarkdownGitHub ↗

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:

  • [references/class-diagrams.md](references/class-diagrams.md) - Domain modeling, relationships (association, composition, aggregation, inheritance), multiplicity, methods/properties
  • [references/sequence-diagrams.md](references/sequence-diagrams.md) - Actors, participants, messages (sync/async), activations, loops, alt/opt/par blocks, notes
  • [references/flowcharts.md](references/flowcharts.md) - Node shapes, connections, decision logic, subgraphs, styling
  • [references/erd-diagrams.md](references/erd-diagrams.md) - Entities, relationships, cardinality, keys, attributes
  • [references/c4-diagrams.md](references/c4-diagrams.md) - System context, container, component diagrams, boundaries
  • [references/advanced-features.md](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

Related skills

How it compares

Pick this when diagrams must live in git and diff in PRs rather than exported PNG or SVG from a GUI tool.

FAQ

What diagram types does mermaid-diagrams support?

mermaid-diagrams supports architecture, database ER models, user flows, sequence diagrams, and system design visuals using Mermaid text syntax that renders from plain definitions in markdown.

Why use mermaid-diagrams over image-based diagram tools?

mermaid-diagrams outputs text-based Mermaid source that lives in git repos and updates in pull requests. Developers avoid binary exports that are hard to diff and maintain.

Is Mermaid Diagrams safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Documentationdocsintegrations

This week in AI coding

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

unsubscribe anytime.