CUMCM 国赛、MCM/ICM 美赛与电工杯数学建模竞赛的端到端协作工作流。Use when a user explicitly works on one of these modeling contests or asks to run/review a modeling-competition paper from problem selection through modeling, solving, robustness, writing, compliance, and final submission review. Provides 10 stages, persistent decision state, competition-specific rules/templates, deterministic scoring helpers, numbered decisions, and Codex/Claude Code handoff. Do not trigger for generic model selection, ordinary data analysis, or non-competition paper review.
npx skills add https://github.com/handsomeZR-netizen/mathmodel-skill --skill mathmodel-skill
10 阶段把 72–96 小时的竞赛协作变成可恢复、可检查的流程。用户回答关键问题,agent 维护状态与脚本。每阶段产出经过 rubric 自评、定向精修与跨阶段一致性回检;Stage 8–9 先遵守当届官方规则,再做多视角终审。CUMCM 包含 91 份来源文档,其中 59 份进入文本统计;MCM/电工杯经验统计明确为 n=0,不提供合成分位。
v6.1 更新: 加入竞赛规则基线与 AI 使用披露链路;三竞赛统一使用 marker 模板并对提交元数据 fail closed;修复状态路径错位、评分 verdict 持久化、题型权重合并和 YAML frontmatter 等问题;新增 preflight doctor 与自动化验证。
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.1 以 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。
优先使用当前 harness 可用的原生选择 UI;没有时回退到 markdown 编号列表。两者语义等价,见 references/harness_compat.md §1。
| 类型 | 位置 | 例 |
|------|------|-----|
| skill 内通用 | skill 根目录的相对路径 | references/stage_05_subproblem_loop.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>/main.tex | templates/latex/cumcm/main.tex, templates/latex/mcm/main.tex |
| 用户产物 | 用户工作目录的相对路径 | <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 个启动字段;用户已经提供或 state 已记录的字段不再询问,只把尚缺字段合并成一轮问答 (Claude Code: AskUserQuestion; Codex: 编号列表):
- 竞赛 (cumcm 国赛 / mcm 美赛 / diangong 电工杯, 默认 cumcm)
- 题号 (依竞赛: cumcm A-E / mcm A-F / diangong A-B; "未公布"亦可)
- 队员数 + 各人擅长 (建模/编程/写作)
- 截止时间 (ISO 字符串或 "距现在 X 小时")
- 题目 PDF 路径 ("未公布"亦可)
3. 自动初始化 (agent 自动完成, 不要让用户编辑 json):
- 不存在 `<cwd>/state/decision_log.json` → 创建目录并复制 `<skill>/templates/shared/decision_log.json` 到该路径
- 写入 decision_log.competition = <选定竞赛>
- 已存在 → 读 current_stage 字段决定恢复点
4. 加载 `competitions/<comp>/current_rules.md`(若存在),打开其中官方链接核对当届规则并写入 compliance;再按需加载 winning patterns
5. 进入 Stage 0 (`references/stage_00_kickoff.md`), 不重复问已知字段;若题面未公布,完成环境与协作准备后保持 `qi_count=null` 并等待题面,不进入 Stage 1
已有 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 | 规则基线 | 经验数据状态 |
|---|---|---|---|---|---|
| cumcm | 72h | 中文 | xelatex / 原创 ctexart | CUMCM 2026 | 91 来源文档 / 59 可提取样本 |
| mcm | 96h | English | pdflatex / article | COMAP 2027 | n=0,无论文分位 |
| diangong | 72h | 中文 | xelatex / ctex | 官网 2026-03-21 页面 | n=0,无论文分位 |
| Mode | 上下文策略 | 反馈层 | 用途 |
|---|---|---|---|
| fast | 只保留当前阻断项与最小证据 | L1 单次 | 选题试跑 / sanity check |
| standard | 按阶段加载并保留决策摘要 | L1+L2 | 默认主流程 |
| championship | 在终审阶段扩展证据与独立视角 | L1+L2+L3+L4 + red-team | 提交前最后冲刺 |
模式自动推荐 (按距 deadline 剩余):
| # | 阶段 | 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 | 模型选型 (证据驱动的候选比较) | 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 | 按题目分配 | L1 + 子检查点 | 从题面提取实际子问数;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 + L2 | 当届规则、AI 披露、摘要类型与 LaTeX 模板 |
| 9 | 提交合规 + Panel | stage_09_review.md | 2-6h | L1 + L3 panel | 页数/匿名/披露 + anti-patterns + 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>/current_rules.md 存在时读取,并核对其中官方链接competitions/<comp>/{winning_patterns, phrase_bank, abstract_template, paper_skeleton}.mdcompetitions/<comp>/empirical.json 只作评分前参考;CUMCM 为 59 份可提取样本的观察分位,MCM/电工杯为 n=0 占位且不得推断数值门槛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 三处必须完全一致。
每阶段:
<cwd>/state/decision_log.json, 核对 current_stage 与上下文current_stage += 1decision_log.json v3.1 schema 关键字段 (与 templates/shared/decision_log.json 对齐):
competition, task_type, mode, current_stage, budget, events, complianceqi_count, qi_weights, qi_statusweighted_mean, review_qis, refine_qis (stage 5 加权聚合用)L2 跨阶段回检 (stage 5/6/8 末尾) 读这个文件主动找冲突, 触发定向回滚: 不重做整阶段, 只针对冲突点。
scripts/extract_diff.py), 优先只传相关 sectionnull,不得估算成已用额度competitions/cumcm/: 91 份来源文档,59 份成功文本提取并进入观察分位;现有提取有局限,不能解释为官方阈值或获奖预测competitions/mcm/: 规则基线已按 COMAP 2027 核对;经验模式是维护者启发,empirical 为 n=0competitions/diangong/: 官网参赛规则与论文规范已于 2026-07-22 核对;经验模式是维护者启发,empirical 为 n=0references/model_catalog.md 跨竞赛复用当前 scripts/ingest_papers.py 是维护期归档工具,不能直接重建三个竞赛包的 empirical.json。新增语料前先补来源 provenance、提取 QA 与分组样本量。
核心工作流可离线运行;当届规则与问题要求必须从官方来源重新核对。下列资源可作人工补充:
personqianduixue/Math_Model, datawhalechina/intro-mathmodel, dxs.moe.gov.cn 优秀论文展廊comap.com, MCM Tutorial (Frank Giordano)Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib/seaborn/plotly with publication styles. For quick exploration use seaborn or plotly directly.
Coding Agent Account Manager - Sub-100ms account switching for AI coding CLIs with fixed-cost subscriptions. Vault profiles, isolated profiles for parallel sessions, smart rotation with health scoring, cooldown tracking, automatic failover, TUI dashboard. Go CLI.
Use this umbrella skill when the request spans multiple Cloud Claw user-facing domains, especially launching a new AltClaw or OpenClaw VM and then managing lifecycle, logs, renewal, or dashboard access through the local altllm cloud-claw-* commands in this repository.
Creating interactive data visualisations using d3.js. This skill should be used when creating custom charts, graphs, network diagrams, geographic visualisations, or any complex SVG-based data visua...
Use this skill when you need to report on a troubleshooting session
Query and browse evaluation results stored in MLflow. Use when the user wants to look up runs by invocation ID, compare metrics across models, fetch artifacts (configs, logs, results), or set up the MLflow MCP server. ALWAYS triggers on mentions of MLflow, experiment results, run comparison, invocation IDs in the context of results, or MLflow MCP setup.
Guided journey from an app people sign up for and then quietly abandon to a sealed retention engine with a habit loop, an activated first run, and one metric the whole team trusts. Orchestrates eight skills phase by phase - hooked-ux, improve-retention, continuous-discovery, lean-ux, inspired-product, lean-analytics, microinteractions, drive-motivation - asking the user questions at every decision point and recording results in the project docs/ folder (PRODUCT.md, METRICS.md, GROW-APP-PLAN.md) so the journey resumes across sessions. Use when the user wants to lift activation and retention, design a habit loop, fix a leaky onboarding funnel, or says ''users sign up then disappear''. Do not use to fix broken UX or performance that no engagement mechanic can paper over - run improve-app first; if there is no app yet, use create-app. For one framework in isolation, invoke that skill directly.
Guided journey from a stalled, plateaued business to one with an honest diagnosis, a working operating rhythm, and offers repriced to real value. Orchestrates eight skills phase by phase - good-strategy-bad-strategy, traction-eos, high-output-management, team-topologies, drive-motivation, lean-analytics, negotiation, monetizing-innovation - asking the user questions at every decision point and recording results in the project docs/ folder (STRATEGY.md, OPERATIONS.md, METRICS.md, IMPROVE-BUSINESS-PLAN.md) so the journey resumes across sessions. Use when the user wants to fix a business that has plateaued, diagnose why growth stalled, tighten strategy and execution, re-motivate a team, or says ''revenue is flat and I do not know why''. Starting from scratch with no customers: use create-business. Once the fundamentals work and the goal is expansion: use grow-business. When the product itself drags the business down: use improve-app. For one framework in isolation, invoke that skill directly.
Take handsomezr-netizen/mathmodel-skill from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.