flow-skill

GitHub

用于生成、编辑和验证 draw.io/diagrams.net 流程图 XML,支持基于形状库的图表创建、本地 XML 修改及图片导出。

skill/flow-skill/SKILL.md CodingFeng101/CanvasAnvil

Trigger Scenarios

需要生成 draw.io XML 格式的流程或架构图 对现有 XML 进行局部精确编辑 处理截断的 XML 输出续写 请求将流程图导出为 PNG/SVG 图像

Install

npx skills add CodingFeng101/CanvasAnvil --skill flow-skill -g -y
More Options

Non-standard path

npx skills add https://github.com/CodingFeng101/CanvasAnvil/tree/main/skill/flow-skill -g -y

Use without installing

npx skills use CodingFeng101/CanvasAnvil@flow-skill

指定 Agent (Claude Code)

npx skills add CodingFeng101/CanvasAnvil --skill flow-skill -a claude-code -g -y

安装 repo 全部 skill

npx skills add CodingFeng101/CanvasAnvil --all -g -y

预览 repo 内 skill

npx skills add CodingFeng101/CanvasAnvil --list

SKILL.md

Frontmatter
{
    "name": "flow-skill",
    "description": "Generate, edit, validate, and bundle draw.io or diagrams.net diagrams in XML form. Use for new diagrams, local XML edits, shape-library diagrams, truncated XML continuation, and local image export."
}

Flow Skill

Trigger

Use when the task requires draw.io or diagrams.net XML output, local XML editing, shape-library-backed diagrams, or exported image artifacts.

Order

  1. Classify the request.
  2. Read the required references.
  3. Produce or modify draw.io XML.
  4. Validate when needed.
  5. Export or bundle artifacts when requested.

Classification

  • prompts/display.md
    • new diagram
    • major rewrite
    • major relayout
    • any case where local editing is fragile
  • prompts/edit.md
    • current XML exists
    • change is small and precise
    • ids can remain stable
  • prompts/append.md
    • earlier XML output was truncated
  • prompts/router.md
    • routing decision needed before generation

Required References

  • references/xml-rules.md
  • references/edit-rules.md
  • references/shape-library-index.md
  • references/shape-libraries/<library>.md

Read the library file before generating any library-backed diagram.

Do not guess undocumented shape-library prefixes or shape names.

XML Contract

  • New diagrams should normally produce a full <mxGraphModel> with <root>.
  • All mxCell elements must be direct children of <root>.
  • Root cells must exist:
    • <mxCell id="0"/>
    • <mxCell id="1" parent="0"/>
  • Every id must be unique.
  • Every edge source and target must reference existing ids.
  • Preserve existing ids during local edits unless renaming is explicitly required.
  • Escape XML attribute values correctly.
  • Do not emit XML comments.

Output Contract

  • Prefer complete XML for new diagrams.
  • Prefer the smallest safe edit set for local changes.
  • Stop at a clean boundary when output length is at risk.
  • Continue from the exact next character when appending.

Scripts

  • scripts/validate-drawio-xml.mjs
  • scripts/export-drawio-image.mjs
  • scripts/build-flow-bundle.mjs

If the user specifies an output directory or file path, write artifacts there.

If the user does not specify an output location, create a new output folder automatically and write all artifacts there.

Do not write generated artifacts into the skill folder.

Deliverables

Preferred:

  • .drawio
  • png
  • metadata JSON

Optional on request:

  • svg
  • xmlpng

Version History

  • d33dc57 Current 2026-08-20 07:35

Same Skill Collection

skill/cad-skill/SKILL.md
skill/infographic-skill/SKILL.md
skill/poster-skill/SKILL.md
skill/ppt-skill/SKILL.md
skill/product-skill/SKILL.md

Metadata

Files
0
Version
3eacea1
Hash
bdc39c7e
Indexed
2026-08-20 07:35

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-26 15:08
浙ICP备14020137号-1