agentleFS
Willian8021743Willian8021743/windows-ai-toolkit/skills/mermaid-to-vsdx/SKILL.md

mermaid-to-vsdx

Skill1 starsChanged 45 days agoMITView on GitHub

Convert Mermaid flowchart syntax directly to Microsoft Visio VSDX files using standard BASFLO shapes

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Start/End (rounded rect) = Master 2

    line 40
  2. Very specific:

    All connectors need BegTrigger/EndTrigger with _XFTRIGGER(Sheet.X!EventXFMod)

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Windows 环境:技能目录为 C:\Users\Willian.agents\skills\mermaid-to-vsdx,脚本请用绝对路径或先 cd 进技能目录;产物写到当前工作目录。本机没有 LibreOffice(soffice),依赖它做渲染、缩略图、接受修订、公式重算的步骤会失败,其余 Python 操作正常。

Mermaid → Visio VSDX Converter

Convert Mermaid flowchart diagrams into real Microsoft Visio VSDX files with standard BASFLO symbols (Start/End, Process, Decision, dynamic connectors). Works without Visio installed — pure Python.

When to Use

User says "convert to Visio", "export VSDX", "generate visio file", or needs a flowchart in Visio format.

How It Works

Uses templates/reference.vsdx as a skeleton — a handwritten Visio file with BASFLO masters and theme. Only visio/pages/page1.xml is replaced; all other files (masters, themes, styles) are kept intact. The Python script parses Mermaid syntax, lays out shapes in columns, computes connector routes, and writes a valid VSDX.

Usage

python scripts/gen_vsdx.py 'mermaid_text' output.vsdx

Setup

Python 3 only (stdlib — no extra libraries needed).

Procedure

  1. Get Mermaid text from user (e.g. graph TD; A[Start] --> B[Process])
  2. Run: python3 scripts/gen_vsdx.py 'flowchart_text' output.vsdx
  3. Send VSDX back to user

⚠️ Key Details

Master ID Mapping (BASFLO_U.VSSX)

  • Start/End (rounded rect) = Master 2
  • Process (rect) = Master 5
  • Decision (diamond) = Master 4
  • Dynamic connector (line) = Master 6

Must-Have: RecalcDocument=true

Without it in docProps/custom.xml, connectors pile up in Visio.

Connector Strategy

  • Vertical: Begin=PAR(PNT(src!Connections.X3)), End=_WALKGLUE, ConFixedCode=5
  • Horizontal: PAR(PNT(src!Connections.X2)) → PAR(PNT(tgt!Connections.X1))
  • L-shape: _WALKGLUE begin, PAR(PNT(...)) end. Geometry: first horizontal then vertical
  • Connects always use ToCell="PinX" ToPart="3"
  • All connectors need BegTrigger/EndTrigger with _XFTRIGGER(Sheet.X!EventXFMod)

Shapes Must NOT Set Width/Height

Inherit from Master. Only PinX/PinY, LayerMember, LineWeight, LineColor, FillBkgnd, Character.

Known Limitations

  • TD layout only, no subgraph/swimlane
  • BASFLO symbol set only (extensible)

Author

Simon Chen — szhzz.com

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.