flowzap-diagrams
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFlowZap Diagram Skill
FlowZap 图表技能
Generate valid FlowZap Code (.fz) diagrams from natural-language descriptions,
validate them, and return shareable playground URLs — all without leaving your
coding agent.
从自然语言描述生成有效的FlowZap Code(.fz)图表,验证它们,并返回可分享的在线演示链接——全程无需离开你的代码代理工具。
When to use this skill
何时使用此技能
- User asks for a workflow, flowchart, process diagram, or sequence diagram.
- User pastes HTTP logs, OpenAPI specs, or code and wants them visualised.
- User wants to compare two diagram versions (diff) or patch an existing diagram.
- 用户需要创建工作流、流程图、流程图表或序列图时
- 用户粘贴HTTP日志、OpenAPI规范或代码,希望将其可视化时
- 用户想要对比两个图表版本(差异对比)或修补现有图表时
MCP server setup (one-time)
MCP服务器设置(一次性操作)
If the FlowZap MCP server is not already configured, install it:
bash
undefined如果尚未配置FlowZap MCP服务器,请按以下步骤安装:
bash
undefinedClaude Code
Claude Code
claude mcp add --transport stdio flowzap -- npx -y flowzap-mcp@1.3.5
claude mcp add --transport stdio flowzap -- npx -y flowzap-mcp@1.3.5
Or add to .mcp.json / claude_desktop_config.json / cursor / windsurf config:
或添加到 .mcp.json / claude_desktop_config.json / cursor / windsurf 配置文件中:
{
"mcpServers": {
"flowzap": {
"command": "npx",
"args": ["-y", "flowzap-mcp@1.3.5"]
}
}
}
Compatible tools: Claude Desktop, Claude Code, Cursor, Windsurf, OpenAI Codex,
Warp, Zed, Cline, Roo Code, Continue.dev, Sourcegraph Cody.
**Not compatible (use public API instead):** Replit, Lovable.dev.{
"mcpServers": {
"flowzap": {
"command": "npx",
"args": ["-y", "flowzap-mcp@1.3.5"]
}
}
}
兼容工具:Claude Desktop、Claude Code、Cursor、Windsurf、OpenAI Codex、Warp、Zed、Cline、Roo Code、Continue.dev、Sourcegraph Cody。
**不兼容工具(请改用公共API):** Replit、Lovable.dev。Available MCP tools
可用的MCP工具
| Tool | Purpose |
|---|---|
| Check .fz syntax before sharing |
| Get a shareable playground URL |
| Retrieve full DSL docs at runtime |
| Export diagram as structured JSON (lanes, nodes, edges) |
| Parse HTTP logs / OpenAPI / code → diagram + playground URL |
| Structured diff between two .fz versions |
| Patch a diagram (insert/remove/update nodes/edges) |
| 工具 | 用途 |
|---|---|
| 分享前检查.fz语法 |
| 获取可分享的在线演示链接 |
| 运行时获取完整DSL文档 |
| 将图表导出为结构化JSON(泳道、节点、边) |
| 解析HTTP日志/OpenAPI/代码 → 生成图表+在线演示链接 |
| 两个.fz版本之间的结构化差异对比 |
| 修补图表(插入/删除/更新节点/边) |
FlowZap Code DSL — quick reference
FlowZap Code DSL — 快速参考
FlowZap Code is not Mermaid, not PlantUML. It is a unique DSL.
FlowZap Code 不是 Mermaid,也不是 PlantUML。它是一种独特的DSL。
Shapes (only 4)
形状(仅4种)
| Shape | Use for |
|---|---|
| Start / End events |
| Process steps / actions |
| Decisions (Yes/No branching) |
| Assigned tasks ( |
| 形状 | 用途 |
|---|---|
| 开始/结束事件 |
| 流程步骤/操作 |
| 决策(是/否分支) |
| 分配的任务( |
Syntax rules
语法规则
- Node IDs are globally unique, sequential, no gaps: ,
n1,n2…n3 - Node attributes use colon:
label:"Text" - Edge labels use equals inside brackets:
[label="Text"] - Handles are required on every edge:
n1.handle(right) -> n2.handle(left) - Directions: ,
left,right,topbottom - Cross-lane edges: prefix target with lane name:
sales.n5.handle(top) - Lane display label: one comment right after opening brace
# Label - Loops: — flat, inside a lane block
loop [condition] n1 n2 n3 - Layout: prefer horizontal left→right; use top/bottom only for cross-lane hops
- 节点ID 全局唯一、连续无间隔:、
n1、n2……n3 - 节点属性 使用冒号:
label:"Text" - 边标签 在括号内使用等号:
[label="Text"] - 每个边都必须包含句柄:
n1.handle(right) -> n2.handle(left) - 方向:、
left、right、topbottom - 跨泳道边:目标节点前添加泳道名称前缀:
sales.n5.handle(top) - 泳道显示标签:在左大括号后添加一个注释
# Label - 循环:—— 平级放置在泳道块内部
loop [condition] n1 n2 n3 - 布局:优先使用水平从左到右;仅在跨泳道跳转时使用上下方向
Gotchas — never do these
注意事项——切勿执行以下操作
- Do NOT use on nodes (must be
label="Text").label:"Text" - Do NOT use on edges (must be
label:"Text").[label="Text"] - Do NOT skip node numbers (n1, n3 → invalid; must be n1, n2).
- Do NOT omit lane prefix on cross-lane edges.
- Do NOT output Mermaid, PlantUML, or any other syntax.
- Do NOT add comments except the single per lane.
# Display Label - Do NOT place outside a lane's braces.
loop - Do NOT use a shape unless the user explicitly requests it.
taskbox
- 不要在节点上使用(必须是
label="Text")label:"Text" - 不要在边上使用(必须是
label:"Text")[label="Text"] - 不要跳过节点编号(n1、n3 → 无效;必须是n1、n2)
- 跨泳道边不要省略泳道前缀
- 不要输出Mermaid、PlantUML或任何其他语法
- 除了每个泳道的单个注释外,不要添加其他注释
# 显示标签 - 不要将放在泳道的大括号外部
loop - 除非用户明确要求,否则不要使用形状
taskbox
Minimal templates
最小模板
Single lane:
process { # Process
n1: circle label:"Start"
n2: rectangle label:"Step"
n3: circle label:"End"
n1.handle(right) -> n2.handle(left)
n2.handle(right) -> n3.handle(left)
}Two lanes with cross-lane edge:
user { # User
n1: circle label:"Start"
n2: rectangle label:"Submit"
n1.handle(right) -> n2.handle(left)
n2.handle(bottom) -> app.n3.handle(top) [label="Send"]
}
app { # App
n3: rectangle label:"Process"
n4: circle label:"Done"
n3.handle(right) -> n4.handle(left)
}Decision branch:
flow { # Flow
n1: rectangle label:"Check"
n2: diamond label:"OK?"
n3: rectangle label:"Fix"
n4: rectangle label:"Proceed"
n1.handle(right) -> n2.handle(left)
n2.handle(bottom) -> n3.handle(top) [label="No"]
n2.handle(right) -> n4.handle(left) [label="Yes"]
}For the full DSL specification and advanced multi-lane examples: See references/syntax.md
单泳道:
process { # 流程
n1: circle label:"开始"
n2: rectangle label:"步骤"
n3: circle label:"结束"
n1.handle(right) -> n2.handle(left)
n2.handle(right) -> n3.handle(left)
}带跨泳道边的双泳道:
user { # 用户
n1: circle label:"开始"
n2: rectangle label:"提交"
n1.handle(right) -> n2.handle(left)
n2.handle(bottom) -> app.n3.handle(top) [label="发送"]
}
app { # 应用
n3: rectangle label:"处理"
n4: circle label:"完成"
n3.handle(right) -> n4.handle(left)
}决策分支:
flow { # 流程
n1: rectangle label:"检查"
n2: diamond label:"是否正常?"
n3: rectangle label:"修复"
n4: rectangle label:"继续"
n1.handle(right) -> n2.handle(left)
n2.handle(bottom) -> n3.handle(top) [label="否"]
n2.handle(right) -> n4.handle(left) [label="是"]
}完整DSL规范和高级多泳道示例:请查看 references/syntax.md
Workflow: how to generate a diagram
工作流:如何生成图表
- Identify the actors/systems (→ lanes) and steps (→ nodes) from the user's description.
- Write FlowZap Code following all rules above.
- Call to verify syntax.
flowzap_validate - If valid, call to get a shareable URL.
flowzap_create_playground - Return the FlowZap Code and the playground URL to the user.
- Always output only raw FlowZap Code when showing the diagram — no Markdown fences wrapping .fz content, no extra commentary mixed in.
- 从用户描述中识别参与者/系统(→ 泳道)和步骤(→ 节点)
- 按照上述所有规则编写FlowZap Code
- 调用验证语法
flowzap_validate - 如果验证通过,调用获取可分享链接
flowzap_create_playground - 向用户返回FlowZap Code 和在线演示链接
- 展示图表时,始终只输出原始FlowZap Code——不要用Markdown围栏包裹.fz内容,不要混入额外评论
Fallback: public API (no MCP)
备选方案:公共API(无需MCP)
If the MCP server is unavailable, use the public REST API (no auth required):
- Validate: with
POST /api/validatebody{"code": "..."} - Create playground: with
POST /api/playground/createbody (5/min, 50/day){"code": "..."}
Privacy: The flowzap.xyz API does not store user data. Sessions expire after 15 minutes.
Full API documentation: flowzap.xyz/docs/mcp
如果MCP服务器不可用,使用公共REST API(无需认证):
- 验证: ,请求体为
POST /api/validate{"code": "..."} - 创建在线演示: ,请求体为
POST /api/playground/create(限制:每分钟5次,每天50次){"code": "..."}
隐私说明: flowzap.xyz API不会存储用户数据。会话15分钟后过期。
完整API文档:flowzap.xyz/docs/mcp