← 返回
未分类

罗老师 Mermaid 图表助手

Create and repair syntactically correct Mermaid diagrams, including flowchart, sequenceDiagram, classDiagram, stateDiagram, erDiagram, gantt, and mindmap. Use when turning processes, architecture, data models, workflows, or explanations into Mermaid code, or when fixing Mermaid parse errors.
Create and repair syntactically correct Mermaid diagrams, including flowchart, sequenceDiagram, classDiagram, stateDiagram, erDiagram, gantt, and mindmap. Use when turning processes, architecture, data models, workflows, or explanations into Mermaid code, or when fixing Mermaid parse errors.
罗老师玩赚AI
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 12
下载
💾 0
安装
1
版本
#latest

概述

Mermaid Diagram

Use this skill to produce Mermaid diagrams that render cleanly in Markdown, documentation, Obsidian, GitHub, and similar tools.

When To Use

  • Convert a process, architecture, decision path, timeline, or data relationship into Mermaid.
  • Repair an existing Mermaid diagram that fails to render.
  • Choose the right diagram type for an explanation.
  • Simplify a dense written explanation into a readable visual structure.

Default Workflow

  1. Clarify the user's goal and intended reader.
  2. Choose the smallest diagram type that explains the idea clearly.
  3. Draft valid Mermaid code.
  4. Check the syntax rules below before finalizing.
  5. If the diagram is complex, prefer two small diagrams over one crowded diagram.

Diagram Type Selection

  • flowchart: workflows, decisions, systems, pipelines, cause-effect paths.
  • sequenceDiagram: conversations, API calls, handoffs, time-ordered interactions.
  • classDiagram: object models, interfaces, inheritance, module relationships.
  • stateDiagram-v2: state machines, lifecycle transitions, app or order states.
  • erDiagram: database entities and relationships.
  • gantt: schedules and delivery plans.
  • mindmap: topic breakdowns and idea trees.

Critical Mermaid Rules

Quote Labels With Special Characters

Labels containing :, (), [], {}, @, ;, or , should be wrapped in double quotes.

flowchart LR
    A["Function: process(input)"]
    B["Array [1, 2, 3]"]
    A --> B

Avoid Lowercase end As A Node Id

end is a reserved word in flowcharts. Use End, END, or another id.

flowchart TD
    Start --> End

Give Every Subgraph An Id

Use subgraph ID["Title"], not only subgraph "Title".

flowchart TD
    subgraph AUTH["Authentication"]
        A["Login"]
        B["Check session"]
    end
    A --> B

Use Note Only In Sequence Diagrams

Note right of A: is valid in sequenceDiagram, but not in flowchart.

sequenceDiagram
    participant User
    participant API
    User->>API: Request
    Note right of API: Validate input

For flowcharts, use a normal node instead:

flowchart TD
    A["Request"]
    N["Note: validate input"]
    A --> N

Define Classes Before Linking Them

In classDiagram, define referenced classes before relationships.

classDiagram
    class Animal {
        +String name
        +makeSound()
    }
    class Dog {
        +bark()
    }
    Animal <|-- Dog

Starter Examples

Flowchart

flowchart TD
    Start["Start"]
    Check{"Valid input?"}
    Fix["Ask for correction"]
    Done["Done"]

    Start --> Check
    Check -->|Yes| Done
    Check -->|No| Fix
    Fix --> Check

Sequence Diagram

sequenceDiagram
    participant User
    participant App
    participant API

    User->>App: Submit form
    App->>API: Send request
    API-->>App: Return result
    App-->>User: Show status

Entity Relationship

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

    CUSTOMER {
        string id
        string name
    }
    ORDER {
        string id
        date created_at
    }

Validation Checklist

Before returning a diagram:

  • The first line declares a valid Mermaid diagram type.
  • Labels with special characters are quoted.
  • Flowchart subgraphs use subgraph ID["Title"].
  • No node id is lowercase end.
  • Note appears only inside sequenceDiagram.
  • Class diagrams define classes before relationships.
  • The diagram is readable enough for the intended audience.

For common parse errors and fixes, read references/common-errors.md when needed.

版本历史

共 1 个版本

  • v1.0.0 mermaid-diagram 当前
    2026-06-10 03:25 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,791
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,349 📥 317,697
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,055 📥 795,902