agentleFS
toolittlecakestoolittlecakes/mermaid-skill/SKILL.md

mermaid

Skill2 starsChanged 34 days agoMITView on GitHub

Визуализации через inline Mermaid внутри любого ответа агента или в md файлах. Покрывает flowchart'ы, sequence/class/state/ER/C4-диаграммы, mind map'ы, таймлайны, Gantt, Kanban, quadrant/pie/XY/radar/Sankey-графики, packet-диаграммы и другое. Полезно для наглядности и лучшего понимания пользователем сложных вещей (вместо или в дополнение к тексту)

45 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ansible, plantuml and 6 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.
  • julweberSkill

    ansible

    Ansible automation reference for playbooks, roles, inventory, variables, and modules. Includes Proxmox VE and Docker integration via community.general and community.docker collections. Use when writing playbooks, troubleshooting Ansible runs, or designing automation workflows. Triggers: ansible, playbook, inventory, role, task, handler, vars, jinja2, galaxy, proxmox_kvm, proxmox_lxc, docker_container, docker_compose.

    Also in 3 projects that use this

  • xenodiumSkill

    plantuml

    This skill should be used when the user invokes "/plantuml" to create a diagram from the current context using PlantUML and output the resulting image path.

    Also in 3 projects that use this

  • ihiteshguptaSkill

    terraform

    Expert in Infrastructure as Code with Terraform. Use for creating, managing, and versioning infrastructure across cloud providers.

    Also in 3 projects that use this

  • PostHogSkill

    karpathy-guidelines

    Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria. Based on https://github.com/multica-ai/andrej-karpathy-skills.

    Also in 3 projects that use this

  • AWSSkill

    ship

    Finalize dev work on an issue branch — update docs, push, and open a PR.

    Also in 4 projects that use this

  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 42 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not force every idea into a flowchart.

    line 23
  2. Distinctive:

    Use real labels from the task.

    line 29
  3. Distinctive:

    Keep surrounding prose short and do not narrate what the diagram already makes obvious.

    line 31

“Common” is measured: kept by at least 6 in 10 of the 42 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

Make the visualization part of the ordinary Markdown answer. Use a fenced mermaid block next to the short prose it clarifies; do not create a separate artifact unless the user asks for one.

Choose by meaning

  • Process, branching, dependencies, data flow → flowchart
  • Calls and interactions over time → sequenceDiagram or zenuml
  • Domain structure or data model → classDiagram or erDiagram
  • Lifecycle and transitions → stateDiagram-v2
  • Architecture → C4Context, C4Container, architecture-beta, or a flowchart with boundaries
  • Roadmap and schedule → timeline or gantt
  • Hierarchy and decomposition → mindmap, treemap-beta, or block-beta
  • Work and prioritization → kanban or quadrantChart
  • Quantitative comparison → xychart, pie, radar-beta, or sankey-beta
  • Binary or protocol layout → packet-beta

Do not force every idea into a flowchart. Pick the grammar whose semantics match the relationship.

Rules

  • Show one useful idea per diagram. Split diagrams when crossings or density hide the point.
  • Preserve truthful order, direction, cardinality, boundaries, units, and scale. Never invent data to make a chart look complete.
  • Use real labels from the task. Add subgraphs, participants, states, series names, and notes only when they carry meaning.
  • For charts, label units, choose an honest axis range, and name multiple series. Use color as reinforcement, not the only carrier of meaning.
  • Keep surrounding prose short and do not narrate what the diagram already makes obvious.
  • Renderer support varies for beta diagrams, C4, and ZenUML. Check the current syntax when uncertain and fail visibly rather than silently replacing the requested visualization with a weaker fallback.
  • Mermaid is for compact inline explanation, not polished interactive charts, geographic maps, or spatial UI mockups.

bb IDE renderer: mandatory frontmatter

When the diagram renders in bb chat (any bb thread), always start the mermaid block with this frontmatter. Verified root causes, do not drop pieces of it: bb initializes mermaid with font Inter while the app renders Inter Variable, so HTML labels are measured narrower than they render and get clipped (htmlLabels: false makes measurement and render use the same SVG font); mermaid's own state-diagram styles hardcode opacity: 0.5 on edge-label plates, which only themeCSS can override (it is not in the strict-mode secure list).

---
config:
  htmlLabels: false
  flowchart:
    htmlLabels: false
  themeCSS: ".edgeLabel rect, .edgeLabel .label rect, .stateLabel .box { opacity: 1 !important; fill: #ffffff; }"
  themeVariables:
    edgeLabelBackground: "#ffffff"
    labelBackgroundColor: "#ffffff"
---

Notes: #ffffff assumes bb light theme. stateDiagram transition labels have no auto-wrap even in SVG mode — keep each label line short and break long labels with <br/>; there is no knob for explicit label-box size. Font-family overrides (Inter Variable etc.) do NOT fix the clipping — tested.

Examples

Process with boundaries:

flowchart LR
    subgraph Client
        U([User]) --> UI[Checkout]
    end
    subgraph Platform
        UI --> API[Create order]
        API --> V{Valid?}
        V -- Yes --> P[Take payment]
        V -- No --> E[Show errors]
    end
    P --> C([Confirmation])
    E --> UI

Interaction with alternatives:

sequenceDiagram
    actor User
    participant App
    participant Auth
    User->>App: Submit credentials
    App->>Auth: Create session
    alt Valid credentials
        Auth-->>App: Access token
        App-->>User: Open dashboard
    else Invalid credentials
        Auth-->>App: 401
        App-->>User: Show error
    end

Chart with named series and non-zero axes:

---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#2563eb, #dc2626, #16a34a"
---
xychart
    title "API latency under load"
    x-axis "Requests per second" 200 --> 1200
    y-axis "Latency, ms" 50 --> 700
    line "p50" [85, 95, 115, 150, 205, 290]
    line "p95" [145, 170, 220, 310, 455, 640]
    line "SLO" [300, 300, 300, 300, 300, 300]

Protocol layout:

packet-beta
    0-3: "Version"
    4-7: "IHL"
    8-13: "DSCP"
    14-15: "ECN"
    16-31: "Total Length"
    32-47: "Identification"
    48-50: "Flags"
    51-63: "Fragment Offset"

Lifecycle with explicit transitions:

stateDiagram-v2
    [*] --> Draft
    Draft --> Review : submit
    Review --> Draft : changes requested
    Review --> Approved : approve
    Approved --> Published : publish
    Published --> Archived : retire
    Archived --> [*]

Relational data model:

erDiagram
    CUSTOMER ||--o{ ORDER : places
    ORDER ||--|{ ORDER_ITEM : contains
    PRODUCT ||--o{ ORDER_ITEM : references

    CUSTOMER {
        uuid id PK
        string email UK
    }
    ORDER {
        uuid id PK
        uuid customer_id FK
        string status
    }
    ORDER_ITEM {
        uuid order_id PK, FK
        uuid product_id PK, FK
        int quantity
    }
    PRODUCT {
        uuid id PK
        string name
    }

Schedule with dependencies and a milestone:

gantt
    title Release plan
    dateFormat YYYY-MM-DD
    excludes weekends

    section Discovery
        Specification :done, spec, 2025-03-03, 3d
    section Build
        Backend API   :crit, api, after spec, 5d
        Web UI        :ui, after spec, 7d
    section Release
        Launch        :milestone, after ui, 0d

Hierarchy and decomposition:

mindmap
    root((Product launch))
        Product
            Research
            MVP
        Go-to-market
            Content
            Sales
        Operations
            Support
            Reliability

Prioritization by two dimensions:

quadrantChart
    title Feature priorities
    x-axis Low effort --> High effort
    y-axis Low impact --> High impact
    quadrant-1 Strategic bets
    quadrant-2 Quick wins
    quadrant-3 Fill-ins
    quadrant-4 Avoid
    Better search: [0.25, 0.82]
    Enterprise SSO: [0.55, 0.76]
    New UI themes: [0.35, 0.28]
    Custom chat: [0.82, 0.22]

Work moving through stages:

kanban
    backlog[Backlog]
        task1[Define API contract]
        task2[Prepare migration]
    doing[In progress]
        task3[Implement backend]
    review[Review]
        task4[Security review]
    done[Done]
        task5[Create dashboard]

Part-to-whole comparison:

pie showData
    title Infrastructure cost
    "Compute" : 42
    "Databases" : 24
    "Network" : 14
    "Storage" : 11
    "Monitoring" : 9

Architecture with explicit boundaries:

architecture-beta
    group edge(cloud)[Edge]
    group app(cloud)[Application]

    service client(internet)[Client]
    service gateway(server)[Gateway] in edge
    service api(server)[API] in app
    service db(database)[Database] in app

    client:R --> L:gateway
    gateway:R --> L:api
    api:R --> L:db

Documentation

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.