npx skills add ...
npx skills add pengjunchi0/codex-visio-paper-figure-skill --skill 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, 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.
npx skills add pengjunchi0/codex-visio-paper-figure-skill --skill visio-image-rebuilder
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 after the Visio page has been rebuilt or restyled and checked for native editability.
Inspect inputs.
.vsdx, reference image, requested output formats, and output directory..vsdx package for pages, media entries, and shape counts.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.
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 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.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:
For rebuild plus multi-format export, run:
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.
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"