Skip to content

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 源码文本、脑图、表格。

FileKindSize
LICENSEother1.0 KB
README.mdmarkdown3.7 KB
SKILL.mdskill md10.2 KB
agents/interface.yamlconfig1.4 KB
contract/archspec-v1.mdmarkdown2.1 KB
contract/archspec-v2.mdmarkdown3.0 KB
contract/archspec-v3.mdmarkdown5.1 KB
contract/archspec-v4.mdmarkdown5.0 KB
contract/archspec-v5.mdmarkdown3.5 KB
contract/blueprintspec-v1.mdmarkdown7.7 KB
contract/blueprintspec-v2.mdmarkdown4.0 KB
contract/blueprintspec-v4.mdmarkdown4.1 KB
contract/erspec-v1.mdmarkdown1.9 KB
contract/erspec-v2.mdmarkdown4.2 KB
contract/flowspec-v1.mdmarkdown3.0 KB
contract/ganttspec-v1.mdmarkdown1.9 KB
contract/seqspec-v1.mdmarkdown1.6 KB
examples/arch-3tier.mmdother289 B
examples/arch-logical.mmdother680 B
examples/arch-microservice.mmdother342 B
examples/arch-portal.mmdother262 B
examples/arch-skip.mmdother337 B
examples/blueprint-enterprise.mmdother2.0 KB
examples/blueprint-layered.mmdother794 B
examples/er-blog.mmdother324 B
examples/er-order.mmdother449 B
examples/er-school.mmdother409 B
examples/gantt-day-schedule.mmdother321 B
examples/gantt-infra.mmdother473 B
examples/gantt-release.mmdother483 B
examples/minimal.mmdother133 B
examples/pet-boarding.mmdother1.2 KB
examples/seq-login-auth.mmdother308 B
examples/seq-oauth-resource.mmdother386 B
examples/seq-order-pay.mmdother338 B
examples/seq-push-notify.mmdother414 B
manifest.jsonconfig288 B
scripts/flowcommon.pyexecutablescript21.3 KB
scripts/flowlayout.pyexecutablescript30.7 KB
scripts/layout_arch.pyexecutablescript60.6 KB
scripts/layout_blueprint.pyscript78.8 KB
scripts/layout_er.pyexecutablescript21.1 KB
scripts/layout_gantt.pyexecutablescript14.4 KB
scripts/layout_seq.pyexecutablescript13.5 KB
scripts/selftest.pyexecutablescript6.0 KB
scripts/selftest_arch.pyexecutablescript18.5 KB
scripts/selftest_blueprint.pyscript22.2 KB
scripts/selftest_er.pyexecutablescript10.5 KB
scripts/selftest_gantt.pyexecutablescript6.7 KB
scripts/selftest_seq.pyexecutablescript6.1 KB

contract/archspec-v4.md

View on GitHub
# archspec/4 契约(架构图)

flow-canvas 多图类型引擎 · 架构图排版契约。v4 对齐「结构化图形渲染」原则:**先建立语义模型(元素类型 → 唯一视觉样式),再按固定视觉规则做拓扑布局、路由与自动验收**;图例由实际使用的样式自动生成,不靠事后补图例。v3 → v4 破坏性变更:视觉语法重定义(一语义一视觉)、拓扑驱动列对齐、节点三层文字、注释编号锚点、view 图种指令、边型区分同步/异步。

## 输入:mermaid 子集

### 逻辑容器图(推荐形态)

```
flowchart TB
title 业务系统|逻辑容器图(Web 请求路径)
view container
scope 不描述部署、高可用与安全边界
version 2026-03-02
todo [A1] Nginx 职责待确认(反向代理 / API 网关)
todo [A2] 缓存模式与失效机制待确认
subgraph 业务系统
  subgraph 接入层
    N["NGINX|接入组件 [A1]"]
  end
  subgraph 应用层
    A["应用服务|业务处理"]
  end
  subgraph 数据层
    D[("数据库|主数据存储|权威源")]
    R[("Redis|缓存 [A2]")]
  end
end
W[["浏览器|外部客户端"]]
W -->|HTTPS:请求/响应| N
N -->|HTTP:反向代理| A
A -->|SQL:读写| D
A -->|Redis 协议:缓存读写| R
```

