三竞赛 (CUMCM/MCM/电工杯) 数学建模 skill — harness-agnostic, 同时支持 Claude Code 与 Codex CLI, 全程问答式 (Friendly Mode), 10 阶段 + 4 反馈层 + per-Qi 加权聚合 + 题型 dim 加权 + empirical 实测分位锚定
# Add to your Claude Code skills
git clone https://github.com/handsomeZR-netizen/mathmodel-skillGuides for using ai agents skills like mathmodel-skill.
Last scanned: 6/11/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-06-11T08:49:59.334Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}mathmodel-skill is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by handsomeZR-netizen. 三竞赛 (CUMCM/MCM/电工杯) 数学建模 skill — harness-agnostic, 同时支持 Claude Code 与 Codex CLI, 全程问答式 (Friendly Mode), 10 阶段 + 4 反馈层 + per-Qi 加权聚合 + 题型 dim 加权 + empirical 实测分位锚定. It has 134 GitHub stars.
Yes. mathmodel-skill passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/handsomeZR-netizen/mathmodel-skill" and add it to your Claude Code skills directory (see the Installation section above). mathmodel-skill ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
mathmodel-skill is primarily written in Python. It is open-source under handsomeZR-netizen on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh mathmodel-skill against similar tools.
No comments yet. Be the first to share your thoughts!
10 阶段把"3-4 天打 1 篇竞赛论文"工程化, 全程问答式——用户只需回答编号问题, 不必手敲 bash / python / json。每阶段产出经过 rubric 自评 + section-level patch 精修, 跨阶段一致性回检, 终局多视角 panel。三竞赛通用框架 + 国赛 91 篇真烘焙 + MCM/电工杯 seed v0.1。
v6 更新: Codex-native packaging (agents/openai.yaml + .codex-plugin/plugin.json), 按 OpenAI Codex Skills / AGENTS.md / Plugins 的官方形态组织入口, 同时保留 v5 的 harness-agnostic 与 Friendly Mode。
Codex 优先按 skill 目录发现本文件:
$HOME/.agents/skills/mathmodel-skill/<repo>/.agents/skills/mathmodel-skill/agents/openai.yaml.codex-plugin/plugin.json + skills/mathmodel-skill/SKILL.md shimAGENTS.md 仍可作为 repo / workspace 级 instructions, 但不是唯一入口当 skill 已安装后, 用户可直接说"开始建模"或显式说"使用 $mathmodel-skill 开始建模"。
本 skill v6.0 以 Codex Skills 为一等入口, 同时保持 harness-agnostic 设计:
| harness | 入口文件 | 用户交互工具 | 状态文件 |
|---|---|---|---|
| Claude Code | SKILL.md (本文件) |
AskUserQuestion 工具 |
cwd/state/decision_log.json |
| Codex CLI / Codex app | skill 目录中的 SKILL.md + 可选 AGENTS.md |
markdown 编号列表 | 同上 (互通) |
跨 harness 互通: day 1 用 Codex 跑 stage 0-2, day 2 切回 Claude Code 接着 stage 3+, 状态完全保留。详见 references/harness_compat.md。
核心原则: 用户只需回答编号问题, 不应被要求手敲 bash / python / json。
Claude Code: 用 AskUserQuestion 工具; Codex: 用 markdown 编号列表 (1-4 + 兜底)。两者语义等价, 见 references/harness_compat.md §1。
| 类型 | 位置 | 例 |
|---|---|---|
| skill 内通用 | skill 根目录的相对路径 | references/stage_05.md, templates/shared/decision_log.json |
| 竞赛特化 | competitions/<comp>/... 按 decision_log.competition dispatch |
competitions/cumcm/winning_patterns.md, competitions/mcm/abstract_template.md |
| LaTeX 模板 | templates/latex/<comp>/ |
templates/latex/cumcm/cumcmthesis/, templates/latex/mcm/main.tex |
| 用户产物 | 用户 cwd/ 相对路径 |
cwd/state/, cwd/results/, cwd/figures/, cwd/paper_workspace/ |
| state 持久化 | cwd/state/decision_log.json |
各 stage 必读必写 |
| 环境变量 | MATHMODEL_STATE_DIR (兼容 CUMCM_STATE_DIR) / MATHMODEL_COMPETITION 可覆盖 |
scripts 用此变量 |
约定: <skill>/ = skill 安装目录, <cwd>/ = 用户 cwd, <comp>/ = 当前竞赛 (cumcm | mcm | diangong)。
1. 一段话介绍 (≤50 字): "启动数学建模工作流, 10 阶段 + 三竞赛, 全程问答式."
2. 一次性 5 问 (Claude Code: AskUserQuestion 单条消息; Codex: 5 个编号列表):
- 竞赛 (cumcm 国赛 / mcm 美赛 / diangong 电工杯, 默认 cumcm)
- 题号 (依竞赛: cumcm A-E / mcm A-F / diangong A-B; "未公布"亦可)
- 队员数 + 各人擅长 (建模/编程/写作)
- 截止时间 (ISO 字符串或 "距现在 X 小时")
- 题目 PDF 路径 ("未公布"亦可)
3. 自动初始化 (agent 自动完成, 不要让用户编辑 json):
- 不存在 cwd/state/decision_log.json → cp <skill>/templates/shared/decision_log.json
- 写入 decision_log.competition = <选定竞赛>
- 已存在 → 读 current_stage 字段决定恢复点
4. 加载 competitions/<comp>/winning_patterns.md 一次 (建立基线), 后续不再读
5. 进入 Stage 0 (references/stage_00_kickoff.md), 不重复问已问过的问题
已有 state 触发 (用户中途回到 skill):
1. 读 cwd/state/decision_log.json 的 competition 与 current_stage
2. 加载对应 stage_NN.md (按需结合 competitions/<comp>/* 内容)
3. 不重复读 winning_patterns
时长 / 语言 / 模板 / 数据状态 由 competition 决定; token 预算 / 反馈深度由 mode 决定。两者正交组合。
| Competition | 时长 | 语言 | LaTeX | 子问数 IQR | 数据状态 |
|---|---|---|---|---|---|
| cumcm | 72h | 中文 | xelatex / cumcmthesis | [3, 5] | stable (91 篇 2023-2025) |
| mcm | 96h | English | pdflatex / article | [3, 6] | seed v0.1 |
| diangong | 72h | 中文 | xelatex / ctex | [6, 8] | seed v0.1 |
| Mode | Token | 反馈层 | 用途 |
|---|---|---|---|
| fast | ≤ 50k | L1 单次 | 选题试跑 / sanity check |
| standard | ≤ 200k | L1+L2 | 默认主流程 |
| championship | ≤ 500k | L1+L2+L3+L4 + red-team | 提交前最后冲刺 |
模式自动推荐 (按距 deadline 剩余):
60h: standard (最后 6h 升 championship)
| # | 阶段 | reference | 时长 | 反馈 | 竞赛差异点 |
|---|---|---|---|---|---|
| 0 | 团队启动 + 资料预扫 | stage_00_kickoff.md |
1h | L1 | 时长 / 语言 / 编译器 / 题号体系 |
| 1 | 选题 (多题对比 → 1) | stage_01_problem_selection.md |
2-4h | L1 | 题号体系 (A-E/A-F/A-B) + task_type 写入 |
| 2 | 问题深度解析与分解 | stage_02_analysis.md |
2-3h | L1 | 通用 |
| 3 | 模型选型 (≥3 候选) | stage_03_model_selection.md |
2-4h | L1 + 反事实 | 通用 |
| 4 | Foundation (假设+符号+术语) | stage_04_foundation.md |
1h | L1 | 通用 |
| 5 | 递归子问题循环 Q1..Qn + per-Qi 加权聚合 | stage_05_subproblem_loop.md |
6-12h × n | L1 + 子检查点 | 子问数差异 (cumcm 4 / mcm 4 / diangong 7); per-Qi 加权 |
| 6 | 全局灵敏度 / 稳健性 | stage_06_robustness.md |
2-3h | L1 + L2 | 工程参数 (diangong) vs 数学参数 (cumcm/mcm) |
| 7 | 模型评价 + 推广 | stage_07_evaluation.md |
1-2h | L1 | 通用 |
| 8 | 论文写作 | stage_08_writing.md |
12-30h | L1 | 摘要类型 (5段 / 1-page+Letter / 4段) + LaTeX 模板 |
| 9 | 终稿审核 + Panel | stage_09_review.md |
2-6h | L1 + L3 panel | anti_patterns + panel personas 各异 |
只在进入阶段 N 时加载 references/stage_NN_*.md。切勿一次性全读。
各阶段额外加载 (按需 + 按 competition 切换):
cwd/state/decision_log.json 必读cwd/state/decision_log.json 必写 (核心决策 + 5 维评分)references/rubrics.md 对应章节 (L1 评分用)competitions/<comp>/topic_specs.json (题号 → task_type 映射)references/model_catalog.md (跨竞赛通用)scripts/score_artifact.py --mode aggregate_qi 聚合competitions/<comp>/{winning_patterns, phrase_bank, abstract_template, paper_skeleton}.mdcompetitions/<comp>/empirical.json 注入 evidence (cumcm 真值; mcm/diangong seed 自动带 [seed: ...] 标记)competitions/<comp>/anti_patterns.md (逐条对照) + rubric_overlay.json 的 panel_personasreferences/feedback_layer*.mdreferences/harness_compat.mdverdict 优先级 (从高到低):
| verdict | 触发 | 行为 |
|---|---|---|
block |
issues 含 ≥1 high-severity | 暂停 skill, 用户介入 |
pass_early |
raw_min ≥ 9 AND weighted_mean ≥ 9 | iter-1 早退 |
pass |
raw_min ≥ 7 AND weighted_mean ≥ 8 | 进下一阶段 |
pass_with_review (stage 5) |
任 Qi mark_for_review 但加权阈值满足 | 进 stage 6, L2 必读 review_qis |
refine |
其他 | section-patch 精修, iter+=1 (cap 3) |
refine_partial (stage 5) |
任 Qi.min < 7, 其他 Qi 已 pass | 仅 refine 该 Qi, 不动其他 |
carryover |
iter == 3 仍 refine | 进下一阶段, 标记由 L2 处理 |
weighted_mean = Σ(s_i × w_i) / Σ(w_i), 权重来自 config/dim_weights.json[<comp>][<task_type>] (clamp [0.7, 1.5]); task_type=default 全 1.0 等价老逻辑。
此定义在 feedback_layer1_critic.md / rubrics.md / scripts/score_artifact.py 三处必须完全一致。
每阶段:
Read cwd/state/decision_log.json, 核对 current_stage 与上下文current_stage += 1decision_log.json v3.0 schema 关键字段 (与 templates/shared/decision_log.json 对齐):
competition, task_type, mode, current_stage, budget, eventsqi_count, qi_weights, qi_statusweighted_mean, review_qis, refine_qis (stage 5 加权聚合用)L2 跨阶段回检 (stage 5/6/8 末尾) 读这个文件主动找冲突, 触发定向回滚: 不重做整阶段, 只针对冲突点。
scripts/extract_diff.py), 不重传完整 artifact (省 ~60% token)competitions/cumcm/: 91 篇真国赛 2023-2025 PDF 烘焙 (empirical.json 含 11 维 p25/p50/p75); 91 PDF 已存档不读, 仅蒸馏 markdowncompetitions/mcm/: SEED v0.1, 基于 COMAP 公开 scoring rubric + Outstanding Winner 公开模式手写; empirical 占位competitions/diangong/: SEED v0.1, 基于历年题量 + 公开评审标准估算; empirical 占位references/model_catalog.md 跨竞赛复用后续如有 30+ MCM Outstanding 或电工杯一等奖 PDF, 可用 scripts/ingest_papers.py --competition <comp> 重新烘焙覆盖 seed。
skill 自包含, 运行时不联网。下列离线资源可作人工补充:
personqianduixue/Math_Model, datawhalechina/intro-mathmodel, dxs.moe.gov.cn 优秀论文展廊comap.com, MCM Tutorial (Frank Giordano)面向 CUMCM (国赛) / MCM·ICM (美赛) / 电工杯 三类数学建模竞赛的 10 阶段工程化流程。全程问答式——用户只需回答编号问题, 不必手敲 bash / python / json。同时支持 Codex 与 Claude Code, 状态文件跨 harness 互通。带 4 层反馈、跨阶段一致性回检、终局多视角评审、题型差异化加权、实测分位锚定打分。
数学建模竞赛是 3-4 天完成 1 篇 25-40 页论文的紧迫工程, 流程从选题、建模、求解、灵敏度到写作很容易在某一环悄悄崩。这套 skill 把每个阶段的检查项、典型反模式、跨阶段一致性约束固化下来, 让大模型按固定流程跟使用者一起走, 减少返工。
v6 起三条设计:
agents/openai.yaml 与 .codex-plugin/plugin.json, 适合放入 $HOME/.agents/skills/ 或项目 .agents/skills/。AGENTS.md / plugin 入口, Claude Code 通过 SKILL.md 入口, 状态文件 cwd/state/decision_log.json 跨 harness 互通。Day 1 在 Codex 跑 stage 0-2, Day 2 切回 Claude Code 接着 stage 3+, 完全不丢状态。它不替选题、不替建模、不保证拿奖。作用是把节奏卡住, 把容易忘的细节固化, 把别人论文里反复出现的句式与命名提取出来供模仿。
蒸馏内容来源:
empirical.json 含 11 维 p25/p50/p75 实测分位)| 竞赛 | 时长 | 语言 | LaTeX | 子问数 | 数据状态 |
|---|---|---|---|---|---|
| CUMCM 国赛 | 72h | 中文 | xelatex / cumcmthesis | 3-5 | stable (91 篇真烘焙) |
| MCM/ICM 美赛 | 96h | English | pdflatex | 3-6 | seed v0.1 (公开评审标准 + 教材共识) |
| 电工杯 | 72h | 中文 | xelatex / ctex | 6-8 | seed v0.1 (历年题量估算) |
切换方式: stage 0 kickoff 第一问选竞赛 → 自动写入 decision_log.competition → 后续阶段从 competitions/<comp>/ 加载对应 winning_patterns / phrase_bank / anti_patterns / abstract_template / paper_skeleton。
git clone https://github.com/handsomeZR-netizen/mathmodel-skill.git ~/.claude/skills/mathmodel-skill
pip install -r ~/.claude/skills/mathmodel-skill/templates/shared/requirements.txt
启动 Claude Code, 跟 Claude 说"开始建模"或"打 mcm"。
git clone https://github.com/handsomeZR-netizen/mathmodel-skill.git ~/.agents/skills/mathmodel-skill
pip install -r ~/.agents/skills/mathmodel-skill/templates/shared/requirements.txt
cd <your-team-workspace>
codex
跟 Codex 说"开始建模"或显式说"使用 $mathmodel-skill 开始建模"。Codex 会按 skill metadata 触发 SKILL.md; 如果当前 workspace 也有 AGENTS.md, Codex 会把它作为项目级 instructions 叠加。
项目级安装也可以:
mkdir -p .agents/skills
git clone https://github.com/handsomeZR-netizen/mathmodel-skill.git .agents/skills/mathmodel-skill
Codex 没有原生选项 UI 时, skill 自动回退成 markdown 编号列表 (1) ... 2) ... 4) 让我决定 (推荐 X)), 你回数字即可。
V6 已包含 .codex-plugin/plugin.json, 可作为 Codex plugin 形式分发。该 manifest 按官方结构指向 ./skills/, 其中 skills/mathmodel-skill/SKILL.md 是薄 shim, 会继续加载根目录主 SKILL.md。GitHub Release 源码包即可作为云端分发物。
AGENTS.md, 用于项目级 instructions。SKILL.md frontmatter description 做触发, agents/openai.yaml 做 UI 元数据。第一次会问 5 个问题 (竞赛、题号、队员、截止、PDF), 然后从 Stage 0 开始走。每个 stage 的关键决策点都会以编号问答呈现; 想偷懒就一直选"让我决定 (推荐 X)", 也能跑通。
跨 harness 接力: 状态全部在 cwd/state/decision_log.json, 队友换 harness 接着跑不丢进度。详见 references/harness_compat.md。
SKILL.md # Claude Code 入口, 三竞赛矩阵 + 加载协议 + verdict 定义
AGENTS.md # Codex 项目级 instructions, 指向 SKILL.md + 说明 harness 差异
agents/openai.yaml # Codex skill UI 元数据 + 默认 prompt
.codex-plugin/plugin.json # Codex plugin 分发 manifest
skills/mathmodel-skill/ # Codex plugin 官方 skills/ 布局 shim
README.md # 当前文件
competitions/ # 竞赛特化层
cumcm/ # 91 篇真烘焙: empirical.json + 蒸馏 markdown
winning_patterns.md
phrase_bank.md
anti_patterns.md # 32 条
distilled_*.md # 4 份蒸馏: 段落 / 命名 / 结构 / 格式
empirical.json # p25/p50/p75 进入 L1 critic prompt
abstract_template.md # 5 段式 + 完整示例
paper_skeleton.md # 22-25 页骨架
rubric_overlay.json # 国赛特化 dim
topic_specs.json # A-E + task_type 映射
mcm/ # SEED v0.1 - 1-page summary + Letter
(同结构, 加 SEED 标记)
diangong/ # SEED v0.1 - 工程导向, 6-8 子问
(同结构, 加 SEED 标记)
references/ # 通用层 (跨竞赛共享)
stage_00 ~ stage_09 # 10 阶段细则 (含 YAML frontmatter)
feedback_layer1 ~ 4 # 自评 / 跨阶段回检 / 5 视角 panel / 防 gaming
rubrics.md # 评分量表 (与 SKILL.md verdict 三处统一)
model_catalog.md # 60+ 模型按 10 类 + 历年题速查
harness_compat.md # Claude Code / Codex 适配协议 (问答式 + state 互通)
templates/
latex/{cumcm,mcm,diangong}/ # 各竞赛 LaTeX 模板
shared/ # 跨竞赛通用
decision_log.json # 跨阶段状态 schema (含 v3.0 三新字段)
assumption_table.md
notation_table.md
sensitivity_table.md
code_starter/ # Python 起手代码 (优化/预测/评价/分类/仿真)
requirements.txt
config/
dim_weights.json # 三竞赛 × 题型 × stage × dim → 权重表
scripts/
score_artifact.py # L1 评分 + verdict 重算 + empirical 注入 + per-Qi 聚合 + 题型加权
extract_diff.py # section-level patch 精修 (省 60% token)
render_paper.py # md → tex → pdf 三竞赛分支 (xelatex/pdflatex)
ingest_papers.py # PDF 烘焙 (cumcm 蒸馏后已存档; 后续 mcm/diangong 可用)
tests/fixtures/ # score_artifact 单元测试样本
SKILL.md 仍是主 workflow, agents/openai.yaml 提供 Codex UI 元数据, .codex-plugin/plugin.json + skills/mathmodel-skill/ 提供 plugin 分发入口, AGENTS.md 只保留项目级 harness shim.pass_with_review 与 refine_partial 两个新 verdict 实现差异化降级 — Q2 单独 refine 不重做 Q1/Q3, 节省 ~60% 时间<skill>/ 内文件用 skill 相对路径, 用户产物 (state/results/figures/paper_workspace) 用 cwd 相对路径, 三竞赛特化文件用 competitions/<comp>/ 通配. harness 无关.不替选题、不替建模、不保证拿奖。蒸馏内容仅作模仿模板, MCM 与电工杯 seed v0.1 准确性低于 cumcm, 文件头部均有 SEED 标记。
| 模式 | Token | 耗时 | 适用 |
|---|---|---|---|
| fast | ≤ 50k | ~30 min | 选题试跑 / sanity check |
| standard (默认) | ≤ 200k | ~6h | 主流程 |
| championship | ≤ 500k | ~12h | 提交前最后冲刺 (含 L3 panel + L4 校准 + red-team) |
实测 cumcm fast 模式跑通一次约 30 min, 含 cwd/state/decision_log.json 写入和 panel 串行 5 视角. mcm 模式 1-page summary 与 Letter 部分需手工打磨, 自动产出仅作骨架.
CUMCM 91 篇真烘焙:
zhanwen/MathModel/国赛论文/2023年优秀论文/ (58 篇, A-F 全)Jackyleo-Zhao/cumcm-2025 (1 篇国二 C 题)empirical.jsonMCM/ICM seed v0.1:
电工杯 seed v0.1:
competitions/{cumcm,mcm,diangong}/); 评分系统升级 — empirical 真正进入 L1 prompt; Stage 5 per-Qi 加权聚合 + 差异化降级 (pass_with_review / refine_partial 两个新 verdict); 题型 dim 权重 (config/dim_weights.json); SKILL.md 由 9k 字节瘦身到 ≤ 6k.AGENTS.md 作为 Codex CLI 入口, references/harness_compat.md 定义跨 harness 行为约定, decision_log.json 跨 Claude Code / Codex CLI 互通. Friendly Mode — 所有关键决策点 (选题/选模型/verdict/refine 决策) 强制问答式 (编号选项 + "让我决定" 兜底), 用户不再需要手敲 bash / python / 编辑 json. stage_00 / stage_01 / stage_05 已落实问答式样板, 其余 stage 由 SKILL.md 顶层协议统一约束.