Visio Template Drawing
SkillDev toolsCreate editable Microsoft Visio drawings (.vsdx) from PNG references, text specifications, or existing Visio templates. Use when Codex needs background Visio COM automation, VSDX output, template-based diagram recreation, screenshot-to-Visio conversion, or editable scientific/technical diagrams. Save .vsdx by default; export PNG previews only when explicitly requested.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Visio Template Drawing skill
What this skill tells your AI
The instructions your AI receives, as published by zxc-heu/visio-template-drawing-skill in skill/visio-template-drawing/SKILL.md and read by ahel’s review.
Goal
Create real, editable .vsdx diagrams with Microsoft Visio COM. Use editable Visio shapes, connectors, and text; do not satisfy the task by pasting a reference PNG as the final diagram.
Defaults
- Output format:
.vsdx. - Local input file: save beside the input as
<source-file-stem>_codex.vsdx. - Pasted chat image with no local path: save to the desktop with a descriptive
_codex.vsdxname. - User-specified output path or filename overrides defaults.
- Do not export PNG unless the user explicitly asks for a preview, screenshot, or visual QA.
- Draw completely in the background by default using a new owned
Visio.InvisibleApp; close task documents and verify process exit after completion or failure. -Visibleshows the process but still closes it;-KeepOpenindependently retains only a successfully completed final document. Never use either switch without the corresponding user request.- Do not use system clipboard, active selections, mouse, keystrokes, or arbitrary existing Visio instances for background work. Explain any operation requiring foreground interaction before starting it.
Workflow
- Confirm inputs and output path. Run
scripts/visio_probe.ps1if Visio COM availability is uncertain. - Analyze the reference semantically: diagram type, layout, labels, shape families, connectors, grouping, colors, images, and any salient geometry.
- Choose Visio-native stencils/masters before primitives. Start from
references/master-catalog.md; if the needed master is missing, use local master discovery rather than guessing. - Build a drawing plan using
references/drawing-plan-schema.md. - For non-trivial diagrams, run
scripts/validate_plan_layout.pybefore drawing. Treat unintentional text/image overlap, unintentional image/image overlap, and page overflow as plan errors that must be fixed before Visio automation. If the reference clearly uses overlays or stacked images, mark the intended overlap explicitly in the plan. - Draft and iterate internally first. Do not show rough intermediate versions to the user.
- Use the managed
visio_draw_from_plan.ps1entry point for single or multi-page plans. Draw directly into one document; do not invent clipboard-based merge scripts. Readreferences/session-lifecycle.mdfor modes, timeout/cancellation, logs, and recovery. Save and optionally export in that same session. - Check
result.jsonplus the watchdog recovery result. A saved file alone is not success: verify structure, text, connections, and cleanup. Report the artifact, run-log path, fallbacks, and any unresolved process or file lock.
Drawing Principles
- Think like a skilled Visio user, not a geometry renderer: classify the diagram's semantic family first, then prefer template shapes and Visio stencil masters through explicit COM references before primitives or custom geometry. Use raster images only for photo-like content or user-approved non-editable elements.
- Do not hand-draw a known Visio shape family. Search built-in stencils and drop masters by
NameU; run a small proof when a newly discovered master will be reused. - Use native dynamic connectors with glued endpoints for semantic connections. Use straight lines only when the reference or user explicitly calls for straight geometry.
- For converging or bundled connectors, prioritize readable topology first; prefer smooth curves only when they do not reduce clarity.
- Route connectors as first-class layout objects. Connector paths must not run through independent labels or non-endpoint node bodies; reserve gaps around branch labels, formulas, and filled nodes. Preserve the reference line style first; if a line is visibly straight, prefer nudging nearby nodes/labels slightly over converting it into an angular detour.
- For freehand-looking curves, use editable COM spline, Bezier, or polygon geometry in background mode and state any approximation. Exact use of the native "Freeform/任意多边形(F)" UI tool requires prior explanation and explicit interactive authorization; never silently switch to foreground input.
- Distinguish Visio UI tools from COM fallbacks. In particular, closed
polygon,ribbon,DrawPolyline, andDrawSplineoutputs are not the same as the Tools menu "Freeform/任意多边形(F)" command. - Preserve salient visual logic from the reference when it affects meaning or recognition, including connector style, perspective, grouping, repeated shape families, and arrow direction.
- Allocate layout regions before placing details. Photographic images, their labels, legend color chips, connector fan-in/fan-out corridors, and module blocks each need reserved space by default. A label, chip, or image may overlap another object only when the reference clearly uses an overlay/stacked design or the drawing plan explicitly marks the overlap as intentional.
- Use text for label symbols and formulas; do not draw label bars, dashes, formula operators, or mathematical marks as geometry.
- Use SimSun/宋体 for Chinese text and Times New Roman for English, numbers, and mathematical notation by default.
- For MathType-like labels, use
richTextspans so one Visio text box can contain character-level font, italic, subscript, and superscript formatting. - If a known flowchart or diagram shape is visible in a screenshot, search template/stencil masters before approximating it with primitives.
Verification
Before final delivery, check that:
- main diagram elements are editable Visio objects, not a pasted screenshot;
- labels and formulas remain editable text;
- connectors and repeated objects preserve the reference's visual logic where practical;
- layout preflight passes for non-trivial plans, especially no unintended label-on-image collisions and no page overflow;
- output path follows the defaults or the user's explicit instruction;
- no PNG preview was generated unless requested;
- the owned PID exited (or the final document was explicitly retained), original errors are preserved, and unresolved cleanup is reported.
Resources
- Use
scripts/visio_draw_from_plan.ps1to draw from one or more JSON plans; an atlas may use apagesarray. - Read
references/session-lifecycle.mdbefore changing ownership, cleanup, cancellation, or recovery; usescripts/visio_recover.ps1to inspect a prior run. - COM workers always use Windows PowerShell 5.1 STA, including when launched from PowerShell 7. Do not reuse
Document.Activate,doc.Windows, orMarshal.GetActiveObjectrecovery snippets. - Use
scripts/validate_plan_layout.pybefore drawing non-trivial screenshot-derived plans. - Use
scripts/visio_export_preview.ps1only when PNG preview output is requested. - Read
references/master-catalog.mdbefore selecting or discovering Visio masters. - Read
references/drawing-plan-schema.mdfor plan fields, includingrichText. - Read
references/visio-com-notes.mdbefore changing automation, master lookup, connector behavior, or character formatting.
Signals
- GitHub stars
- 31
- Forks
- 4
- Last commit
- Sep 2026
ahel review
K6low
bundled executables the agent is told to runK5info
obfuscation (in scripts/test_visio_interruptions.ps1)K5info
obfuscation (in scripts/test_visio_lifecycle.ps1)K5info
obfuscation (in scripts/visio_draw_from_plan.ps1)K5info
obfuscation (in scripts/visio_export_preview.ps1)K5info
obfuscation (in scripts/visio_probe.ps1)K5info
obfuscation (in scripts/visio_recover.ps1)K5info
obfuscation (in scripts/visio_render.ps1)
Automated review, not a security audit. Ruleset v1+k2.
Advanced
- Catalog kind
- skill
- Gateway key
visio-template-drawing- Source
- github.com/zxc-heu/visio-template-drawing-skill