Percerno Skillsbeta
← everything it can do · engineering

Mermaid Diagrams TEXT

Generates text-based software diagrams using Mermaid syntax, supporting types such as flowcharts, sequence diagrams, class diagrams, ERDs, and C4 architecture views. It converts logical descriptions of systems, processes, or data structures into valid, renderable Mermaid code blocks.

4 uses this weeksource softaworkslicence MIT
Quality gate: PASS · better answers · measured 2026-10-24
Blind-judged against the bare model on 2 requests: average lift +5.5 points (specificity, structure, method, fit).
won 2/2, lift +5.5, tokens ×27.72
Security scan: clean · 2026-10-24 · 9 files · ran in sandbox
no network calls, shell tricks, credential access or instruction tampering found in its files.

Try asking

Say it in your own words; the assistant finds this recipe by itself. Examples:

“Lav en Mermaid-sekvensdiagram over, hvordan vores API håndterer fejl ved login.”
“Jeg har brug for en klassediagram til vores bestillingsmodul, der viser relationen mellem kunde og vare.”
“Vis databasestrukturen for vores CRM-system som et ER-diagram i Mermaid-syntaks.”
“Create a Mermaid sequence diagram showing the OAuth2 login flow between the client, auth server, and resource server.”
“I need a class diagram for my e-commerce domain model including Product, Cart, and Order entities with their relationships.”
“Map out the CI/CD pipeline for our deployment process as a Mermaid flowchart, highlighting the approval step.”
Try this skill from Claude, ChatGPT or a chat on your own page. Free plan, no credit card.Get started free

Good for

mermaiddiagramvisualizationarchitectureflowchartsequence-diagramclass-diagramerddocumentationsyntax

Not for

Do not use this skill for creating high-fidelity UI/UX mockups or pixel-perfect graphic designs, as Mermaid is for logical structure, not visual aesthetics. It is not suitable for generating non-Mermaid diagram formats like PlantUML, Graphviz, or SVG directly without conversion. Avoid using it for simple text-based lists or tables that do not require graphical relationship mapping.

Details

When it is the right choice

Use this skill when the user asks to visualize, map out, or document software architecture, database schemas, or process flows using Mermaid. It is appropriate for requests to create specific diagram types like sequence diagrams for API interactions, class diagrams for OOP design, or flowcharts for user journeys. It is also suitable when the user wants to convert a textual description of a system into a visual representation that can be rendered in Markdown or similar tools.

The full recipe the assistant reads

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
  2. Domain-driven design documentation
  3. Object-oriented class structures
  4. Entity relationships and dependencies

  5. Sequence Diagrams - Temporal interactions, message flows

  6. API request/response flows
  7. User authentication flows
  8. System component interactions
  9. Method call sequences

  10. Flowcharts - Processes, algorithms, decision trees

  11. User journeys and workflows
  12. Business processes
  13. Algorithm logic
  14. Deployment pipelines

  15. Entity Relationship Diagrams (ERD) - Database schemas

  16. Table relationships
  17. Data modeling
  18. Schema design

  19. C4 Diagrams - Software architecture at multiple levels

  20. System Context (systems and users)
  21. Container (applications, databases, services)
  22. Component (internal structure)
  23. Code (class/interface level)

  24. State Diagrams - State machines, lifecycle states

  25. Git Graphs - Version control branching strategies
  26. Gantt Charts - Project timelines, scheduling
  27. 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

Files in this skill (10)
  • LICENSE
  • README.md
  • SKILL.md
  • references/advanced-features.md
  • references/architecture-diagrams.md
  • references/c4-diagrams.md
  • references/class-diagrams.md
  • references/erd-diagrams.md
  • references/flowcharts.md
  • references/sequence-diagrams.md
Where it comes from

Vendored from softaworks/agent-toolkit, commit 3027f20f3181, path skills/mermaid-diagrams, licence MIT. The upstream licence file ships inside the skill.