4drawio
jihe520/MathModelAgent · Agent Skill
Generates technical diagrams, flowcharts, and model structure charts for academic papers, exporting them to PDF.
Jump to install ↓Overview
| Publisher | |
|---|---|
| Repository | jihe520/MathModelAgent ↗ |
| Skill folder | 4drawio |
| Stars | 4,251 |
| Bundled files | 1 |
| License | not specified — check with the author |
| Last updated | June 18, 2026 |
| Links | Skill source ↗ · Repository ↗ |
Mozgi check
What we found in the skill files. Details come with a subscription.
Installation
A skill is a folder with a SKILL.md file. Pick your agent and run the commands in a terminal (macOS, Linux or Git Bash on Windows) from your project root.
Copy the prompt into Claude, Codex or another assistant: it will review the skill and install it for you.
Install the “4drawio” skill from mozgi.io (https://mozgi.io/skills/4drawio/) for me. 1. Download the archive: https://mozgi.io/skills/4drawio/download If it fails, take the skill folder from the source: https://github.com/jihe520/MathModelAgent/tree/main/skills/4drawio 2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me. 3. Put the “4drawio” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.). 4. Make sure <skills folder>/4drawio/SKILL.md exists. 5. Briefly tell me what this skill does and offer to try it on my task. If you cannot do a step yourself, tell me what to click or type.
git clone --depth 1 --branch main https://github.com/jihe520/MathModelAgent.git /tmp/MathModelAgent mkdir -p .claude/skills cp -r /tmp/MathModelAgent/skills/4drawio .claude/skills/4drawio
Restart Claude Code — the skill appears in the list; call it manually with /4drawio. For all projects use ~/.claude/skills.
git clone --depth 1 --branch main https://github.com/jihe520/MathModelAgent.git /tmp/MathModelAgent mkdir -p .agents/skills cp -r /tmp/MathModelAgent/skills/4drawio .agents/skills/4drawio
Codex looks for skills in .agents/skills from the current folder up to the repo root; call one with /skills or $4drawio. For all projects use ~/.agents/skills.
git clone --depth 1 --branch main https://github.com/jihe520/MathModelAgent.git /tmp/MathModelAgent mkdir -p .cursor/skills cp -r /tmp/MathModelAgent/skills/4drawio .cursor/skills/4drawio
Cursor picks the skill up on start; call it with “/” in Agent chat. Cursor also reads .claude/skills and .agents/skills. For all projects use ~/.cursor/skills.
git clone --depth 1 --branch main https://github.com/jihe520/MathModelAgent.git /tmp/MathModelAgent mkdir -p .gemini/skills cp -r /tmp/MathModelAgent/skills/4drawio .gemini/skills/4drawio
Gemini CLI offers to activate the skill when a task matches — you approve it. For all projects use ~/.gemini/skills.
Read SKILL.md and any companion files before deciding whether to install. Click a file to preview it.
SKILL.md contents
Original author text · read-onlyDrawIO 非数据图示绘制
本 skill 承接 3coding-visual。它只负责论文中的非数据型图示,例如技术路线图、求解流程图、模型结构图、数据处理流程图、变量关系图、指标体系图等。
数学建模规范参考
如需领域判断,读取 ../_references/math_modeling_norms.md 中的“图表与可视化”和“非数据图工具选择”小节。该文件只作为规范知识库,不要求为了凑数量生成额外图示。
阶段边界
- 本阶段负责:DrawIO 源文件、非数据图 PDF、图示生成记录。
- 本阶段不负责:折线图、柱状图、散点图、热力图、箱线图、雷达图等数据图。这些由
3coding-visual生成。 - 本阶段不重跑模型、不修改
code/,不改写reports/RESULTS_REPORT.md的数值结论。
必须产出
在当前工作目录创建或更新:
figures/
fig_roadmap.drawio
fig_roadmap.pdf
fig_flow_q1.drawio
fig_flow_q1.pdf
...
reports/DRAWIO_REPORT.md
如果某类图不需要生成,必须在 reports/DRAWIO_REPORT.md 中说明原因。竞赛论文通常至少需要一张 fig_roadmap 技术路线图。
读取这些文件的目的不是提取数据作图,而是理解论文方法、章节结构、子问题关系和已有图表,避免重复。
工作流程
Step 1: 盘点已有图表和需求
先读取以下文件(存在则读取):reports/ANALYSIS_MODELING_REPORT.md、reports/RESULTS_REPORT.md、figures/ 目录列表。
然后从前序文档提取非数据图需求,输出一个清单:
DRAWIO PLAN CHECKLIST:
[ ] fig_roadmap 技术路线图,放在问题重述/绪论
[ ] fig_flow_q1 问题一求解流程图
[ ] fig_flow_q2 问题二求解流程图
[ ] fig_flow_q3 问题三求解流程图
[ ] fig_pipeline 数据处理流程图
[ ] fig_model 模型结构/变量关系图
清单不是固定模板,要根据题目实际删减或增补。不要为了凑图生成无意义图示。
Step 2: 判定图类型
常见图示选择:
| 图类型 | 文件名建议 | 适用场景 |
| --- | --- | --- |
| 技术路线图 | fig_roadmap | 展示整体解题路线、章节逻辑、方法串联 |
| 子问题求解流程图 | fig_flow_q1, fig_flow_q2 | 展示单个子问题的输入、判断、算法、输出 |
| 数据处理流程图 | fig_pipeline | 展示数据清洗、特征构造、建模输入 |
| 模型结构图 | fig_model | 展示模块关系、变量关系、模型层次 |
| 指标体系图 | fig_index_system | 展示目标层、准则层、指标层 |
| 决策树/规则图 | fig_decision_tree | 展示分类规则、设备选择、策略分支 |
不要用 DrawIO 画这些图:
- 结果对比柱状图
- 预测误差曲线
- 灵敏度曲线
- 相关性热力图
- 分布图和箱线图
Step 3: 生成 DrawIO 源文件
每张图一个 .drawio 文件,放在 figures/。
DrawIO 内容要求:
- 文字语言与论文语言一致。
- 节点文字短,必要时双行,不堆长句。
- 同类节点样式统一。
- 箭头方向清晰,避免交叉。
- 图中不写大段解释,解释留给论文正文。
- 不使用装饰性阴影和过度渐变。
生成大 XML 时,分段写入,避免截断。示例:
mkdir -p figures
cat << 'XMLEOF' > figures/fig_roadmap.drawio
<mxfile>
<diagram name="Page-1">
<mxGraphModel>
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- nodes and edges -->
</root>
</mxGraphModel>
</diagram>
</mxfile>
XMLEOF
Step 4: 导出 PDF
优先用可用的 DrawIO 命令导出 PDF:
DRAWIO_BIN="$(command -v drawio 2>/dev/null || command -v draw.io 2>/dev/null || command -v draw.io.exe 2>/dev/null || true)"
if [ -n "$DRAWIO_BIN" ]; then
"$DRAWIO_BIN" --export --format pdf --crop --output figures/fig_roadmap.pdf figures/fig_roadmap.drawio
else
echo "DrawIO command not found; keep .drawio source and record export failure."
fi
如果无法导出 PDF,保留 .drawio,在 reports/DRAWIO_REPORT.md 记录失败原因和建议导出命令。
Step 5: 自检和修复
每张图必须检查:
.drawio文件非空。- 若导出成功,
.pdf文件非空。 - 节点没有明显重叠。
- 箭头不穿过核心节点。
- 字号、颜色、边框风格一致。
- 文件名和图意一致。
- 没有与
3coding-visual的数据图重复。
发现问题要修 .drawio 并重新导出,不要只在报告里解释。
Step 6: 写生成记录
创建 reports/DRAWIO_REPORT.md,至少包含:
# DrawIO 图示生成报告
## 图示清单
| 文件 | 类型 | 来源依据 | 用途 | 状态 |
| --- | --- | --- | --- | --- |
## 未生成图示及原因
## 导出与自检记录
## 给论文阶段的嵌入建议
嵌入建议只说明每张图适合放入哪个章节和建议 caption,不生成 *_typst_includes.typ。最终的图表插入代码(Typst 的 #figure(image(...), caption: [...]) 或 LaTeX 的 \begin{figure}...\end{figure})由 5writing 根据论文结构和所选引擎决定。
质量要求
- 图示服务论文论证,不为装饰而画。
- 每张图必须能对应到
reports/ANALYSIS_MODELING_REPORT.md中的真实方法。 - 数据型图表不得在本阶段重复生成。
- 论文阶段引用的非数据图都应有
.drawio源文件和 PDF,或者在reports/DRAWIO_REPORT.md说明导出失败。
Frequently asked questions
What does the 4drawio skill do?
Generates technical diagrams, flowcharts, and model structure charts for academic papers, exporting them to PDF.
How do I install 4drawio?
Open the “Installation” block on this page and pick your agent — Claude Code, Codex, Cursor or Gemini CLI — for ready-made commands that copy the skill folder to the right place. Or copy the prompt from the “Via assistant” tab and let the assistant review and install the skill.
Which AI models work with 4drawio?
Skills are plain Markdown instructions (the Agent Skills format), so 4drawio works with any agent that reads SKILL.md: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and more. The model loads the instructions only when a task matches the skill's description.
Is 4drawio free?
The skill is published openly by jihe520. The skill itself costs nothing — you only pay your AI provider for the tokens you use. No license is specified in the repository — check the terms with the author before commercial use.
Is it safe to install skills?
A skill is a set of instructions your agent will follow, so read SKILL.md and its companion files before installing. Scripts in the skill folder only run if your agent runs them — keep an eye on what it does and do not grant unnecessary permissions.
How is a skill different from an MCP server or a plugin?
An MCP server or plugin gives the model new tools — code that runs and returns a result. A skill gives it knowledge and process: how to approach a task, which steps to follow and what good output looks like. It needs no server or API key.