Skip to content
Back to search

codex-visio-paper-figure-skill

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

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/pengjunchi0/codex-visio-paper-figure-skill with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/pengjunchi0/codex-visio-paper-figure-skill'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/pengjunchi0--codex-visio-paper-figure-skill/badge.svg)](/listings/pengjunchi0--codex-visio-paper-figure-skill)

HTML

<a href="/listings/pengjunchi0--codex-visio-paper-figure-skill"><img src="/api/listings/pengjunchi0--codex-visio-paper-figure-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 127 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: visio-image-rebuilder
  3. 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.
  4. ---
  5. # Visio Image Rebuilder
  6. ## Core Rule
  7. 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.
  8. 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.
  9. ## Workflow
  10. 1. Inspect inputs.
  11. - Confirm paths for the target `.vsdx`, reference image, requested output formats, and output directory.
  12. - Export the current Visio page to PNG before editing when a target file already exists.
  13. - Inspect the `.vsdx` package for pages, media entries, and shape counts.
  14. - Back up the target file before any write.
  15. - If Visio is already open, close only the target document or ask before terminating a stuck process.
  16. 2. Decode the reference image.
  17. - Identify page orientation, panel boundaries, module colors, captions, text hierarchy, arrows, dashed lines, and repeated motifs.
  18. - Build an object inventory: containers, titles, process boxes, icons, charts, graphs, equations, connectors, captions.
  19. - Calibrate the canvas first, then calibrate each major panel or subpanel with explicit top-left bounds or four corner points.
  20. - Draw panel internals in panel-local normalized coordinates whenever the figure has dense multi-panel content.
  21. - Decide whether the task is a full rebuild, color/style transfer, local edit, or export-only job.
  22. - For dense scientific figures, first create a coarse panel map, then draw panel internals. Do not start with small decorative details.
  23. 3. Prefer Visio automation for native edits.
  24. - Use COM automation on Windows when Visio is installed.
  25. - Use `DrawRectangle`, `DrawOval`, `DrawLine`, `Page.Import` only for small source assets, and shape cells such as `FillForegnd`, `LineColor`, `LineWeight`, `Char.Size`, `Char.Color`, `Rounding`.
  26. - Use explicit coordinates and IDs for fragile edits.
  27. - Keep grouped structure meaningful: major panels, submodules, repeated blocks, legends.
  28. - For nested modules, use helpers such as `RectRel`, `TextRel`, `LineRel`, and `OvalRel` so child shapes are constrained by their calibrated parent panel.
  29. 4. Use package XML edits only for narrow, deterministic changes.
  30. - XML patching is appropriate for recoloring existing shapes, replacing font tables, or changing known cell values.
  31. - Preserve Visio XML ordering: shape-level `Cell` nodes should be before `Section`, `Text`, or child `Shapes`.
  32. - Avoid rebuilding complex geometry by raw XML unless COM automation is unavailable.
  33. 5. Export requested formats from the verified Visio source.
  34. - Use `scripts/visio_page_tools.ps1` for export-only jobs.
  35. - Use `scripts/visio_rebuild_scaffold.ps1` with `-ExportFormats` for rebuilds that should immediately create deliverables.
  36. - Prefer SVG for vector web/manuscript handoff, PDF for review/print, and PPTX for presentation decks.
  37. - For PPTX, use PowerPoint COM when available; the generated slide contains the Visio page render, usually inserted from SVG.
  38. 6. Verify without overtrusting a single signal.
  39. - Export at least one preview after editing when possible.
  40. - Inspect the `.vsdx` package to confirm that no full-size reference PNG/JPG was left in `visio/media`.
  41. - Check shape count and representative text labels.
  42. - Check that major panels do not overlap and that child shapes stay within their intended panel bounds.
  43. - Check every requested output file exists and is non-empty.
  44. - If Visio automation hangs, stop safely, close the document if possible, and report whether the file was actually modified.
  45. ## Implementation Pattern
  46. For full rebuilds, generate a script that:
  47. - Opens the target `.vsdx` with Visio COM.
  48. - Saves a timestamped or descriptive backup.
  49. - Clears or duplicates the page depending on user preference.
  50. - Sets page size to match the reference aspect ratio.
  51. - Draws native shapes in top-left reference coordinates converted to Visio coordinates.
  52. - Defines calibrated panel bounds for complex regions and uses panel-local coordinates for their internals.
  53. - Adds reusable helpers for rectangles, text boxes, ovals, lines, arrows, mini charts, graph nodes, and image-like stacks.
  54. - Saves the document and exports requested formats.
  55. 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.
  56. For style transfer, generate a script that:
  57. - Reads existing shape IDs, text, approximate geometry, fill, and line colors.
  58. - Maps known modules to target palettes by text and group context.
  59. - Applies fills, borders, text colors, line patterns, and font changes to existing shapes.
  60. - Avoids repositioning unless the user asks for layout changes.
  61. - Exports only after the `.vsdx` has been saved and inspected.
  62. For export-only requests, run:
  63. ```powershell
  64. powershell -ExecutionPolicy Bypass -File scripts\visio_page_tools.ps1 `
  65. -VsdxPath "C:\path\figure.vsdx" `
  66. -ExportFormats svg,pdf,pptx `
  67. -OutputDir "C:\path\exports" `
  68. -InspectPackage
  69. ```
  70. For rebuild plus multi-format export, run:
  71. ```powershell
  72. powershell -ExecutionPolicy Bypass -File scripts\visio_rebuild_scaffold.ps1 `
  73. -VsdxPath "C:\path\figure.vsdx" `
  74. -PageW 16 `
  75. -PageH 9 `
  76. -RefW 1600 `
  77. -RefH 900 `
  78. -PreviewPath "C:\path\exports\figure.png" `
  79. -ExportFormats svg,pdf,pptx `
  80. -OutputDir "C:\path\exports"
  81. ```
  82. ## Safety Checklist
  83. - Back up before writing outside the workspace.
  84. - Close any open Visio document that locks the target file before direct package edits.
  85. - Never delete or revert unrelated user files.
  86. - If a previous attempt embedded the reference image, restore from backup or remove the image shape before continuing.
  87. - Tell the user clearly whether the final file is native editable shapes or a flat embedded image.
  88. - Tell the user when PPTX export is a rendered slide rather than native PowerPoint shapes.
  89. ## Acceptance Criteria
  90. A Visio rebuild is acceptable only when:
  91. - Main panel positions, flow direction, captions, and module hierarchy match the reference at first glance.
  92. - Major panels are aligned to calibrated bounds, with no obvious submodule drift, collision, or cross-panel overlap.
  93. - Text remains editable and uses a consistent academic font, usually Times New Roman.
  94. - Repeated motifs are represented with reusable native shapes rather than pasted raster crops.
  95. - The final `.vsdx` package has no full-page raster reference image in `visio/media`.
  96. - Requested PNG/SVG/PDF/PPTX deliverables were exported from the saved `.vsdx` and are non-empty.
  97. - A preview export or package inspection was performed, or the final response explicitly states why verification was skipped.
  98. ## Useful Resource
  99. 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.
