roxorlt/UEmaster / skills/flow-canvas
flow-canvas
Verified把业务图渲染成横平竖直的规范 SVG:流程图(正交规范)、架构图(泳道分层)、ER 图、甘特图、时序图。触发:画流程图、业务流程图、架构图、ER 图、甘特图、时序图、把 mermaid 转规范图、流程图横平竖直、评审用图、render flowchart / orthogonal flowchart / architecture diagram / ER diagram / gantt / sequence diagram / draw a clean diagram from mermaid。不适用:只要 mermaid 源码文本、脑图、表格。
contract/archspec-v1.md
View on GitHub# archspec/1 契约(架构图)
flow-canvas 多图类型引擎 · 架构图(分层/泳道)排版契约。破坏性变更时主版本 +1。
## 输入:mermaid 子集
flowchart TD + subgraph 泳道:
```
flowchart TD
subgraph 接入层
A["负载均衡"]
B["网关"]
end
subgraph 服务层
C["用户服务"]
D["订单服务"]
end
A --> C
B --> D
C --> D
```
- 节点:`A["文本"]` 矩形、`A[["文本"]]` 外部系统(虚线)、`A("文本")` 圆角矩形;`<br>` 换行;`class X,Y external|backend` 标类型(backend 灰底双线)。
- subgraph:`subgraph 标题` … `end`;节点按 subgraph 归组;无 subgraph 的节点归入默认泳道「其他」。
- 边:`-->` / `-.->`,带 `|label|` 标签。
- **不支持**:decision 菱形 `{}` → 报「形态超限」错误降级,不产图。
## 布局规则
1. 泳道 = subgraph,横向排列(左→右按声明序);泳道内节点纵向排列(上→下按声明序);泳道顶对齐。
2. 跨泳道边走泳道间共享垂直总线(两泳道间隙中点):源右端口水平出 → 总线 → 垂直 → 目标左端口水平入;端口取边中点,同一端口多边错位 ±8px。
3. 跳级边(泳道内非相邻节点、跨多个泳道)走**顶部走廊**:源侧总线 x 上探 → 图顶走廊(每条边一条,按泳道跨度升序分配)→ 目标侧总线 x 下探;嵌套跨度零交叉,交错跨度产生交叉时报「形态超限」错误降级。
4. 泳道内相邻边垂直直线、端口取边中点;边标签放第一水平段上方居中。
## 输出 SVG 契约
- 根元素:`<svg data-archspec="1" viewBox="0 0 W H">`
- 节点:`<g class="node" id="arch-{id}" data-node="{id}">`
- 泳道:`<g class="lane" id="arch-lane-{i}">` 含背景带与 `<text class="lane-title">`
## 质检
统一 `--check` 报告字段(nodes/edges/crossings/overlaps/textOverflow/warnings/canvas)。
`crossings` / `overlaps` / `textOverflow` 任一非 0 即不合格:拒绝产出并降级。
泳道数 > 6 或交叉无法消除 → 报「形态超限」错误降级。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |