mermaid

mermaid is a cursor rule for Cursor from Mr-chen-05/rules-2.1-optimized-zh. It costs 0 tokens per session (1,997 once invoked), scanned A, original, MIT.

A guide for creating Mermaid diagrams, which are text-based diagrams rendered from simple descriptions. It includes flowcharts, sequence diagrams, class diagrams, and entity-relationship diagrams.

In plain words
What is it for?
Generating flowcharts, sequence diagrams, class diagrams, and database relationship diagrams from written specifications.
Why use it?
It provides repeatable formats for showing processes, interactions, software structure, and database relationships without drawing them manually.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Generating flowcharts, sequence diagrams, class diagrams, and database relationship diagrams from written specifications.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mr-chen-05/rules-2.1-optimized-zh/mermaid
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/Mr-chen-05/rules-2.1-optimized-zh

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mermaid

README.md
[![agentmods](https://agentmods.dev/badge/rules/mr-chen-05/rules-2.1-optimized-zh/mermaid.svg)](https://agentmods.dev/rules/mr-chen-05/rules-2.1-optimized-zh/mermaid)
Your own site
<a href="https://agentmods.dev/rules/mr-chen-05/rules-2.1-optimized-zh/mermaid"><img src="https://agentmods.dev/badge/rules/mr-chen-05/rules-2.1-optimized-zh/mermaid.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,997 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01997
Opus 5 $0.00000 $0.00999
Sonnet 5 $0.00000 $0.00399
Haiku 4.5 $0.00000 $0.00200

Measured 8d ago against content hash ddf11ab80821, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

mermaid scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

项目规则/mermaid.mdc · 307 lines

How it starts

The opening of the file, as written. The whole thing — 307 lines — stays where its author put it; the contents beside it link to each section on GitHub.

📊 Mermaid Diagrams - Mermaid图表

使用Mermaid创建各种类型的图表和可视化。

🚀 Commands - 命令

  • /mermaid - 创建Mermaid图表
  • /flowchart - 创建流程图
  • /sequence - 创建时序图
  • /class-diagram - 创建类图
  • /er-diagram - 创建实体关系图

📋 Diagram Types - 图表类型

1. 🔄 流程图 (Flowchart)

flowchart TD
    A[开始] --> B{条件判断}
    B -->|是| C[执行操作A]
    B -->|否| D[执行操作B]
    C --> E[结束]
    D --> E

2. ⏱️ 时序图 (Sequence Diagram)

sequenceDiagram
    participant U as 用户
    participant F as 前端
    participant B as 后端
    participant D as 数据库
    
    U->>F: 登录请求
    F->>B: 验证用户
    B->>D: 查询用户信息
    D-->>B: 返回用户数据
    B-->>F: 返回认证结果
    F-->>U: 显示登录状态

3. 🏗️ 类图 (Class Diagram)

classDiagram
    class User {
        +String name
        +String email
        +login()
        +logout()
    }
    
    class Admin {
        +String permissions
        +manageUsers()
    }
    
    User <|-- Admin

4. 🗄️ 实体关系图 (ER Diagram)

erDiagram
    USER ||--o{ ORDER : places
    ORDER ||--|{ ORDER_ITEM : contains
    PRODUCT ||--o{ ORDER_ITEM : "ordered in"
    
    USER {
        int id PK
        string name
        string email
    }
    
    ORDER {
        int id PK
        int user_id FK
        date created_at
    }

5. 🌳 Git图 (Git Graph)

gitgraph
    commit id: "Initial"
    branch develop
    checkout develop
    commit id: "Feature A"
    commit id: "Feature B"
    checkout main
    merge develop
    commit id: "Release v1.0"

6. 📊 甘特图 (Gantt Chart)

gantt
    title 项目开发计划
    dateFormat  YYYY-MM-DD
    section 需求分析
    需求调研    :done, des1, 2024-01-01, 2024-01-05
    需求文档    :done, des2, after des1, 3d
    section 开发阶段
    前端开发    :active, dev1, 2024-01-08, 10d
    后端开发    :dev2, 2024-01-08, 12d
    section 测试阶段
    单元测试    :test1, after dev1, 3d
    集成测试    :test2, after dev2, 2d

7. 🍰 饼图 (Pie Chart)

pie title 技术栈分布
    "Vue.js" : 35
    "React" : 30
    "Angular" : 15
    "其他" : 20

Read the full file on GitHub · 307 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 307 lines · 0 tokens per session scan A ddf11ab80821

Subscribe to this mod's changes

mermaid is a cursor rule published in the GitHub repository Mr-chen-05/rules-2.1-optimized-zh (29 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,997 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.