math-modeling-expert-agent
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "math-modeling-expert-agent" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-31e271badb048e93d9a666aa790b391470117dcdc14b07ac048b9ba88c489351. Verify the upstream source and version against https://skillhub.cn/skills/user_0210c829/math-modeling-expert-agent before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
A full-process expert skill for mathematical modeling competitions, providing one-stop support across five stages: understanding the problem, model building, coding solutions, paper writing, and acceptance checks. Supports both Typst and LaTeX engines and includes a problem-type error-prevention knowledge base.
Introduction source: third_party · user_0210c829 · 1.0.1 Reference
SkillPi interpretation
- Tasks
- Mathematics Modelling Competition Full Process Specialist. A five-stage one-stop coverage is provided for the production of a model-coding search and the writing of a dispositif. Support to the Typst/LaTeX double engine, with a complete thematic error-proof knowledge base.
- Testing
- Not tested
Browse files
Frontmatter
name: math-modeling-expert
description: 数学建模竞赛全流程专家。吃透赛题→建立模型→编码求解→论文撰写→验收门禁,五阶段一站式覆盖。支持Typst/LaTeX双引擎,含完整题型防错知识库。
slug: math-modeling-expert-agent
version: 1.0.1
displayName: 数学建模全流程专家
allowed-tools: Bash(*), Read, Write, Edit, Grep, Glob, Agent, WebSearch, WebFetchMathModeling Expert — 数学建模全流程 Skill
概述
本 Skill 是数学建模竞赛的完整工作流编排器,覆盖从赛题分析到论文提交的全过程。被 sessions_spawn 调用时,请自行设定工作目录并依次执行各阶段。
能力边界:
- ✅ 赛题分析与建模设计:子问题拆解、假设预检、模型公式、求解策略
- ✅ 编程实现与数据图表:Python 编码、实验运行、数据驱动图表
- ✅ 竞赛论文撰写:Typst / LaTeX 双引擎、14种中文+3种英文模板
- ✅ 验收门禁:7项硬错误检查、文本质量门禁、编译与视觉检查
- ❌ 不负责:DrawIO 流程图(可单独调用
4drawio)、Typst 语法教学(可单独调用typst-author)、Docker/后端部署
规范参考
当遇到具体模型类型(优化/预测/评价/分类/机理)时,读取 references/math_modeling_norms.md 中对应小节。该文件包含完整的题型防错速查、代码实现防错、论文写作规范和美赛专项规范。
§1 总控 — 启动与编排
1.1 询问用户偏好
优先询问(按重要性排序):
- 排版引擎:Typst 还是 LaTeX?— 决定 §4 使用哪套模板
- 竞赛类型:国赛/华为杯/华中杯/美赛/...— 决定模板选择
- 论文语言:中文/英文 — 美赛强制英文
- 子问题数量:已知 N 个 / 待分析确定
1.2 制定方案 plan.md
# 方案
用户偏好:
- 排版引擎:<Typst / LaTeX>
- 竞赛类型:<国赛 / 华为杯 / MCM / ...>
- 论文语言:<中文 / 英文>
- 子问题数量:<已知 N 个 / 待分析确定>
workflow:
step skills
1. 赛题分析与建模设计 - §2
2. 编程实现和图表生成 - §3
3. 竞赛论文撰写 - §4
4. 验证和验收 - §5
1.3 项目目录结构
.
├── plan.md # 本文件
├── todo.md # 待办事项
├── reports/
│ ├── ANALYSIS_MODELING_REPORT.md # §2 产出
│ ├── RESULTS_REPORT.md # §3 产出
│ ├── VERIFY_REPORT.md # §5 产出
├── code/ # §3 代码
│ ├── problem1.py
│ ├── problem2.py
│ └── utils.py
├── results/ # §3 结果记录
├── figures/ # §3 数据图 PDF
├── paper/ # §4 论文
│ ├── main.typ / main.tex
│ └── sections/
1.4 执行顺序
| 阶段 | 职能 | 主要产出 |
|---|---|---|
| §2 分析与建模 | 解析题意、建立模型、求解策略 | ANALYSIS_MODELING_REPORT.md |
| §3 编码与图表 | 可复现代码、实验结果、数据图 | code/, results/, figures/, RESULTS_REPORT.md |
| §4 论文撰写 | 选择模板、插入图表、撰写全文 | paper/ |
| §5 验收门禁 | 硬错误检查、编译验证 | VERIFY_REPORT.md |
每完成一个阶段,更新 todo.md。
§2 赛题分析与建模设计
2.1 子问题拆解
只把题面中明确编号的顶层问题当作子问题("问题一/二/三""Problem 1/2/3")。不要把小问、背景描述、数据说明、提交要求误当成独立子问题。
2.2 假设敏感性预检
对影响结果的歧义至少给出两种解释,用逻辑递进或简单验算判断选择。关键检查:
- 模糊表述及多种解释
- 快速验算与递进性检查
- 最终采用解释
- 若某假设会让后续问题没有边际效果,回头调整
2.3 建模报告结构
## 1. 总体建模框架
## 2. 数据处理方案
## 3. 符号说明
## 4. 问题一模型(目标/假设/约束/求解)
## 5. 问题二模型
## 6. 问题三模型 ← 按实际数量调整
## 7. 灵敏度分析与检验方案
## 8. 代码实现任务清单
2.4 题型防错速查
详细内容见 references/math_modeling_norms.md "题型防错速查"小节,包含以下关键约束:
| 题型 | 核心防错点 |
|---|---|
| 优化类 | 非负约束、整数约束、容量约束;取整后必验证可行性 |
| 预测类 | 时序数据按时间划分;标准化在训练集 fit;防数据泄露 |
| 评价类 | 指标正负向统一、权重和为1;AHP 检查一致性 CR<0.1 |
| 分类/聚类 | 类别不平衡用 F1/AUC-ROC;K-means 需指定 K |
| 机理/动力学 | 状态变量单位标注;刚性系统用 Radau/BDF;检查守恒量 |
§3 编程实现与数据图表
3.1 代码结构
按子问题实现,按顺序完成并运行,不要一次性写完不跑。
每个子问题必须:
- 读取所需数据
- 实现模型/算法
- 验证约束
- 输出核心结果
- 绘制图表
- 写入
RESULTS_REPORT.md
3.2 结果文件结构
# 计算结果
## 运行环境
## 数据读取与预处理
## 问题一结果
## 问题二结果
## 问题三结果 ← 按实际数量
## 灵敏度分析
## 约束与一致性校验
## 可复现运行方式
3.3 典型图表类型
| 场景 | 推荐图表 |
|---|---|
| 预测类 | 真实值-预测值对比、误差分布、指标对比 |
| 优化类 | 收敛曲线、成本对比、资源利用率、方案前后对比 |
| 评价类 | 综合得分排序、雷达图、热力图、敏感性曲线 |
| 数据理解 | 分布图、趋势图、相关性图、箱线图 |
图表要求:
- PDF 矢量输出,标题交给论文 caption
- 中文论文用中文坐标轴,英文用英文
- 不在图内写大标题
3.4 编码阶段关键防错
详见 references/math_modeling_norms.md "编码阶段常见错误"小节,核心要点:
scipy.optimize.minimize默认最小化;最大化对目标取负,结果中还原scipy不等式约束形式是fun(x) >= 0;容量上限x <= C应转C - x >= 0- 不只看求解器的
success;最优解必须逐条回代所有约束检查 - 整数变量取整后必须验证可行性,不可行时用修复启发式
- 随机算法固定种子,多次运行(≥5次)报告均值和标准差
- 时序数据按时间划分,不能随机打乱
3.5 12 种科研图模板(可选调用)
如果用户要求"图模板""科研绘图"等,可使用原 mathmodel-figure-templates 代码(位于 projects/mathmodel-agent/skills/mathmodel-figure-templates/),其包含:
multiclass-shap-combo 多分类 SHAP 蜂群+柱状组合图
paired-raincloud 配对云雨图
cv-roc-ci 交叉验证 ROC 置信区间
taylor-diagram 泰勒图
correlation-pairgrid 相关矩阵组合图
prediction-marginal-grid 预测-真实值边缘分布组合图
rf-tpe-surface TPE 调参 3D 曲面
grouped-corr-split-violin 下三角相关矩阵半小提琴图
grouped-circular-heatmap 分组环形热图
urban-park-cooling-combo 城市公园降温组合图
nature-chord-diagram Nature 风格和弦图
§4 竞赛论文撰写(Typst / LaTeX 双引擎)
4.1 选择模板
必须问用户排版引擎(Typst 或 LaTeX),或在 plan.md 已有记录时确认。
模板所在位置:~/.qclaw/workspace/projects/mathmodel-agent/skills/5writing/templates/
templates/zh/<竞赛>/main.typ # Typst 中文模板
templates/zh/<竞赛>-latex/main.tex # LaTeX 中文模板
templates/en/<竞赛>/main.typ # Typst 英文模板
templates/en/<竞赛>-latex/main.tex # LaTeX 英文模板
支持的中文模板(Typst + LaTeX 双版本):apmcm, changsanjiao, cumcm, default, diangongbei, dongsansheng, huashubei, huaweibei, huazhongbei, mathorcup, mcm, shuweibei, stats, wuyibei
支持的英文模板(Typst + LaTeX 双版本):apmcm, default, mcm
4.2 准备模板
检查并复制模板到 paper/:
# Typst
ls "$TEMPLATE_DIR/templates/zh/<竞赛>/main.typ" && cp -r "$TEMPLATE_DIR/templates/zh/<竞赛>/" paper/
# LaTeX
ls "$TEMPLATE_DIR/templates/zh/<竞赛>-latex/main.tex" && cp -r "$TEMPLATE_DIR/templates/zh/<竞赛>-latex/" paper/
模板缺失时,按下方章节结构从零重建最小框架。
4.3 图表规划
论文中的数值图表必须来自 results/ 和 figures/(由 §3 产出),不得编造数据。
图片路径对照:
- 写在
paper/main.xxx中 →../figures/xxx.pdf - 写在
paper/sections/*.xxx中 →../../figures/xxx.pdf
4.4 中文字题章节结构(Typst / LaTeX)
国赛/华中杯/华为杯(cumcm/huazhongbei/huaweibei):
1_restatement 问题重述与分析
2_analysis 数据理解与总体思路
3_assumptions 模型假设
4_symbols 符号说明
5_problem1 问题一建模与求解
6_problem2 问题二建模与求解
7_problemN ← 按实际子问题数量
8_sensitivity 灵敏度分析
9_evaluation 模型评价与推广
A_code 附录代码
通用模板(changsanjiao/diangongbei/huashubei/mathorcup/wuyibei):
1_restatement 问题重述与分析
2_analysis 数据理解与总体思路
3_assumptions 模型假设
4_symbols 符号说明
5_problem1 问题一
6_problem2 问题二
7_problemN ← 按实际数量
8_evaluation 灵敏度分析、评价与推广
A_code 附录代码
4.5 英文 MCM 章节结构
1_introduction Introduction
2_assumptions Assumptions
3_model_design Model Design
4_solution Solution
5_sensitivity Sensitivity Analysis
6_strengths_weaknesses Strengths & Weaknesses
7_conclusions Conclusions
A_code Code Appendix
4.6 图片插入语法
Typst 引擎:
#figure(
image("../../figures/fig_q1.pdf", width: 85%),
caption: [问题一预测误差分布],
)
LaTeX 引擎:
\begin{figure}[H]
\centering
\includegraphics[width=0.85\textwidth]{../../figures/fig_q1.pdf}
\caption{问题一预测误差分布}
\label{fig:q1}
\end{figure}
4.7 编译命令
# Typst
typst compile paper/main.typ paper/output.pdf
# LaTeX (中文,xelatex 跑两遍)
cd paper && xelatex -interaction=nonstopmode main.tex && xelatex -interaction=nonstopmode main.tex
4.8 写作防错
- 正文不出现内部文件名、临时目录、工作流说明
- 摘要最后写,每个子问题包含方法和关键数值
- 公式出现后解释符号含义
- 参考文献必须真实存在,不编造
- 美赛总页数不超过 25 页(不含 AI 声明附录)
- 图表前后有引导和解释文字,不连续堆图
§5 验收门禁
5.1 7 项硬错误检查
以下问题必须判定 FAIL,修复前不可交付:
| # | 检查项 | 判定 FAIL 条件 |
|---|---|---|
| 1 | 入口文件 | 缺少 main.typ 或 main.tex |
| 2 | 章节完整性 | 入口引用的章节文件不存在 |
| 3 | 标题检查 | 正文章节缺少一级标题 |
| 4 | 占位符 | 正文仍有 TODO、PLACEHOLDER、待补充 等 |
| 5 | 内部泄露 | 正文出现内部工作流文件名、临时目录 |
| 6 | 图片路径 | 引用的图片文件不存在 |
| 7 | 数值一致性 | 关键数值与 RESULTS_REPORT.md 冲突 |
5.2 文本质量门禁
使用原 6verity 脚本(位于 projects/mathmodel-agent/skills/6verity/scripts/writing_check.sh):
SCRIPT_PATH="~/.qclaw/workspace/projects/mathmodel-agent/skills/6verity/scripts/writing_check.sh"
bash "$SCRIPT_PATH" \
--paper-dir "paper" \
--main "paper/main.typ" \
--sections-dir "paper/sections" \
--figures-dir "figures" \
--results-file "reports/RESULTS_REPORT.md"
5.3 编译检查
# Typst
typst compile paper/main.typ _tmp/output.pdf && echo "COMPILE OK"
# LaTeX
cd paper && xelatex -interaction=nonstopmode main.tex && echo "COMPILE OK"
5.4 视觉检查(如有视觉能力)
导出 PDF 页面 PNG 后逐页检查:空白页、裁切、表格越界、图片重叠、字体乱码。
mkdir -p _tmp/pdf-pages
pdftoppm -png -r 160 paper/output.pdf _tmp/pdf-pages/page
5.5 验收报告结构
# 验证和验收报告
## 结论 PASS / FAIL
## 检查项
| 检查项 | 结果 | 说明 |
| 章节结构 |
| 图表引用 |
| 数值一致性 |
| 文本质量门禁 |
| 编译 |
| PDF 视觉检查 |
| 仍需处理的问题 |
质量总纲
- 防编造 — 所有结论回到题面或数据,不编造数值、字段、参考文献
- 可复现 — 代码、随机种子、运行方式全部记录
- 一致性 — 分析→模型→代码→结果→论文,数值同口径
- 不套话 — 每段文字有信息,不填废话
- 交付门禁 — 7 项硬错误必须全 PASS
Current listing version
1.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 覆盖数学建模竞赛全流程,解决用户从赛题分析到论文提交的核心痛点
- 支持多种竞赛类型和双排版引擎,具备高实用性和广泛适用性
Highlights
- 触发词精准完整,明确区分排版引擎、竞赛类型和语言偏好
- 能力边界清晰,避免与其他 Skill 功能重叠
Highlights
- 五阶段工作流清晰划分,每阶段有明确产出和验收标准
- 包含完整的项目目录结构和端到端执行示例
Highlights
- 7项硬错误检查确保交付质量,覆盖入口文件、章节完整性、数值一致性等关键项
- 编译验证和文本质量门禁提供多重保障
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.