Agent skill

Visio Image Rebuilder

by pengjunchi0 in pengjunchi0/codex-visio-paper-figure-skill

Rebuilds or restyles diagrams as editable native Visio shapes from a reference image or .vsdx file, then exports .vsdx, PNG, SVG, PDF or PPTX.

MITAuto-check passedDocuments & Office

Install Visio Image Rebuilder

skills CLI
$ npx skills add pengjunchi0/codex-visio-paper-figure-skill --skill visio-image-rebuilder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pengjunchi0/codex-visio-paper-figure-skill visio-image-rebuilder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
visio-image-rebuilder
GitHub stars
1k
Token cost
~2k tokens
SKILL.md length
966 words
Files
8 (incl. scripts, references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Rebuilds or restyles diagrams as editable native Visio shapes from a reference image or .vsdx file, then exports .vsdx, PNG, SVG, PDF or PPTX.

  • Works in 6 steps: Inspect inputs. → Decode the reference image. → Prefer Visio automation for native edits. → …
  • Recreating a diagram from a PNG, JPG or screenshot as an editable Visio file
  • SKILL.md covers Core Rule, Workflow, Implementation Pattern and Safety Checklist, plus 2 more sections
  • Runs PowerShell scripts from its folder

What it does

The core rule is that a rebuild must produce real Visio content, never a page with the reference picture pasted in. A reference image may serve only as a temporary tracing layer, and it has to be removed or hidden before delivery so the .vsdx keeps native shapes, text, connectors and groups. The .vsdx file is treated as the source of truth, and PNG, SVG, PDF or PPTX exports come only after the page has been rebuilt and checked.

The workflow starts by confirming paths, exporting the current page to PNG, inspecting the package and backing up the target before any write. The reference is then decoded into an inventory of containers, titles, boxes, icons, charts, connectors and captions, with the canvas and each major panel calibrated by explicit bounds before small details are drawn. Edits go through Visio COM automation on Windows, with package XML edits kept for narrow, deterministic changes. PowerShell scripts cover page tools, a rebuild scaffold and format export, and a reference file holds rebuild guidelines.

When your agent uses it

  • Recreating a diagram from a PNG, JPG or screenshot as an editable Visio file
  • Changing colors, typography or layout in an existing .vsdx
  • Fixing shifted or overlapping submodules in a multi-panel scientific figure
  • Exporting a finished Visio page as PDF, SVG or PPTX for a paper or slides

Example prompts

  • “Rebuild the model figure in ./figs/overview.png as an editable Visio diagram.”
  • “Restyle ./figs/pipeline.vsdx to match the colors of this reference image and export a PDF.”
  • “The panels in my architecture figure overlap. Recalibrate the layout and export SVG and PNG versions.”

Requirements

  • Windows with Microsoft Visio installed
  • PowerShell

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Inspect inputs.
  2. Decode the reference image.
  3. Prefer Visio automation for native edits.
  4. Use package XML edits only for narrow, deterministic changes.
  5. Export requested formats from the verified Visio source.
  6. Verify without overtrusting a single signal.

What it can do on your machine

Read from SKILL.md and the folder at commit 816960d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (PowerShell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Visio Image Rebuilder loads about 2k tokens when it runs, and up to ~4.6k if it reads all its reference files. Until then it costs about 146 tokens; SKILL.md has 966 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~146
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from pengjunchi0/codex-visio-paper-figure-skill at commit 816960d, republished under its MIT licence (© pengjunchi0). 966 words, ~2,035 tokens.

Download SKILL.mdSave it as .claude/skills/visio-image-rebuilder/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
visio-image-rebuilder
description
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.

Visio Image Rebuilder

Core Rule

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.

Workflow

  1. Inspect inputs.

    • Confirm paths for the target .vsdx, reference image, requested output formats, and output directory.
    • Export the current Visio page to PNG before editing when a target file already exists.
    • Inspect the .vsdx package for pages, media entries, and shape counts.
    • Back up the target file before any write.
    • If Visio is already open, close only the target document or ask before terminating a stuck process.
  2. Decode the reference image.

    • Identify page orientation, panel boundaries, module colors, captions, text hierarchy, arrows, dashed lines, and repeated motifs.
    • Build an object inventory: containers, titles, process boxes, icons, charts, graphs, equations, connectors, captions.
    • Calibrate the canvas first, then calibrate each major panel or subpanel with explicit top-left bounds or four corner points.
    • Draw panel internals in panel-local normalized coordinates whenever the figure has dense multi-panel content.
    • Decide whether the task is a full rebuild, color/style transfer, local edit, or export-only job.
    • For dense scientific figures, first create a coarse panel map, then draw panel internals. Do not start with small decorative details.
  3. Prefer Visio automation for native edits.

    • Use COM automation on Windows when Visio is installed.
    • Use DrawRectangle, DrawOval, DrawLine, Page.Import only for small source assets, and shape cells such as FillForegnd, LineColor, LineWeight, Char.Size, Char.Color, Rounding.
    • Use explicit coordinates and IDs for fragile edits.
    • Keep grouped structure meaningful: major panels, submodules, repeated blocks, legends.
    • For nested modules, use helpers such as RectRel, TextRel, LineRel, and OvalRel so child shapes are constrained by their calibrated parent panel.
  4. Use package XML edits only for narrow, deterministic changes.

    • XML patching is appropriate for recoloring existing shapes, replacing font tables, or changing known cell values.
    • Preserve Visio XML ordering: shape-level Cell nodes should be before Section, Text, or child Shapes.
    • Avoid rebuilding complex geometry by raw XML unless COM automation is unavailable.
  5. Export requested formats from the verified Visio source.

    • Use scripts/visio_page_tools.ps1 for export-only jobs.
    • Use scripts/visio_rebuild_scaffold.ps1 with -ExportFormats for rebuilds that should immediately create deliverables.
    • Prefer SVG for vector web/manuscript handoff, PDF for review/print, and PPTX for presentation decks.
    • For PPTX, use PowerPoint COM when available; the generated slide contains the Visio page render, usually inserted from SVG.
  6. Verify without overtrusting a single signal.

    • Export at least one preview after editing when possible.
    • Inspect the .vsdx package to confirm that no full-size reference PNG/JPG was left in visio/media.
    • Check shape count and representative text labels.
    • Check that major panels do not overlap and that child shapes stay within their intended panel bounds.
    • Check every requested output file exists and is non-empty.
    • If Visio automation hangs, stop safely, close the document if possible, and report whether the file was actually modified.
Show full SKILL.md (435 more words)Show less

Implementation Pattern

For full rebuilds, generate a script that:

  • Opens the target .vsdx with Visio COM.
  • Saves a timestamped or descriptive backup.
  • Clears or duplicates the page depending on user preference.
  • Sets page size to match the reference aspect ratio.
  • Draws native shapes in top-left reference coordinates converted to Visio coordinates.
  • Defines calibrated panel bounds for complex regions and uses panel-local coordinates for their internals.
  • Adds reusable helpers for rectangles, text boxes, ovals, lines, arrows, mini charts, graph nodes, and image-like stacks.
  • Saves the document and exports requested formats.

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:

  • Reads existing shape IDs, text, approximate geometry, fill, and line colors.
  • Maps known modules to target palettes by text and group context.
  • Applies fills, borders, text colors, line patterns, and font changes to existing shapes.
  • Avoids repositioning unless the user asks for layout changes.
  • Exports only after the .vsdx has been saved and inspected.

For export-only requests, run:

powershell
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
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"

Safety Checklist

  • Back up before writing outside the workspace.
  • Close any open Visio document that locks the target file before direct package edits.
  • Never delete or revert unrelated user files.
  • If a previous attempt embedded the reference image, restore from backup or remove the image shape before continuing.
  • Tell the user clearly whether the final file is native editable shapes or a flat embedded image.
  • Tell the user when PPTX export is a rendered slide rather than native PowerPoint shapes.

Acceptance Criteria

A Visio rebuild is acceptable only when:

  • Main panel positions, flow direction, captions, and module hierarchy match the reference at first glance.
  • Major panels are aligned to calibrated bounds, with no obvious submodule drift, collision, or cross-panel overlap.
  • Text remains editable and uses a consistent academic font, usually Times New Roman.
  • Repeated motifs are represented with reusable native shapes rather than pasted raster crops.
  • The final .vsdx package has no full-page raster reference image in visio/media.
  • Requested PNG/SVG/PDF/PPTX deliverables were exported from the saved .vsdx and are non-empty.
  • A preview export or package inspection was performed, or the final response explicitly states why verification was skipped.

Useful Resource

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.

© pengjunchi0, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references) in the repository root of pengjunchi0/codex-visio-paper-figure-skill.

  • SKILL.md
  • LICENSE
  • README.md
  • agents/openai.yaml
  • references/rebuild-guidelines.md
  • scripts/visio_export_formats.ps1
  • scripts/visio_page_tools.ps1
  • scripts/visio_rebuild_scaffold.ps1

Open the folder on GitHubat commit 816960d

Compare with similar skills

Visio Image Rebuilder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Visio Image Rebuilder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Visio Image Rebuilder this skillpengjunchi0/codex-visio-paper-figure-skill1k—~2kAutomated safety check: PassMIT
Editable Figure Designeryzhao062/anywhere-agents253—~7.2kAutomated safety check: PassApache-2.0
Xiaobei Skill Image To Vbaxiao24bei/xiaobei-skill586—~6.9kAutomated safety check: PassApache-2.0
Cn Academic Spark Ppt Enginewycmochi/cn-academic-spark121—~8.9kAutomated safety check: NotesMIT
Ccf Visual Composermikubaka88/CCFA-Skills3k—~2.4kAutomated safety check: PassMIT
Astra Figure WorkflowIamJerryXu/AstraDraw148—~1.9kAutomated safety check: PassNone

Similar skills

  • Editable Figure Designer

    yzhao062/anywhere-agents

    Designs editable PowerPoint overview figures, especially Figure 1 for papers and proposals, from source material and the author's own visual preferences.

    253 GitHub stars~7.2k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • Xiaobei Skill Image To Vba

    xiao24bei/xiaobei-skill

    A skill your agent uses when users want XiaoBei skill / xiaobei-skill / 小北在读研 style academic image-to-VBA reconstruction: convert academic figures, scientific diagrams, slides, screenshots, or other…

    586 GitHub stars~6.9k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Cn Academic Spark Ppt Engine

    wycmochi/cn-academic-spark

    Convert a complete academic source package, such as a paper, report, proposal, review outline, PDF, Word document, Markdown file, or pasted text, into a Chinese academic .pptx deck.

    121 GitHub stars~8.9k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check: notes
  • Ccf Visual Composer

    mikubaka88/CCFA-Skills

    Render and redesign CCF figures, visual tables, and method/architecture diagrams from supplied content.

    3k GitHub stars~2.4k tokensUpdated 24 days ago
    Documents & OfficeAuto-check passed
  • Astra Figure Workflow

    IamJerryXu/AstraDraw

    Design research method figures from an existing paper, retrieve visual priors from component or private PPTX libraries, produce editable diagrams, and revise selected objects while preserving…

    148 GitHub stars~1.9k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Pptgen Drawio

    xstongxue/best-skills

    根据论文或汇报内容生成多页 Draw.io 格式 PPT,支持论文答辩与通用汇报两种模式,自动导出为 .pptx。当用户提到论文答辩 PPT、答辩幻灯片、通用 PPT、汇报 PPT、根据模板生成 PPT、drawio2pptx 时使用。

    3k GitHub stars~2.1k tokensUpdated 28 days ago
    Documents & OfficeAuto-check passed

Questions about Visio Image Rebuilder

What does Visio Image Rebuilder do?

Rebuilds or restyles diagrams as editable native Visio shapes from a reference image or .vsdx file, then exports .vsdx, PNG, SVG, PDF or PPTX. The core rule is that a rebuild must produce real Visio content, never a page with the reference picture pasted in.vsdx keeps native shapes, text, connectors and groups.

When should I use Visio Image Rebuilder?

Visio Image Rebuilder fits situations like: recreating a diagram from a PNG, JPG or screenshot as an editable Visio file; changing colors, typography or layout in an existing .vsdx; fixing shifted or overlapping submodules in a multi-panel scientific figure; exporting a finished Visio page as PDF, SVG or PPTX for a paper or slides.

How do I install Visio Image Rebuilder in Claude Code?

Run `npx skills add pengjunchi0/codex-visio-paper-figure-skill --skill visio-image-rebuilder -a claude-code`. Or copy the skill folder (the pengjunchi0/codex-visio-paper-figure-skill repository) into .claude/skills/visio-image-rebuilder in your project. Claude Code loads it when a task matches its description.

How do I install Visio Image Rebuilder in Codex?

Run `npx skills add pengjunchi0/codex-visio-paper-figure-skill --skill visio-image-rebuilder -a codex`. Or copy the skill folder (the pengjunchi0/codex-visio-paper-figure-skill repository) into .agents/skills/visio-image-rebuilder in your project. Codex loads it when a task matches its description.

Can I use Visio Image Rebuilder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pengjunchi0/codex-visio-paper-figure-skill --skill visio-image-rebuilder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/visio-image-rebuilder, .gemini/skills/visio-image-rebuilder, .github/skills/visio-image-rebuilder and .opencode/skills/visio-image-rebuilder in your project.

What does Visio Image Rebuilder need to run?

Going by SKILL.md and its folder, Visio Image Rebuilder needs PowerShell for the scripts in its folder. Our summary lists: Windows with Microsoft Visio installed; PowerShell.

Does Visio Image Rebuilder access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Visio Image Rebuilder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Visio Image Rebuilder use?

Visio Image Rebuilder is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Visio Image Rebuilder use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.6k tokens, read only when the agent opens those files.

What are the alternatives to Visio Image Rebuilder?

Skills that share tags, products or a category with Visio Image Rebuilder: Editable Figure Designer (yzhao062/anywhere-agents, 253 stars), Xiaobei Skill Image To Vba (xiao24bei/xiaobei-skill, 586 stars), Cn Academic Spark Ppt Engine (wycmochi/cn-academic-spark, 121 stars) and Ccf Visual Composer (mikubaka88/CCFA-Skills, 3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Visio Image Rebuilder?

pengjunchi0 (a GitHub user) maintains it in pengjunchi0/codex-visio-paper-figure-skill, which has 1,006 GitHub stars. The repository was last updated on August 16, 2026.

Source: pengjunchi0/codex-visio-paper-figure-skill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.