Skip to content

Commit 8a1ce60

Browse files
axtonliuclaude
andcommitted
feat: enhance Mermaid with semantic colors and ban cover quote decoration
- Add 7-color semantic palette (input/process/decision/action/output/ storage/meta) with classDef examples to SKILL.md - Add layout rules: arrow differentiation, subgraph grouping, node limits - Ban decorative quotes around text in cover images (style-cover.md) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c1aeb0b commit 8a1ce60

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

SKILL.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,40 @@ description: 智能配图与 PPT 信息图生成器。支持三种模式:(1)
136136

137137
**Mermaid**:直接以代码块嵌入文章,不生成 PNG。
138138

139-
**Mermaid 注意事项**
140-
- 节点标签**禁止**使用 `1.` `2.` 格式(会被误解为 Markdown 列表)
141-
- 正确:`["① 梳理任务"]``["1 梳理任务"]``["Step 1: 梳理任务"]`
142-
- 错误:`["1. 梳理任务"]`
139+
### Mermaid 语义色板
140+
141+
每种颜色有固定含义,**必须使用 `classDef` + `class` 应用**
142+
143+
| 语义 | 填充色 | 边框色 | 用于 |
144+
|------|--------|--------|------|
145+
| input | #d3f9d8 | #2f9e44 | 输入、起点、数据源 |
146+
| process | #e5dbff | #5f3dc4 | 处理、推理、核心逻辑 |
147+
| decision | #ffe3e3 | #c92a2a | 决策点、分支判断 |
148+
| action | #ffe8cc | #d9480f | 执行动作、工具调用 |
149+
| output | #c5f6fa | #0c8599 | 输出、结果、终点 |
150+
| storage | #fff4e6 | #e67700 | 存储、记忆、数据库 |
151+
| meta | #e7f5ff | #1971c2 | 标题、分组、元信息 |
152+
153+
**classDef 写法**(放在图表末尾):
154+
155+
```mermaid
156+
classDef input fill:#d3f9d8,stroke:#2f9e44,color:#1a1a1a
157+
classDef process fill:#e5dbff,stroke:#5f3dc4,color:#1a1a1a
158+
classDef decision fill:#ffe3e3,stroke:#c92a2a,color:#1a1a1a
159+
classDef action fill:#ffe8cc,stroke:#d9480f,color:#1a1a1a
160+
classDef output fill:#c5f6fa,stroke:#0c8599,color:#1a1a1a
161+
class A input
162+
class B,C process
163+
class D output
164+
```
165+
166+
### Mermaid 布局规则
167+
168+
- **布局方向**:默认 `TB`(上到下),横向流程用 `LR`
169+
- **箭头分级**`-->` 主流程 / `-.->` 可选/辅助路径 / `==>` 重点强调
170+
- **分组**:用 `subgraph` 对相关节点分组,标题简洁
171+
- **节点文字**:≤ 8 字,无 emoji,禁止 `1.` 格式(用 ```Step 1:`
172+
- **节点数量**:单图 ≤ 15 个节点,复杂内容拆成多图
143173

144174
**`--engine` 参数**
145175
- `auto`(默认):根据内容类型自动选择

styles/style-cover.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
- ❌ **解释图元素**:箭头流程、来回穿梭的线条、多区块并列布局
113113
- ❌ **括号注释**:如 "人类智慧(经验/判断)" 这种 PPT 式标注
114114
- ❌ **试图在一张图里讲清概念**:封面图是情绪冲击,不是机制解释
115+
- ❌ **文字加装饰符号**:不加引号「」、书名号《》或任何包围符号,直接显示纯文字
115116
116117
### ⛔ 严禁"AI味"审美(重要)
117118

0 commit comments

Comments
 (0)