Skip to content
Development
Skill

/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,

From plugin
shep
28119 skills10 agents

Claude Code

$ npx -y skills add shep-ai/shep --skill mermaid-diagrams --agent claude-code

SKILL.md

mermaid-diagrams.SKILL.md
name: mermaid-diagrams
description: 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.

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/architecture-diagrams.md](references/architecture-diagrams.md)** - Cloud services, infrastructure, CI/CD deployments
  • **[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 f
Read more
@shep-ai
Ships withshep

Ship features 10x faster. Built In Auto: Memory, K8S Agent & Security (SDD+SDLC) . 😇

28119 skills10 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
281
Star history of shep-ai/shep on GitHub, a chart by star-history.com

Other skills on shep.

architecture-reviewer

architecture-reviewer

Use when making architectural decisions, planning features, designing new components, reviewing PRs, or validating that proposed…

@shep-ai@shep-aiInstall Skill
cross-validate-artifacts

cross-validate-artifac…

Cross-validate documentation and artifacts across the codebase for consistency, conflicts, and contradictions. Use when users ask…

@shep-ai@shep-aiInstall Skill
react-flow

react-flow

React Flow (@xyflow/react) for workflow visualization with custom nodes and edges. Use when building graph visualizations,…

@shep-ai@shep-aiInstall Skill
shadcn-ui

shadcn-ui

Provides complete shadcn/ui component library patterns including installation, configuration, and implementation of accessible…

@shep-ai@shep-aiInstall Skill
shep-kit-commit-pr

shep-kit-commit-pr

Use when ready to commit, push, and create a PR with CI verification. Triggers include "commit and pr", "push pr", "create pr",…

@shep-ai@shep-aiInstall Skill
shep-kit-fast-loop

shep-kit-fast-loop

Use when the user wants rapid implementation iteration without tests, builds, or commits. Triggers include "fast loop", "fast…

@shep-ai@shep-aiInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about mermaid-diagrams.

Which coding agents can use mermaid-diagrams?
mermaid-diagrams installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.