/visio-image-rebuilder:visio-image-rebuilderfrom visio-image-rebuilder
Rebuild or restyle editable Microsoft Visio diagrams from reference images and existing .vsdx files, then export deliverables as .vsdx, PNG, SVG, PDF, or PPTX. Use when the user asks Codex to open Visio, recreate a diagram from a PNG/JPG/screenshot/reference image, match a scientific model figure, batch-create Chinese technical-bid flowcharts, continue drawing another similar flowchart, update colors/typography/layout in a .vsdx, calibrate panel coordinates to avoid shifted or overlapping submodules, or make publication/presentation outputs while preserving Visio native editable shapes rather than embedding the reference image as a flat picture. For Chinese technical-bid flowcharts, default to the user's standard SimSun/宋体 12 pt technical-bid style and ask whether to use that default or reproduce the original image style when the two conflict.
Ships in visio-image-rebuilder. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Recreate the reference as editable Visio content. Do not satisfy a rebuild request by inserting the whole reference image into the page. Embedding the reference image is only allowed as a temporary locked tracing layer if it is removed or hidden before delivery and the final .vsdx remains native shapes, text, connectors, and groups.
Treat .vsdx as the source of truth. Export PNG, SVG, PDF, or PPTX only when the user asks for those formats or when a visual preview is needed for verification. For fast Chinese technical-bid flowchart work, the default deliverable is the saved .vsdx only.
When generating PowerShell automation scripts on Windows, keep the script body ASCII-only whenever practical. Raw Chinese string literals in .ps1 files can be mis-decoded by Windows PowerShell and may surface as parse errors or apparent Visio COM hangs.
For Chinese labels, build strings from escaped Unicode instead of embedding raw CJK text:
function UE([string]$text) {
return [regex]::Replace($text, '\\u([0-9A-Fa-f]{4})', {
param($m)
return [string]([char][Convert]::ToInt32($m.Groups[1].Value, 16))
})
}
$label = UE '\u8fdb\u5ea6\u7ba1\u63a7'
If a rebuild fails early, inspect the PowerShell parser output before assuming Visio COM is stuck.
Use this mode for repeated Chinese engineering, tender, bid, QA/QC, supervision, procurement, schedule, or change-management flowcharts, especially when the user says "continue drawing this one" or provides several screenshots in sequence.
.vsdx, run package inspection when practical, and do not create backup files or preview images unless the user explicitly asks or visual verification is needed.1.vsdx, 2.vsdx, 3.vsdx, or the user's requested base name..vsdx name in the output directory. Do not overwrite an existing .vsdx unless the user explicitly asks to overwrite or provides that exact target path..vsdx per reference with the same style profile and sequential names, without PNG/SVG/PDF/PPTX by default.UE or explicit Unicode code points.RGB(198,216,240); box border RGB(0,176,240) at 1 pt; connector color RGB(0,170,240) at 1 pt; Visio end arrow type 5 (05), medium end arrow size 2; arrow line weight 1 pt.165mm x 235mm (6.49in x 9.25in). Either portrait or landscape is acceptable when the larger dimension stays within 235 mm and the smaller dimension stays within 165 mm.Inspect inputs.
.vsdx, reference image, requested output formats, and output directory..vsdx does not exist and the task is a rebuild from an image, create a blank Visio document first, then back it up before drawing..vsdx package for pages, media entries, and shape counts..vsdx..vsdx, create a backup only when the user requests it or when overwriting would risk losing unrelated work.Decode the reference image.
Prefer Visio automation for native edits.
DrawRectangle, DrawOval, DrawLine, Page.Import only for small source assets, and shape cells such as FillForegnd, LineColor, LineWeight, Char.Size, Char.Color, Rounding.RectRel, TextRel, LineRel, and OvalRel so child shapes are constrained by their calibrated parent panel.Use package XML edits only for narrow, deterministic changes.
Cell nodes should be before Section, Text, or child Shapes.Export requested formats from the verified Visio source.
-PreviewPath and -ExportFormats unless the user asks for previews or secondary formats.scripts/visio_page_tools.ps1 for export-only jobs.scripts/visio_rebuild_scaffold.ps1 with -ExportFormats for rebuilds that should immediately create deliverables.Verify without overtrusting a single signal.
.vsdx exists is sufficient unless the user requests a preview..vsdx package to confirm that no full-size reference PNG/JPG was left in visio/media.For full rebuilds, generate a script that:
.vsdx with Visio COM..vsdx first when the target file does not exist..vsdx.-CreateBackup only when a backup is requested or needed for an existing file overwrite.Start from scripts/visio_rebuild_scaffold.ps1 when building a full reconstruction script. Copy it into the workspace and customize the Draw-ReferenceFigure function rather than editing the skill copy.
For style transfer, generate a script that:
.vsdx has been saved and inspected.For export-only requests, run:
powershell -ExecutionPolicy Bypass -File scripts\visio_page_tools.ps1 `
-VsdxPath "C:\path\figure.vsdx" `
-ExportFormats svg,pdf,pptx `
-OutputDir "C:\path\exports" `
-InspectPackage
For rebuild plus multi-format export, run:
powershell -ExecutionPolicy Bypass -File scripts\visio_rebuild_scaffold.ps1 `
-VsdxPath "C:\path\figure.vsdx" `
-PageW 16 `
-PageH 9 `
-RefW 1600 `
-RefH 900 `
-PreviewPath "C:\path\exports\figure.png" `
-ExportFormats svg,pdf,pptx `
-OutputDir "C:\path\exports"
For fast Chinese technical-bid flowchart rebuilds, save .vsdx only by omitting -PreviewPath and -ExportFormats:
powershell -ExecutionPolicy Bypass -File scripts\visio_rebuild_scaffold.ps1 `
-VsdxPath "C:\path\outputs\1.vsdx" `
-PageW 9.25 `
-PageH 6.49 `
-RefW 640 `
-RefH 400
-CreateBackup when preservation matters.A Visio rebuild is acceptable only when:
.vsdx package has no full-page raster reference image in visio/media..vsdx and are non-empty.Use scripts/visio_page_tools.ps1 for common inspection, backup, preview export, multi-format export, and package checks. Use scripts/visio_export_formats.ps1 when a custom task script needs reusable export helpers. Use scripts/visio_rebuild_scaffold.ps1 as the starting point for native-shape drawing scripts; it includes both global top-left helpers and panel-local calibrated helpers. Read references/rebuild-guidelines.md when a task requires a full figure reconstruction or careful one-to-one scientific diagram matching.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub caixinyu2017-star/xixi --plugin visio-image-rebuilderOther plugins' skills for the same job