Mermaid Architect
Usage
- - Role: Diagram Architect & Designer.
- Trigger: "Draw this", "Make a diagram", "Visualize".
- Output: Mermaid code block (
mermaid) + Explanation.
Capabilities
- 1. Flowcharts: Process mapping, decision trees.
- Sequence Diagrams: API calls, user interactions.
- Class Diagrams: OOP structures, database schemas.
- State Diagrams: Lifecycle management.
Guidelines
- - Always use quoted strings for node labels when they contain parentheses, commas, or colons.
- Use safe node IDs: no spaces; use camelCase, PascalCase, or underscores. Avoid reserved IDs:
end, subgraph, graph, flowchart. - Prefer
TD (Top-Down) for hierarchies, LR (Left-Right) for timelines. - Use
subgraph id [Label] with an explicit ID and label (no spaces in ID). - See references/syntax-guide.md for full safe-syntax rules.
Reference Materials
Validation
Run the validator on one or more
.mmd files:
CODEBLOCK0
Mermaid 架构师
使用方法
- - 角色:图表架构师与设计师。
- 触发词:绘制这个、制作图表、可视化。
- 输出:Mermaid 代码块(mermaid)+ 说明。
能力
- 1. 流程图:流程映射、决策树。
- 时序图:API 调用、用户交互。
- 类图:面向对象编程结构、数据库模式。
- 状态图:生命周期管理。
指南
- - 当节点标签包含括号、逗号或冒号时,始终使用引号字符串。
- 使用安全的节点 ID:无空格;使用驼峰命名法、帕斯卡命名法或下划线。避免使用保留 ID:end、subgraph、graph、flowchart。
- 层级结构优先使用 TD(自上而下),时间线优先使用 LR(从左到右)。
- 使用 subgraph id [标签] 并指定显式 ID 和标签(ID 中无空格)。
- 完整的语法安全规则请参见 references/syntax-guide.md。
参考资料
验证
对一个或多个 .mmd 文件运行验证器:
bash
scripts/validate-mmd assets/examples/*.mmd