agentleFS
rcdelfinrcdelfin/agentkit/skills/design/mermaid-diagrams/SKILL.md

mermaid-diagrams

Skill2 starsChanged 3 months agoMITView on GitHub

Use when creating or explaining Mermaid diagrams for architecture, flows, ERDs, sequences, state, Git, or project timelines.

  • Installs packages

64 other projects use a version of this, 29 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use analytics-metrics, aws-account-management and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • hoodiniSkill

    analytics-metrics

    Build data visualization and analytics dashboards. Use when creating charts, KPI displays, metrics dashboards, or data visualization components. Triggers on analytics, dashboard, charts, metrics, KPI, data visualization, Recharts.

    Also in 3 projects that use this

  • hoodiniSkill

    aws-account-management

    Manage AWS accounts, organizations, IAM, and billing. Use when setting up AWS Organizations, managing IAM policies, controlling costs, or implementing multi-account strategies. Triggers on AWS Organizations, AWS IAM, AWS billing, Cost Explorer, SCPs, multi-account, AWS SSO, Identity Center.

    Also in 3 projects that use this

  • LangChainSkill

    langchain

    Build agents with a prebuilt architecture and integrations for any model or tool. Use when creating tool-calling agents, switching model providers, or adding structured output.

    Also in 3 projects that use this

  • imehrSkill

    railway

    Railway.com deployment and management - deployment, logs, migrations, troubleshooting, monorepo strategies, security, and CLI reference. Use when deploying to Railway, configuring services, managing environment variables, or debugging deployment issues.

    Also in 3 projects that use this

  • +8 more from hoodini

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 60 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create professional software diagrams using Mermaid's text-based syntax.

    line 8
  2. Distinctive:

    All Mermaid diagrams follow this pattern:

    line 12
  3. Very specific:

    Use %% for comments

    line 22
  4. Very specific:

    Comment Extensively: - Use %% comments to explain complex relationships

    line 157
  5. Distinctive:

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

    line 178
  6. Very specific:

    Breaking characters: - Avoid {} in comments, use proper escape sequences for special characters

    line 206
  7. Distinctive:

    Missing relationships: - Document all important connections between entities

    line 209
  8. Distinctive:

    Document domain models collaboratively

    line 225
  9. Distinctive:

    Create living documentation that evolves with code

    line 228

“Common” is measured: kept by at least 6 in 10 of the 60 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.