- **元信息指令**:`title …`(图名|图类型(视角))、`view context|container|deployment|data-flow|information-architecture`(图种,一张图一个主视角,非法值报错)、`scope …`(范围/排除项)、`version …`(版本/日期)、`todo [A1] …`(待确认项,编号锚点;未给编号自动分配 A1..An)。
- **系统边界**:最外层 subgraph = 系统边界(粗实线主框架);内层 subgraph = 逻辑层(弱化背景带,无边框,不与边界竞争);边界外顶层节点 = 外部实体。
- **节点形状 = 语义**:`A["文本"]` 组件容器(实线圆角矩形);`A[["文本"]]` 外部实体(中性填充 + 虚线框);`A[("文本")]` 数据存储(圆柱体);`A("文本")` 圆角(同容器样式);`class X backend|external` 等效标注。**虚线只表达「外部实体」一种语义**。
- **节点文字三层**(`|` 分隔,≤3 层,超出报错):名称(主文字)|次级职责(小字灰)|状态(徽标 pill)。标签尾部 `[A1]` 式锚点渲染为节点内编号徽章,并挂接 todo 注释。
- **边**:`-->` 同步调用(实线 + 实心箭头);`-.->` 异步事件(虚线 + 空心箭头);`|标签|` 语义标签(不加引号;含引号会剥离);标签尾部 `[A1]` 渲染为标签旁锚点标记。
- **注释完整性**:todo 锚点未被任何节点/边引用,或节点/边锚点没有对应 todo → 报告 warnings。
- **不支持**:decision 菱形、subgraph 嵌套超过两层、多个系统边界、边界外独立泳道层 → 「形态超限」降级。

### 传统泳道分层图(兼容)

无嵌套 subgraph 时按泳道规则:顶层 subgraph = 泳道(纵向分层)、无 subgraph 节点归「其他」,无边界与外部实体。

## 布局规则(先拓扑后文字)

1. **拓扑列对齐**:先按图拓扑做邻接重心列对齐(父节点居中于子节点组、兄弟对称;行内顺序与邻接标签间隙保持),再填充文字;对齐后父子边垂直直落(0 折弯),跨层总线 ≤2 折弯;折弯 >2 仅避障允许并出 warning。
2. 页眉:标题 + 「图种 · 范围 · 版本」;图例右上(注册表驱动,只列图中真实使用的样式:节点型 + 边界/逻辑层 + 同步/异步边型)。
3. 外部实体行在边界上方;外部 ↔ 内部走顶部走廊带 + 右侧线廊(顶层对齐时直落)。
4. 泳道纵向分层、泳道内横向;相邻泳道水平总线;跳级边上/下侧间隙走廊候选搜索零交叉;跨泳道右侧线廊按跨度升序分配。
5. 待确认项区底部左侧:`「A1」文本` 编号列表。
6. 画布宽高按实际渲染内容计算,任何元素不越 viewBox。

## 输出 SVG 契约

- 根元素:`<svg data-archspec="4" viewBox="0 0 W H">`
- 节点:`<g class="node" id="arch-{id}" data-node="{id}" data-style="{external|container|datastore}">`(数据存储含 `<ellipse>`)
- 系统边界:`<g class="boundary">`(实线粗框)+ `<text class="boundary-title">`
- 泳道:`<g class="lane">`(无边框背景带)+ `<text class="lane-title">`
- 图例:`<g class="legend">`;待确认项:`<g class="todo">`;锚点徽章/边锚点:`class="note-badge"`
- 箭头 marker:`#arw`(同步实心)、`#arw-open`(异步空心)

## 质检与自动验收

统一 `--check` 报告字段。`crossings` / `overlaps` / `textOverflow` 任一非 0 → 拒绝产出。
可读性硬阈值:所有字号 ≥ 10px(`--style` 覆盖低于阈值出 warning);边线宽 ≥ 1.4。
50% 缩放可读以字号硬阈值为引擎侧保证,光栅级复检由评审工具承担。
warnings 覆盖:无标签边、折弯 >2、孤儿/悬空锚点、字号阈值、泳道超限外的提示类问题。
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall