
codex-visio-paper-figure-skill
Convert paper figures and AI-generated diagrams into editable Microsoft Visio (.vsdx) files with native shapes, text, and connectors, then export to SVG/PDF/PNG/PPTX
- Installs
- 225
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/reason-machines/codex-skills --skill codex-visio-paper-figure-skill- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads codex-visio-paper-figure-skill automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Codex Visio Paper Figure Skill
Skill by ara.so — Codex Skills collection.
Overview
The Codex Visio Paper Figure Skill transforms reference images (screenshots, AI-generated diagrams, paper figures) into editable Microsoft Visio .vsdx files composed of native shapes, text boxes, connectors, and groups. It's designed for academic paper workflows where you need to:
- Rebuild model architecture diagrams, flowcharts, and multi-panel scientific figures
- Replace embedded images with true vector graphics
- Maintain consistent styling across paper figures
- Export the same source
.vsdxto PNG, SVG, PDF, and PPTX
Core principle: The final .vsdx must use Visio native primitives (rectangles, circles, lines, text), NOT just embed the original reference image as a background.
Installation
Clone this skill repository into your Codex skills directory:
# Windows
git clone https://github.com/pengjunchi0/codex-visio-paper-figure-skill.git "$env:USERPROFILE\.codex\skills\codex-visio-paper-figure-skill"
Restart Codex or start a new session to load the skill.
Requirements
- Windows (Visio COM automation requires Windows)
- Microsoft Visio (for full drawing automation)
- PowerShell (for scripting)
- Microsoft PowerPoint (optional, for PPTX export)
- Codex Desktop or any Codex environment with local file access
Key Scripts
1. visio_rebuild_scaffold.ps1
Main scaffolding script for rebuilding diagrams with native Visio shapes.
Parameters:
-VsdxPath- Output.vsdxfile path-PageW,-PageH- Visio page dimensions (inches)-RefW,-RefH- Reference image pixel dimensions-PreviewPath- Path to save PNG preview-ExportFormats- Comma-separated:png,svg,pdf,pptx-OutputDir- Directory for exported files
Basic usage:
powershell -ExecutionPolicy Bypass -File scripts\visio_rebuild_scaffold.ps1 `
-VsdxPath "C:\work\model.vsdx" `
-PageW 16 `
-PageH 9 `
-RefW 1600 `
-RefH 900 `
-PreviewPath "C:\work\preview.png" `
-ExportFormats svg,pdf,pptx `
-OutputDir "C:\work\exports"
2. visio_page_tools.ps1
Utility for exporting existing .vsdx files and inspecting package structure.
Parameters:
-VsdxPath- Input.vsdxfile-ExportFormats- Formats to export-OutputDir- Export destination-OutputBaseName- Base name for exported files-InspectPackage- Check for embedded images (validation)
Example:
powershell -ExecutionPolicy Bypass -File scripts\visio_page_tools.ps1 `
-VsdxPath "C:\work\diagram.vsdx" `
-ExportFormats svg,pdf,pptx `
-OutputDir "C:\work\exports" `
-InspectPackage
3. visio_export_formats.ps1
Reusable export functions (PNG, SVG, PDF, PPTX). Sourced by other scripts.
Core Drawing Functions
The scaffold provides coordinate mapping helpers to prevent panel overlap in complex multi-panel figures:
Global Coordinate Mapping
# Convert reference image pixel coordinates to Visio page inches
$x_inch = Ref2Page $x_pixel "x"
$y_inch = Ref2Page $y_pixel "y"
Panel-Local Coordinates (v1.1.1+)
For complex diagrams with multiple panels, define panel boundaries and use relative coordinates:
# Define panel A boundaries (in reference pixel coordinates)
$panelA = @{ X0=50; Y0=50; X1=750; Y1=450 }
# Draw rectangle at 10% from panel left, 20% from top, 30% wide, 25% tall
RectRel -Panel $panelA -RelX 0.1 -RelY 0.2 -RelW 0.3 -RelH 0.25 `
-Fill "rgb(200,220,240)" -Line "rgb(80,100,120)" -LineW 1.5 `
-Label "Module A"
# Draw text at relative position within panel
TextRel -Panel $panelA -RelX 0.5 -RelY 0.1 `
-Text "Panel A Title" -FontSize 16 -Bold
# Draw oval
OvalRel -Panel $panelA -RelCX 0.5 -RelCY 0.8 -RelW 0.2 -RelH 0.1 `
-Fill "rgb(255,200,200)"
# Draw line within panel
LineRel -Panel $panelA -RelX1 0.3 -RelY1 0.5 -RelX2 0.7 -RelY2 0.5 `
-Arrow "End" -LineW 2
Validation Helpers
# Assert a bounding box stays within panel
Assert-RelBox -Panel $panelA -RelX 0.1 -RelY 0.2 -RelW 0.3 -RelH 0.25 `
-ElementName "Module A"
# Assert a point stays within panel
Assert-RelPoint -Panel $panelA -RelX 0.5 -RelY 0.9 -PointName "Label"
These helpers throw errors if elements exceed panel boundaries, preventing overlap and misalignment.
Real-World Example: Multi-Panel Architecture Diagram
Suppose you have a 1600×900px reference image with three panels:
# scripts/rebuild_architecture.ps1
param(
[string]$VsdxPath = "C:\papers\architecture.vsdx",
[string]$OutputDir = "C:\papers\exports"
)
# Dimensions
$pageW = 16
$pageH = 9
$refW = 1600
$refH = 900
# Define panels (in reference pixel coordinates)
$panelA = @{ X0=50; Y0=50; X1=750; Y1=450 } # Input Processing
$panelB = @{ X0=800; Y0=50; X1=1550; Y1=450 } # Model Architecture
$panelC = @{ X0=50; Y0=500; X1=1550; Y1=850 } # Output & Metrics
# Start Visio
$visio = New-Object -ComObject Visio.Application
$visio.Visible = $true
$docs = $visio.Documents
$doc = $docs.Add("")
$page = $doc.Pages.Item(1)
$page.PageSheet.CellsSRC(1,1,0).FormulaU = "$pageW in"
$page.PageSheet.CellsSRC(1,1,1).FormulaU = "$pageH in"
# Helper functions
function Ref2Page($val, $dim) {
if ($dim -eq "x") { return $val / $refW * $pageW }
else { return $pageH - ($val / $refH * $pageH) }
}
function RectRel {
param($Panel, $RelX, $RelY, $RelW, $RelH, $Fill, $Line, $LineW, $Label)
Assert-RelBox -Panel $Panel -RelX $RelX -RelY $RelY -RelW $RelW -RelH $RelH -ElementName $Label
$px0 = $Panel.X0 + $RelX * ($Panel.X1 - $Panel.X0)
$py0 = $Panel.Y0 + $RelY * ($Panel.Y1 - $Panel.Y0)
$pw = $RelW * ($Panel.X1 - $Panel.X0)
$ph = $RelH * ($Panel.Y1 - $Panel.Y0)
$x = Ref2Page $px0 "x"
$y = Ref2Page $py0 "y"
$w = $pw / $refW * $pageW
$h = $ph / $refH * $pageH
$shp = $page.DrawRectangle($x, $y - $h, $x + $w, $y)
$shp.CellsSRC(1,3,0).FormulaU = """$Fill"""
$shp.CellsSRC(1,2,0).FormulaU = """$Line"""
$shp.CellsSRC(1,2,1).FormulaU = "$LineW pt"
if ($Label) { $shp.Text = $Label }
}
function Assert-RelBox {
param($Panel, $RelX, $RelY, $RelW, $RelH, $ElementName)
if ($RelX -lt 0 -or $RelY -lt 0 -or ($RelX + $RelW) -gt 1 -or ($RelY + $RelH) -gt 1) {
throw "Element '$ElementName' exceeds panel bounds"
}
}
# Panel A: Input Processing
RectRel -Panel $panelA -RelX 0.1 -RelY 0.1 -RelW 0.35 -RelH 0.2 `
-Fill "rgb(220,240,255)" -Line "rgb(80,120,160)" -LineW 1.5 `
-Label "Image Input"
RectRel -Panel $panelA -RelX 0.55 -RelY 0.1 -RelW 0.35 -RelH 0.2 `
-Fill "rgb(220,255,220)" -Line "rgb(80,160,80)" -LineW 1.5 `
-Label "Preprocessor"
# Panel B: Model Architecture
RectRel -Panel $panelB -RelX 0.1 -RelY 0.15 -RelW 0.25 -RelH 0.3 `
-Fill "rgb(255,240,220)" -Line "rgb(200,120,80)" -LineW 1.5 `
-Label "Encoder"
RectRel -Panel $panelB -RelX 0.4 -RelY 0.15 -RelW 0.25 -RelH 0.3 `
-Fill "rgb(255,220,240)" -Line "rgb(200,80,120)" -LineW 1.5 `
-Label "Transformer"
RectRel -Panel $panelB -RelX 0.7 -RelY 0.15 -RelW 0.25 -RelH 0.3 `
-Fill "rgb(240,220,255)" -Line "rgb(120,80,200)" -LineW 1.5 `
-Label "Decoder"
# Panel C: Output
RectRel -Panel $panelC -RelX 0.3 -RelY 0.3 -RelW 0.4 -RelH 0.4 `
-Fill "rgb(255,255,220)" -Line "rgb(160,160,80)" -LineW 1.5 `
-Label "Output Layer"
# Save
$doc.SaveAs($VsdxPath)
Write-Host "Saved: $VsdxPath"
# Export formats
$formats = @("png", "svg", "pdf", "pptx")
foreach ($fmt in $formats) {
$outPath = Join-Path $OutputDir "architecture.$fmt"
# Call export function (from visio_export_formats.ps1)
# Implementation details in actual script
Write-Host "Exported: $outPath"
}
$visio.Quit()
Common Patterns
1. Rebuild from Reference Image
# User provides reference.png at 1920x1080
powershell -ExecutionPolicy Bypass -File scripts\visio_rebuild_scaffold.ps1 `
-VsdxPath "C:\work\figure1.vsdx" `
-PageW 16 `
-PageH 9 `
-RefW 1920 `
-RefH 1080 `
-PreviewPath "C:\work\figure1_preview.png" `
-ExportFormats svg,pdf `
-OutputDir "C:\work\exports"
Inside the scaffold, customize the drawing logic to match the reference layout.
2. Update Existing .vsdx Styling
Open existing file, modify colors/fonts, re-export:
$visio = New-Object -ComObject Visio.Application
$doc = $visio.Documents.Open("C:\work\existing.vsdx")
$page = $doc.Pages.Item(1)
# Change all rectangles to new color
foreach ($shp in $page.Shapes) {
if ($shp.CellExists("FillForegnd", 0)) {
$shp.CellsSRC(1,3,0).FormulaU = """rgb(200,220,240)"""
}
}
$doc.Save()
$visio.Quit()
3. Check for Embedded Images
powershell -ExecutionPolicy Bypass -File scripts\visio_page_tools.ps1 `
-VsdxPath "C:\work\diagram.vsdx" `
-InspectPackage
Looks for large PNG/JPG files in /visio/media/ inside the .vsdx ZIP. Warns if the diagram is just an embedded image.
Acceptance Criteria
A correctly rebuilt .vsdx should:
- ✅ Match the reference layout
- ✅ Use native Visio shapes (rectangles, circles, lines, text)
- ✅ Have editable text and shapes
- ✅ NOT embed the entire reference image as the final content
- ✅ Use consistent colors, fonts, and line weights
- ✅ For multi-panel figures: no panel overlap, no elements crossing boundaries
- ✅ Export cleanly to SVG, PDF, PNG, PPTX from the same source
.vsdx
Troubleshooting
"Visio COM object not found"
Install Microsoft Visio. The COM automation API requires a licensed Visio installation on Windows.
Exported files are empty
Check that the .vsdx saved successfully before export. Verify the page has visible shapes:
$page.Shapes.Count # Should be > 0
Panels overlap in multi-panel figures
Use panel-local coordinates with Assert-RelBox and Assert-RelPoint:
Assert-RelBox -Panel $panelA -RelX 0.1 -RelY 0.2 -RelW 0.8 -RelH 0.6 `
-ElementName "BigModule"
This throws an error if the box exceeds panel boundaries.
Text is cut off
Increase relative width/height, or use multi-line text:
$shp.Text = "Line 1`nLine 2`nLine 3"
Colors don't match reference
Use a color picker on the reference image and convert to RGB:
$shp.CellsSRC(1,3,0).FormulaU = """rgb(123,210,98)"""
Export Format Details
| Format | Method | Notes |
|---|---|---|
| PNG | $page.Export($path) | Raster, good for previews |
| SVG | FixedFormat = 4 | Vector, editable in Illustrator/Inkscape |
FixedFormat = 2 | Vector, for paper submission | |
| PPTX | PowerPoint COM | Creates slide with embedded SVG |
PPTX export example:
$ppt = New-Object -ComObject PowerPoint.Application
$ppt.Visible = $true
$pres = $ppt.Presentations.Add()
$slide = $pres.Slides.Add(1, 12) # 12 = ppLayoutBlank
# Export Visio page to SVG first
$svgPath = "C:\temp\diagram.svg"
$page.Export($svgPath)
# Insert SVG into slide
$slide.Shapes.AddPicture($svgPath, $false, $true, 0, 0, 720, 405)
$pres.SaveAs("C:\work\diagram.pptx")
$ppt.Quit()
Version History
- v1.1.1 - Panel calibration, local coordinates, anti-overlap validation
- v1.1 - Multi-format export (PNG, SVG, PDF, PPTX)
- v1.0 - Initial release with Visio COM scaffolding
References
SKILL.md- Main workflow and rulesreferences/rebuild-guidelines.md- Detailed drawing strategies for complex scientific figuresscripts/visio_export_formats.ps1- Export function libraryscripts/visio_page_tools.ps1- Inspection and export utilitiesscripts/visio_rebuild_scaffold.ps1- Drawing scaffolding with coordinate helpers
When to use this skill:
- User wants to convert a paper diagram to editable Visio
- User needs SVG/PDF/PPTX exports from a single source
- User wants to verify a
.vsdxisn't just an embedded image - User needs consistent styling across multiple paper figures
When NOT to use this skill:
- User just wants to embed an image in a slide deck (use PowerPoint directly)
- User needs pure raster image editing (use Photoshop/GIMP)
- User doesn't need Visio-native editability
FAQ
What does the codex-visio-paper-figure-skill skill do?
Convert paper figures and AI-generated diagrams into editable Microsoft Visio (.vsdx) files with native shapes, text, and connectors, then export to SVG/PDF/PNG/PPTX
How do I install codex-visio-paper-figure-skill?
Run npx skills add https://github.com/reason-machines/codex-skills --skill codex-visio-paper-figure-skill in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/codex-visio-paper-figure-skill/ (personal) or .claude/skills/codex-visio-paper-figure-skill/ (project).
Which AI agents can use codex-visio-paper-figure-skill?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is codex-visio-paper-figure-skill safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains codex-visio-paper-figure-skill?
It is published by reason-machines in reason-machines/codex-skills. It has 225 recorded installs.
More from reason-machines/codex-skills
academic-research-skills-codex
reason-machines/codex-skills
AI-assisted academic research workflows for literature review, paper writing, peer review, and research pipelines
codexplusplus-launcher
reason-machines/codex-skills
Enhanced launcher for Codex App that unlocks plugins, enables session deletion, exports conversations, and syncs provider sessions via CDP injection
codex-plugin-claude-code
reason-machines/codex-skills
Use OpenAI Codex from inside Claude Code for code reviews, adversarial reviews, and delegating tasks to Codex as a subagent.
codex-plusplus-tweak-system
reason-machines/codex-skills
Expert in developing, installing, and managing tweaks for the Codex++ desktop app extension system
awesome-codex-skills-curator
reason-machines/codex-skills
Curate, install, and manage Codex skills from the awesome-codex-skills collection for AI coding agents.
awesome-codex-subagents
reason-machines/codex-skills
A curated collection of 136+ specialized Codex subagents for development tasks across 10 categories
Popular education & science skills
teach
mattpocock/skills
Teach the user a new skill or concept, within this workspace.
scaffold-exercises
mattpocock/skills
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
paper-context-resolver
lllllllama/rigorpilot-skills
Rigor Paper Context helper for README-first deep learning repo reproduction. Use only when the README and repository files leave a narrow reproduction-critical gap and the task is to resolve a specific paper detail such as dataset split, preprocessing, evaluation protocol, checkpoint mapping, or runtime assumption from primary paper sources while recording conflicts. Do not use for general paper summary, repo scanning, environment setup, command execution, title-only paper lookup, or replacing README guidance by default.
caveman-learn
juliusbrussee/caveman
Act on a Caveman learn report - review the ranked token sinks, apply cost-lowering fixes with per-edit consent, and report what those fixes returned. Use when asked to lower an agent's token cost, what caveman has saved, to trim a heavy CLAUDE.md, or to offload re-pasted context into cavemem.
gsap-plugins
greensock/gsap-skills
Official GSAP skill for GSAP plugins — registration, ScrollToPlugin, ScrollSmoother, Flip, Draggable, Inertia, Observer, SplitText, ScrambleText, SVG and physics plugins, CustomEase, EasePack, CustomWiggle, CustomBounce, GSDevTools. Use when the user asks about a GSAP plugin, scroll-to, flip animations, draggable, SVG drawing, or plugin registration.
teach-impeccable
pbakaus/impeccable
DEPRECATED: Use /impeccable teach instead. This command has been folded into the impeccable skill.