PluginBench
Skill
Pass
Audit score 90

4drawio

jihe520/mathmodelagent

Generate non-data diagrams (flowcharts, roadmaps, model structures) for mathematical modeling papers using DrawIO.

What is 4drawio?

This skill creates technical diagrams for mathematical modeling competition papers, including roadmaps, problem-solving flowcharts, model structure diagrams, and data pipelines. Use it after analysis and coding phases to visualize methodology and problem relationships as DrawIO files and exportable PDFs.

  • Generate DrawIO source files for technical roadmaps, sub-problem flowcharts, model structures, and data processing pipelines
  • Export diagrams to publication-ready PDF format
  • Distinguish non-data diagrams from statistical charts (handled by prior skill)
  • Validate diagram consistency, readability, and alignment with paper methodology
  • Document generated diagrams and export status in structured report

How to install 4drawio

npx skills add https://github.com/jihe520/mathmodelagent --skill 4drawio
Prerequisites
  • Completed ANALYSIS_MODELING_REPORT.md and RESULTS_REPORT.md from prior phases
  • DrawIO command-line tool installed (optional; .drawio source files generated regardless)
  • Existing figures/ directory with any prior non-data diagrams
Claude Code
Cursor
Windsurf
Cline

How to use 4drawio

  1. 1.Read ANALYSIS_MODELING_REPORT.md, RESULTS_REPORT.md, and existing figures/ to identify non-data diagram requirements
  2. 2.Create a checklist of needed diagrams (roadmap, flowcharts, pipelines, model structures) based on paper methodology
  3. 3.Generate .drawio XML files in figures/ directory with clear node labels, consistent styling, and logical arrow flow
  4. 4.Attempt PDF export using available DrawIO command; record any export failures in the report
  5. 5.Validate each diagram for overlapping nodes, crossing arrows, consistent formatting, and no duplication with data charts
  6. 6.Write DRAWIO_REPORT.md documenting all generated diagrams, ungenerated diagrams with reasons, and embedding suggestions for each chapter

Use cases

Good for
  • Create a technical roadmap showing overall problem-solving approach and chapter logic for the introduction
  • Generate flowcharts for each sub-problem displaying input, decision points, algorithms, and outputs
  • Visualize data processing pipelines from raw data through cleaning and feature engineering to model input
  • Draw model structure and variable relationship diagrams for complex mathematical models
  • Produce indicator hierarchy diagrams for multi-level evaluation systems
Who it's for
  • Mathematical modeling competition participants (MCM, CUMCM)
  • Students writing technical papers with methodology visualization needs
  • Teams documenting algorithmic workflows and model architectures

4drawio FAQ

What diagrams should I generate?

Generate non-data diagrams that visualize methodology: technical roadmaps, sub-problem flowcharts, data pipelines, model structures, and indicator hierarchies. Do not generate statistical charts (line plots, bar charts, heatmaps, etc.)—those belong to the prior coding-visual phase.

What if DrawIO export to PDF fails?

Keep the .drawio source file and document the failure reason in DRAWIO_REPORT.md with the export command used. The source file is still usable for manual export or editing.

Should I generate a diagram for every possible visualization?

No. Only generate diagrams that serve the paper's argument and correspond to actual methods in ANALYSIS_MODELING_REPORT.md. Avoid creating diagrams solely to meet a quota.

Can I modify code or results based on diagram insights?

No. This skill only generates diagrams; it does not re-run models, modify code/, or change numerical conclusions in RESULTS_REPORT.md.

What language should diagram text use?

Use the same language as your paper (Chinese or English). Keep node labels short, use two lines if needed, and avoid long sentences within the diagram.

Full instructions (SKILL.md)

Source of truth, from jihe520/mathmodelagent.


name: 4drawio description: "数学建模非数据型图示绘制阶段。根据 ANALYSIS_MODELING_REPORT.md、RESULTS_REPORT.md 和已有 figures/ 生成技术路线图、子问题求解流程图、模型结构图、数据处理流程图等 DrawIO 图,并导出论文可引用 PDF。" allowed-tools: Bash(*), Read, Write, Edit, Grep, Glob, Agent, WebSearch, WebFetch

DrawIO 非数据图示绘制

本 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 说明导出失败。