From math-modeling
Universal mathematical modeling agent for all competitions. Activates when the user mentions "math modeling", "mathematical modeling", "美赛", "国赛", "建模", "MCM", "ICM", "MathorCup", or asks to solve a modeling competition problem. Also use when the user wants to analyze a problem, build a mathematical model, decompose it into subtasks, and solve each subtask with code execution. Covers the complete workflow from problem understanding to LaTeX paper generation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/math-modeling:math-modelingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A stage-by-stage mathematical modeling agent for all competition types.
references/abstract_guide.mdreferences/actor_critic.mdreferences/code_templates.mdreferences/dag_scheduler.mdreferences/hmml_evaluation.mdreferences/hmml_index.mdreferences/hmml_ml.mdreferences/hmml_optimization.mdreferences/hmml_or.mdreferences/hmml_prediction.mdreferences/templates/cumcm/main.texreferences/templates/generic/main.texreferences/templates/mcm/main.texA stage-by-stage mathematical modeling agent for all competition types.
This skill guides Claude Code through a structured pipeline with global iteration:
Stage 1 and 2 pause for user review. Stage 3 runs automatically unless errors occur. Stage 3.5 performs global quality review with up to 3 iterations. Stage 4 pauses for final review.
This skill activates when the user:
/math-model commandBefore starting, verify and install dependencies:
python --version)pip install numpy pandas scipy matplotlib seaborn scikit-learn networkx sympy openpyxl statsmodels
Create the workspace directory structure:
mkdir -p mm-workspace/code mm-workspace/data mm-workspace/charts mm-workspace/05_paper/sections mm-workspace/05_paper/figures
Initialize git version management:
cd mm-workspace && git init
Create .gitignore in mm-workspace:
__pycache__/
*.pyc
.ipynb_checkpoints/
*.aux
*.log
*.out
*.bbl
*.blg
*.fls
*.fdb_latexmk
*.synctex.gz
Then git add -A && git commit -m "init: workspace initialized"
Read and extract the problem:
mm-workspace/raw_problem.txtDetect competition type if user mentions it (affects paper template and language)
After each stage or significant milestone, commit workspace state:
| 时机 | commit message |
|---|---|
| Stage 1 完成后 | feat(s1): problem analysis complete |
| Stage 2 完成后 | feat(s2): modeling and decomposition complete |
| Stage 3 每个任务完成后 | feat(s3): task {id} solved |
| Stage 3 全部完成(每轮迭代) | feat(s3): all tasks solved - iteration {N} |
| 全局审查通过后 | git tag review-pass-v{N} |
| Stage 4 完成后 | feat(s4): paper generated |
| 最终定稿 | git tag final-v{N} |
Commit command: cd mm-workspace && git add -A && git commit -m "<message>"
After initialization, invoke the mm-analysis skill to perform deep problem analysis.
Input: Problem text + dataset files (if any)
Output: mm-workspace/01_analysis.json
After Stage 1 completes:
After user confirms Stage 1, invoke the mm-modeling skill.
Input: mm-workspace/01_analysis.json
Output: mm-workspace/02_modeling.json
After Stage 2 completes:
After user confirms Stage 2, invoke the mm-solving skill for each task in DAG order.
Input: mm-workspace/01_analysis.json + mm-workspace/02_modeling.json
Output: mm-workspace/03_task_{id}.json for each task
Task solving runs automatically through all tasks:
After all tasks complete, commit:
cd mm-workspace && git add -A && git commit -m "feat(s3): all tasks solved - iteration {N}"
After Stage 3 completes, invoke the mm-review skill for global quality review.
Input: All workspace JSON files
Output: mm-workspace/03.5_review.json
iteration = 1
max_iterations = 3
while iteration <= max_iterations:
# Run global review
invoke mm-review skill
read mm-workspace/03.5_review.json
if review.overall_passed == true:
cd mm-workspace && git tag review-pass-v{iteration}
break # Review passed, proceed to Stage 4
else:
# Review found issues
Display review findings and rework_list to user
if iteration == max_iterations:
Ask: "已达到最大迭代次数({max_iterations})。是否接受当前结果并继续生成论文?"
if user accepts:
break
else:
Stop pipeline (user wants manual intervention)
Ask: "审查发现以下问题(第 {iteration} 轮),是否进入第 {iteration+1} 轮迭代重修?"
if user confirms:
cd mm-workspace && git tag "review-iteration-{iteration}-needs-work"
# Rework only the failed tasks
for each task in rework_list:
Re-run mm-solving for that specific task
cd mm-workspace && git add -A && git commit -m "feat(s3): rework iteration {iteration+1}"
iteration += 1
else:
break # User accepts current results
Key rules:
After all tasks complete, invoke the mm-writing skill for LaTeX paper generation.
Input: All workspace JSON files + code + charts
Output: mm-workspace/05_paper/main.tex → compiled mm-workspace/05_paper/main.pdf
See mm-writing skill for details.
After paper generation:
Load these reference files as needed:
references/hmml_index.md - HMML method index (load first during Stage 3)references/hmml_*.md - HMML domain files (load relevant domains only)references/actor_critic.md - Actor-Critic mechanism guidereferences/dag_scheduler.md - DAG scheduling strategyreferences/code_templates.md - Code template specificationreferences/abstract_guide.md - Abstract generation guidenpx claudepluginhub 911439925/math-modeling-skill --plugin math-modelingCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.