Loading...
Loading...
Compare original and translation side by side
drawio-ai-kitdrawio-aidrawio-ai-kitdrawio-aicommand -v drawio-ai >/dev/null 2>&1 || echo "Install the Kit first: npm i -g github:sparklabx/drawio-ai-kit"drawio-ainpm i -g github:sparklabx/drawio-ai-kitnpm i -gcommand -v drawio-ai >/dev/null 2>&1 || echo "请先安装工具包:npm i -g github:sparklabx/drawio-ai-kit"drawio-ainpm i -g github:sparklabx/drawio-ai-kitnpm i -g<...>Build a BPMN swimlane .drawio diagram with the drawio-ai CLI.
Request: <user's request + clarifications, verbatim>
Output: <ABS_PROJECT_DIR>/<NAME>.drawio — never write inside the Kit, never into cwd.
Follow exactly:
1. Set ROOT="$(drawio-ai root)". Read $ROOT/docs/api-cheatsheet.md — the full layout-engine
API in one file; never read library source.
2. Run `drawio-ai workflow` and `drawio-ai principles --mode bpmn` — the source of
truth. (Fallback if a command is blocked: read $ROOT/rules/*.md directly.)
3. Look up every icon with ONE batched `drawio-ai search "a, b, c"`; never recolor icons.
4. Scaffold, don't write: `drawio-ai scaffold --list`, pick the closest template, then
`drawio-ai scaffold <name>.mjs -o <dir>/build.mjs` — the script arrives runnable
(absolute imports, self-validating, self-rendering with an issues list). Edit only the
deltas. If no template is close AND you'd change more than half of it, Write a new
script instead (keep the scaffold's self-check tail). Layout engine only
(group/frame/grid/icon/box + renderTree), NO hand-written coordinates.
5. Each `node build.mjs` run prints validate JSON AND the render's machine-readable
`issues` list. Fix from THAT checklist — all issues in one Edit round — then re-run.
Loop until issues is empty.
6. Only when issues is empty: Read the PNG once as final visual confirmation (list any
remaining visual problems, fix ALL in one round). Target <= 2 PNG reads total. Then
render once WITHOUT --check for the final deliverable PNG.
Do NOT invoke any drawio skill — this prompt already contains the full procedure.
Do not ask questions — make the standard choice and record it under ASSUMPTIONS.
Return EXACTLY this block, nothing else:
DRAWIO: <absolute path to .drawio>
PNG: <absolute path to .png>
VALIDATE: <verbatim final validate JSON>
ICONS: <comma-separated icon names used>
ITERATIONS: <number of render/fix cycles>
SUMMARY: <one sentence describing the diagram>
ASSUMPTIONS: <choices made without asking, or "none">DRAWIOPNGSUMMARYVALIDATE<...>使用drawio-ai CLI构建BPMN泳道.drawio图。
请求:<用户的请求+澄清内容,原文照搬>
输出:<ABS_PROJECT_DIR>/<NAME>.drawio — 切勿写入工具包目录或当前工作目录。
严格遵循以下步骤:
1. 设置ROOT="$(drawio-ai root)". 阅读$ROOT/docs/api-cheatsheet.md — 该文件包含完整的布局引擎API;切勿读取库源代码。
2. 运行`drawio-ai workflow`和`drawio-ai principles --mode bpmn` — 这是事实来源。(如果命令被阻止, fallback方案:直接读取$ROOT/rules/*.md文件。)
3. 使用一次批量命令`drawio-ai search "a, b, c"`查找所有图标;切勿重新着色图标。
4. 搭建脚手架,而非从头编写:`drawio-ai scaffold --list`,选择最接近的模板,然后运行`drawio-ai scaffold <name>.mjs -o <dir>/build.mjs` — 生成的脚本可直接运行(绝对导入、自验证、自渲染并附带问题列表)。仅修改差异部分。如果没有接近的模板且需要修改超过一半内容,则编写新脚本(保留脚手架的自检尾部)。仅使用布局引擎(group/frame/grid/icon/box + renderTree),**禁止手写坐标**。
5. 每次运行`node build.mjs`都会输出验证JSON以及渲染后的机器可读`issues`列表。根据该清单修复——一次性修复所有问题——然后重新运行。循环直到issues为空。
6. 仅当issues为空时:读取一次PNG作为最终视觉确认(列出所有剩余视觉问题,一次性修复所有问题)。目标是总共读取PNG不超过2次。然后不带--check参数渲染一次,生成最终交付的PNG。
请勿调用任何drawio技能 — 本提示词已包含完整流程。
请勿提问 — 做出标准选择并记录在ASSUMPTIONS下。
仅返回以下内容块,别无其他:
DRAWIO: <.drawio文件的绝对路径>
PNG: <.png文件的绝对路径>
VALIDATE: <最终验证JSON原文>
ICONS: <使用的图标名称,逗号分隔>
ITERATIONS: <渲染/修复循环次数>
SUMMARY: <描述该图的一句话>
ASSUMPTIONS: <未询问用户做出的选择,或"无">DRAWIOPNGSUMMARYVALIDATEdrawio-ai workflowdrawio-ai workflowdrawio-ai principles --mode bpmndrawio-ai principles --mode bpmnimportROOT="$(drawio-ai root)" # absolute path to the installed Kitsrc/bpmn.mjspool()drawio-ai validate <file>drawio-ai render <file> -o <file>.pngRead.drawiocwdimportROOT="$(drawio-ai root)" # 已安装工具包的绝对路径src/bpmn.mjspool()drawio-ai validate <file>drawio-ai render <file> -o <file>.png.drawiopool → lanes (roles) × phases (milestones)src/bpmn.mjsstartintermediateendgatewayuserTaskserviceTaskmanualTaskscriptTaskbusinessRuleTasktasksubProcess{ lane, col }orientation: "vertical"pool()pool → lanes(角色)× phases(里程碑)src/bpmn.mjsstartintermediateendgatewayuserTaskserviceTaskmanualTaskscriptTaskbusinessRuleTasktasksubProcess{ lane, col }pool()orientation: "vertical"drawio-ai validatedrawio-ai searchdrawio-ai renderdrawio-ai validatedrawio-ai searchdrawio-ai render