README.md · README · 211 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # 科研论文绘图 Skill
  2. 当前版本:`v1.1.1`
  3. `科研论文绘图 Skill` 是一个面向科研论文配图工作流的 Codex Skill。它用于把参考图片、截图或生成图还原为 **Microsoft Visio `.vsdx` 原生可编辑图形**,并从同一个 Visio 源文件导出 PNG、SVG、PDF、PPTX 等交付格式。
  4. 核心目标是让 Codex 通过 Visio 原生形状、文本、连线、分组和样式重建论文配图、模型框架图、流程图和多面板科学图。
  5. ## 注意!
  6. 主要适用于模型图、架构图、流程图等。其余场景如指标图(或含真实数据结果的)最好使用脚本或让 Agent 提取数据后用脚本绘图。
  7. 当前接入Visio COM,由于作者仅使用该绘图软件,暂没有推广到其余绘图App。因此使用Drawio等的朋友,请修改对应接口、且适配自己的Agent。
  8. ## 适用场景
  9. 适合:
  10. - 根据 PNG/JPG/截图重建 Visio 图。
  11. - 将 AI 生成的论文模型图转成可编辑 `.vsdx`。
  12. - 按参考图修改已有 Visio 文件的布局、配色、字体或模块结构。
  13. - 对复杂多面板科学图进行结构化复刻。
  14. - 检查 `.vsdx` 是否误用了整张参考图嵌入。
  15. - 给 Visio 图统一论文风格字体、配色和线条规范。
  16. - 从保存后的 `.vsdx` 导出 SVG、PDF、PPTX 或 PNG。
  17. - 对复杂多面板图先做面板四角/边界标定,减少子模块移位、串区和重叠。
  18. 不适合:
  19. - 只需要把图片插入 Visio 页面。
  20. - 只需要普通图片编辑、抠图或美化。
  21. - 不要求 Visio 原生可编辑性的纯位图复刻。
  22. ## 核心原则
  23. 最终交付的 `.vsdx` 应尽量由以下对象构成:
  24. - Visio 原生矩形、圆形、线条、箭头、连接线。
  25. - 可编辑文本。
  26. - 可编辑分组。
  27. - 原生近似绘制的小图表、热图、节点图、立方体、堆叠图。
  28. 禁止用整张参考图作为最终页面内容来冒充还原。参考图只能作为临时描摹依据;最终文件中不应留下完整的大尺寸参考 PNG/JPG。
  29. `.vsdx` 是可编辑母版。SVG/PDF/PPTX 是从这个母版导出的交付物,不应该单独重画出彼此不一致的版本。
  30. ## 仓库结构
  31. ```text
  32. .
  33. ├── README.md
  34. ├── SKILL.md
  35. ├── agents/
  36. │ └── openai.yaml
  37. ├── references/
  38. │ └── rebuild-guidelines.md
  39. └── scripts/
  40. ├── visio_export_formats.ps1
  41. ├── visio_page_tools.ps1
  42. └── visio_rebuild_scaffold.ps1
  43. ```
  44. 文件说明:
  45. - `SKILL.md`:Codex Skill 的主入口,包含触发描述、工作流、验收标准和安全规则。
  46. - `agents/openai.yaml`:Codex UI 元数据。
  47. - `references/rebuild-guidelines.md`:复杂科学图还原准则,包括面板拆解、绘图顺序、样式参数、导出策略和验证 rubric。
  48. - `scripts/visio_export_formats.ps1`:可复用导出函数,支持 PNG、SVG、PDF、PPTX。
  49. - `scripts/visio_page_tools.ps1`:辅助检查脚本,用于备份、导出、检查 `.vsdx` 包结构。
  50. - `scripts/visio_rebuild_scaffold.ps1`:Visio 原生绘图脚手架,用于快速编写一比一重建脚本,并内置全局坐标和面板局部坐标 helper。
  51. ## 环境要求
  52. 推荐环境:
  53. - Windows。
  54. - Microsoft Visio。
  55. - PowerShell。
  56. - Microsoft PowerPoint,用于 PPTX 导出。
  57. - Git。
  58. - Codex Desktop 或支持本地文件与工具调用的 Codex 环境。
  59. 说明:
  60. - 完整 Visio 自动绘图依赖 Visio COM Automation,因此主要面向 Windows + Microsoft Visio。
  61. - SVG 和 PNG 由 Visio 页面导出。
  62. - PDF 由 Visio 固定格式导出。
  63. - PPTX 默认由 PowerPoint COM 创建单页演示文稿,并插入 Visio 导出的 SVG 页面渲染。
  64. - 不安装 Visio 时,仍可做 `.vsdx` 包结构检查或有限 XML 修改,但不适合完整一比一重建。
  65. ## 安装方式
  66. 将本仓库克隆或复制到 Codex skills 目录。
  67. Windows 示例:
  68. ```powershell
  69. git clone https://github.com/pengjunchi0/codex-visio-paper-figure-skill.git "$env:USERPROFILE\.codex\skills\visio-image-rebuilder"
  70. ```
  71. 安装后重启 Codex 或开启新会话,使 skill 被重新发现。
  72. ## 推荐使用方式
  73. 示例请求:
  74. ```text
  75. 使用 visio-image-rebuilder,根据这张参考图片重建 C:\path\model.vsdx,要求最终是 Visio 原生可编辑形状,不要整图嵌入,并导出 SVG、PDF、PPTX。
  76. ```
  77. ```text
  78. 把这个 .vsdx 按参考图更换配色,保持布局不变,最终仍然可编辑,并给我一个 PDF 预览和 PPTX。
  79. ```
  80. ```text
  81. 检查这个 .vsdx 是否只是嵌入了整张 PNG,如果是,请改成原生 Visio 形状重建,再导出 SVG。
  82. ```
  83. ## 面板标定与防重叠
  84. v1.1.1 增加了面向复杂多面板图的坐标约束建议和脚手架 helper。推荐流程是:
  85. 1. 先标定整张参考图尺寸和 Visio 页面尺寸。
  86. 2. 再标定每个主要 panel 的左上角、宽高,必要时记录四角点。
  87. 3. panel 内部元素使用 0-1 局部坐标绘制,而不是直接手写全图坐标。
  88. 4. 导出预览后检查子模块是否越出父 panel、相邻 panel 是否重叠、箭头和文字是否穿过无关模块。
  89. `visio_rebuild_scaffold.ps1` 中已提供:
  90. - `RectRel`
  91. - `TextRel`
  92. - `OvalRel`
  93. - `LineRel`
  94. - `Assert-RelBox`
  95. - `Assert-RelPoint`
  96. 这些 helper 会把局部坐标映射回全局参考坐标,并在局部元素越出 panel 边界时直接报错,避免复杂图后半部分出现整体移位或重叠。
  97. ## 多格式导出
  98. 导出已有 `.vsdx`:
  99. ```powershell
  100. powershell -ExecutionPolicy Bypass -File scripts\visio_page_tools.ps1 `
  101. -VsdxPath "C:\path\model.vsdx" `
  102. -ExportFormats svg,pdf,pptx `
  103. -OutputDir "C:\path\exports" `
  104. -InspectPackage
  105. ```
  106. 重建并导出:
  107. ```powershell
  108. powershell -ExecutionPolicy Bypass -File scripts\visio_rebuild_scaffold.ps1 `
  109. -VsdxPath "C:\path\model.vsdx" `
  110. -PageW 16 `
  111. -PageH 9 `
  112. -RefW 1600 `
  113. -RefH 900 `
  114. -PreviewPath "C:\path\exports\model.png" `
  115. -ExportFormats svg,pdf,pptx `
  116. -OutputDir "C:\path\exports"
  117. ```
  118. ## 验收标准
  119. 一个合格的 Visio 还原结果应满足:
  120. - 主体布局和参考图一致。
  121. - 主要模块、标题、编号、箭头和说明文字齐全。
  122. - 文字可编辑。
  123. - 图形对象可单独选中和修改。
  124. - 没有整张参考图作为最终底图。
  125. - 配色、字体和线条风格统一。
  126. - 复杂多面板图的内部元素不应明显移位、跨 panel 串区或互相重叠。
  127. - 有原文件备份。
  128. - 请求的 PNG/SVG/PDF/PPTX 从同一个保存后的 `.vsdx` 导出,并且文件非空。
  129. ## Version History
  130. ### v1.1.1 - Panel calibration and anti-overlap
  131. - 在 `SKILL.md` 中加入复杂多面板图的面板标定流程。
  132. - 在 `references/rebuild-guidelines.md` 中新增 panel-local 坐标、四角标定和防重叠检查准则。
  133. - 在 `visio_rebuild_scaffold.ps1` 中新增 `RectRel`、`TextRel`、`OvalRel`、`LineRel` 等局部坐标 helper。
  134. - 新增 `Assert-RelBox` 和 `Assert-RelPoint`,当局部元素越出父 panel 边界时提前报错。
  135. - 更新 `agents/openai.yaml` 和 README,说明 v1.1.1 的防移位、防重叠能力。
  136. ### v1.1 - Multi-format outputs
  137. - 新增 `scripts/visio_export_formats.ps1`。
  138. - `visio_page_tools.ps1` 支持 `-ExportFormats png,svg,pdf,pptx`、`-OutputDir`、`-OutputBaseName`。
  139. - `visio_rebuild_scaffold.ps1` 支持重建后直接导出 PNG/SVG/PDF/PPTX。
  140. - `SKILL.md` 和 `references/rebuild-guidelines.md` 增加多格式导出策略和验收标准。
  141. ### v1.0 - Initial usable version
  142. - 建立 Codex Skill 基础结构。
  143. - 明确核心规则:最终 `.vsdx` 应由 Visio 原生可编辑形状构成,不能用整张参考图嵌入冒充还原。
  144. - 提供 Visio COM 绘图脚手架和 `.vsdx` 检查工具。
  145. - 提供复杂多面板论文图的绘图流程设计。
  146. ### Planned v1.2
  147. - 增加更多可复用 motif helper,例如 `DrawCube`、`DrawHeatmap`、`DrawGraph`、`DrawStackedSequence`、`DrawMiniChart`。
  148. - 增加参考图尺寸读取脚本。
  149. - 增加 shape inventory 导出脚本,用于分析已有 `.vsdx` 的文本、颜色、位置和分组。
  150. ## 开源许可证
  151. 本项目采用 [MIT License](LICENSE) 开源。

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.