gitmyhub

codex-visio-paper-figure-skill

PowerShell ★ 208 updated 2d ago

科研绘图skill、论文绘图skill、图片转visio等可编辑格式,将生成图转化为论文可编辑图,便于作者调整绘图细节

A PowerShell-based skill for AI coding assistants that guides converting static paper figures and PNG screenshots into fully editable Microsoft Visio files using native shapes and Visio's COM automation API.

PowerShellMicrosoft VisioCOM AutomationOpenAI Codexsetup: hardcomplexity 3/5

This repository is a skill for OpenAI Codex, the AI coding assistant, that helps researchers convert paper figures into editable Microsoft Visio diagrams. The core use case is a researcher who has a PNG screenshot, a reference image, or an AI-generated model architecture diagram and needs it rebuilt as a .vsdx file made of native Visio shapes rather than a flat image paste.

The distinction matters in academic work: a .vsdx file with native rectangles, arrows, text boxes, and groups lets an author change colors, reorder blocks, update labels, and adjust spacing before submitting or publishing. Embedding the original PNG instead looks the same at first glance but cannot be edited at the element level.

The skill defines a structured workflow for Codex to follow. It starts with analyzing the reference figure to identify panels, modules, arrows, dashed feedback lines, repeated elements like heatmap grids or node sequences, and any text that must be reproduced exactly. It then maps pixel coordinates from the reference image to Visio page coordinates and calls Visio's COM automation API to draw each element as a native shape. A separate validation step checks that the final .vsdx contains no large embedded image files, that all text remains editable, and that the layout matches the reference.

The repository includes two PowerShell scripts. One is a utility for backing up .vsdx files, exporting page previews as PNG, and inspecting the internal package structure of a .vsdx file. The other is a scaffold that provides helper functions for drawing rectangles, ovals, lines, arrows, and text at specified coordinates, giving Codex a starting point for writing a rebuild script.

The default style settings follow academic paper conventions: Times New Roman font, 0.9 to 1.2 point borders, low-saturation background colors, and consistent arrow styles. The tool runs on Windows with Microsoft Visio installed, since the COM automation layer requires Visio to be present.

Where it fits