drawio-reconstruction
它能做什么
这项技能把图表、幻灯片或截图的图片转换为可编辑的 Draw.io 文件。适合希望修改仅以图片形式存在的图表的人。
适用场景
- ✓当你有一张图表图片,并希望得到可编辑的 Draw.io 版本时。
- ✓当你需要将架构图、研究图示或幻灯片重建为文件时。
- ✓当你希望把界面截图或一组图片转换为 Draw.io XML 的时候。
技能链接
https://github.com/HKUSTDial/Supervisor-Skills/blob/main/skills/drawio-reconstruction/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把这张架构图截图转换为可编辑的 Draw.io 文件,保留相同的方框和箭头。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会把文字和简单形状重建为原生的 Draw.io 元素,只有复杂的视觉内容才使用图片。然后它会将预览与原图进行对比,确认版面一致。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Draw.io Reconstruction
Use this skill for high-quality reconstruction of diagram images into .drawio files.
Helper Script Location
Resolve SKILL_DIR to the absolute directory containing this SKILL.md before running any bundled helper. Use the resolved skill location provided by the runtime; never assume the skill is installed under ~/.codex, ~/.agents, or any other fixed directory.
All commands below use $SKILL_DIR to mean that resolved absolute directory.
Fidelity Contract
The primary goal is visual fidelity to the reference image. Editability is secondary.
Do not treat semantic equivalence as success. A generic icon, generic curve, generic font size, approximate panel, or approximate background is a defect when the reference has a specific visual style.
Script checks only prove technical validity. A diagram is not complete merely because .drawio opens, exports, or passes check_drawio.py / batch_verify.py. Completion requires visual comparison against the reference at full size.
Work only in the target directory or target files named by the user. Do not repair, overwrite, or improve neighboring diagrams because they look related. If the requested target is ambiguous, inspect and report the ambiguity before editing.
Never silently rewrite the user's content. If the user asks for larger fonts or a more professional PPT style, first distinguish:
- Layout-only refinement: increase font size, resize boxes, improve spacing, align elements, adjust line breaks without changing words.
- Content compression: shorten sentences, remove details, rewrite labels. Ask permission before doing this.
Batch Folder Workflow
Use this workflow when the user provides a directory of images or asks for batch reconstruction.
Batch Intent And Scheduling
Before opening images for detailed visual analysis, decide whether the request is a batch reconstruction task:
- Treat the request as batch reconstruction when it names a folder, multiple image files, a glob/pattern, or any target that resolves to 2 or more image entries.
- Create and review the manifest before detailed per-image work begins.
- When sub-agent tooling is available and useful, use a bounded worker pool no larger than the available concurrency and the number of pending images. Give each active worker exactly one image and an exclusive write set for that image's
.drawio, exported.png, audit file, and private asset/crop directory. Reuse a free slot for the next image instead of trying to start every worker at once. - When sub-agent tooling is unavailable, disabled, capacity-limited, or unnecessary for a small batch, process entries serially in manifest order. Preserve the same inventory, reconstruction, export, check, and visual-audit requirements.
- Tell the user about scheduling limitations only when they materially affect timing or delivery. Do not block a valid batch solely because parallel execution is unavailable.
- The coordinating agent may inspect thumbnails or file metadata to confirm scope, naming, orientation, and shared style constraints before choosing the schedule.
Identify the input directory, output directory, naming convention, and overwrite policy.
Create a batch manifest:
python "$SKILL_DIR/scripts/batch_manifest.py" path/to/images --output-dir path/to/output --writeReview the manifest before editing. Process only entries in the manifest unless the user expands scope.
For each image, define the expected
<stem>.drawio,<stem>.png, and lightweight<stem>.audit.mdoutputs in the target output directory.Choose a bounded parallel schedule or a serial schedule:
- Assign exclusive output files for each active entry.
- Tell workers they are not alone in the codebase and must not revert or edit other workers' outputs.
- Require every entry to follow the same full workflow as a standalone single-image task. Batch mode is only a scheduling strategy; it does not reduce fidelity, inventory, reconstruction, export, check, or visual-audit requirements.
- Apply this quality gate to every entry: produce
.drawio,.png, and<stem>.audit.md; create the complete visible-element inventory; classify non-text visuals; use crops/SVG/native elements according to the normal medium rules; run required checks/exports; visually compare the exported preview against the reference; mark unresolved visual defects instead of claiming completion. - Keep final batch v
常见问题
新文件看起来会和图片完全一样吗?
该技能力求视觉上高度还原。它会以全尺寸与参考图进行对比,并修正差异。
它会改变内容吗?
除非你要求修改,否则该技能被设定为不改写你的内容。
最后我会得到什么?
一个可以在 Draw.io 应用中打开和编辑的文件。
详情
作者的原始描述
Reconstructs reference images into high-fidelity, editable Draw.io files with rendered previews: native Draw.io elements carry text and structure, SVG covers simple icons that match the reference, and cropped or transparent PNGs preserve complex visuals. Use when the user wants a diagram image, research figure, architecture diagram, slide, UI screenshot, or image folder turned into `.drawio` XML; batch requests use a manifest with bounded parallelism when available and a full-fidelity serial fallback otherwise.
热度
- GitHub 星标
- 11k
- 排名
- #11689
- 许可证
- —
- 更新时间
- 2026/10/16
评论
- …
同一仓库的更多技能
benchmark-paper-template
11k帮你的智能体规划并检查一篇基准测试研究论文,从研究空白和数据集构建,到实验和投稿前检查表。
deep-research
11k帮你的智能体围绕某个研究主题进行综述式文献回顾,核对引用,建立清晰的分类体系,并生成基于证据的报告。
figure-designer
11k帮你的智能体为研究论文的主要图表选择版面和图表类型,并对照常见质量标准进行检查。
idea-evaluator
11k帮你的智能体从新颖性、可行性和风险三方面评估研究想法草稿,并在你投入数月之前给出清晰的结论。