Introduction¶
Math modeling competitions (such as the Huazhong Cup and the China Undergraduate Mathematical Contest in Modeling CUMCM) often feature multiple sub-questions, numerous data files, and tightly layered constraints. A common approach is to simply ask an AI to “write an optimization model.” However, this often leads to overlooking parameters in the problem statement, messy directory structures, inability to reuse code across sub-questions, and difficulty in locating the logic causing constraint violations during debugging.
Below, we introduce the “General Math Modeling Workflow” (@user_3937f0b6/math-modeling-solver), a community Skill on SkillHub. It uses a standard SKILL.md to define the problem-solving process into five phases: Problem Comprehension, Architecture Design, Solver Implementation, Validation & Debugging, and Results Analysis. It also includes reusable patterns for data structures, cost functions, and greedy insertion, making it suitable as a long-term enabled workflow instruction within agents like Cursor.
What is this¶
One-sentence positioning: A systematic Agent Skill for math modeling competition problems with multiple sub-questions, guiding the complete process from reading and data exploration to modeling, coding, verification, and delivery.
- Handle:
@user_3937f0b6/math-modeling-solver - Version: 1.0.0
- Source: SkillHub Community (
community), Publisheruser_3937f0b6 - Category: education
- Tags:
requires_api_key=false(No API Key configuration required) - Official Page: SkillHub - General Math Modeling Workflow
The English introduction of the Skill is consistent with the page: Solve math modeling competition problems (Huazhong Cup, CUMCM, etc.) with a systematic workflow — data exploration, model building, algorithm implementation, result analysis.
Core Features¶
The following content is derived from the Skill’s SKILL.md. After installation, the Agent will respond to requests for “solving math modeling competition problems” according to this document.
Five-Phase Workflow¶
- Phase 1: Problem Comprehension — Read through all sub-questions and data files; load and inspect Excel/CSV files; extract all model parameters (speed, penalty coefficients, emission factors, etc.) from the problem statement.
- Phase 2: Solution Architecture Design — Define directory structure (e.g.,
problem_A/code,data,figures); select modeling methods (mixed-integer programming, heuristics, dynamic programming, etc.); plan the solving pipeline (data loading & preprocessing, initial solution construction, local search, constraint checking, multi-component cost); define JSON + TXT output formats. - Phase 3: Solver Implementation — Use Python + pandas/numpy as the primary stack; implement cost components such as time-varying speed, U-shaped energy consumption, load correction, soft time window penalties, and carbon price; implement greedy construction + 2-opt; handle fleet size constraints; allow incremental constraint stacking for multiple sub-questions.
- Phase 4: Validation & Debugging — Check constraints such as capacity and time windows; write specific repair logic for identified violations rather than generic patches; compare results with simpler baselines for sanity.
- Phase 5: Results Analysis — Produce structured JSON results, readable summaries, and aggregate statistics (total cost, mileage, CO₂ emissions, vehicle types, loading rate, etc.); perform cross-question comparisons.
Embedded Patterns & Deliverables¶
The Skill documentation provides copy-paste-able code structure examples, including:
infodictionary structure for graph/road network data (nodes, distance matrices, time windows, green zone customers, etc.)route_coststyle multi-component path cost calculation- Greedy insertion sorted by time windows, along with violation scanning and repair logic
- Multi-question progression: Question N+1 adds constraints based on the baseline of the previous question and compares results
Deliverables suggested for each sub-question: problemX_solver.py, problemX_result.json, problemX_result.txt, figures/*.png; cross-question comparisons may also include comparative reports and paper templates (DOCX/TXT), depending on the specific contest problem agreed upon with the Agent in the dialogue.
Installation & Activation¶
Installation follows the SkillHub Installation Documentation. First, confirm the CLI:
command -v skillhub && skillhub --version
If not installed, execute the full installation (recommended by the docs):
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash
When installing the Skill, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ and may not be recognized:
skillhub install @user_3937f0b6/math-modeling-solver --dir <skills directory>
Common paths (excerpted from SkillHub installation docs):
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
You can also follow the prompts on the SkillHub page to let the AI install @user_3937f0b6/math-modeling-solver based on https://skillhub.cn/install/skillhub.md. After installation, restart or refresh the Agent according to your client’s requirements to activate the Skill.
Typical Usage¶
The Skill declares in its description: Use this Skill when the user asks to solve math modeling competition problems (especially those with multiple sub-questions like the Huazhong Cup or CUMCM). Below is a directly reproducible interaction method that does not involve fictional contest data.
- Complete the installation described above in an environment like Cursor, ensuring
math-modeling-solverappears in the skills directory. - Create or open a contest workspace and place official data files in the agreed directory (e.g.,
problem_A/data/). - Describe the task in natural language, for example: “This is a Problem A from a certain year of CUMCM with three sub-questions. Please follow the general math modeling workflow: first read the problem and list parameters, then create
code/data/figuresdirectories for each question, implement the solver in Python, and output JSON and TXT.” - The Agent should proceed through Phases 1→5: first explore data and create a parameter table, then select models and pipelines, run constraint checks after implementation, and finally summarize statistics and compare across questions.
If the contest problem belongs to path optimization or fleet scheduling, the info structure, cost functions, and greedy insertion snippets in the Skill can serve as implementation references; for other problem types, the phase division and deliverable list still apply, but specific models need to be adjusted by the Agent based on the problem statement.
Use Cases & Notes¶
Who is it for
- Teams or individuals participating in competitions like the Huazhong Cup or CUMCM who need a stable directory structure and an iterative multi-sub-question solving process.
- Developers who want the Agent to take fewer leaps, read data before writing models, and output standard deliverables like JSON/charts/reports.
Limitations & Notes
- This Skill is a workflow and pattern specification; it does not come with executable Python packages. Implementation quality still depends on the problem statement, data, and constraints agreed upon in the dialogue.
- The documentation examples focus on combinatorial optimization, pathfinding, and cost decomposition. For non-此类赛题 (non-this-type problems), you need to replace the modeling choices in Phase 2 yourself, but the five-phase order remains useful.
- This is a community-sourced Skill. Check the version and description on the SkillHub page before use. Current scraped information shows a rating of 100,000, 1,825 downloads, and 5 installations (subject to SkillHub display, which changes over time).
requires_api_key=falseonly indicates that the Skill itself does not require a Key. Running the solver locally may still require a Python environment and dependencies like pandas and numpy, which you need to install in your project.
Conclusion¶
The “General Math Modeling Workflow” transforms competition modeling from “one-off code generation” into a checkable five-phase pipeline. It clearly defines directories, cost functions, and deliverable formats, making it suitable for long-term enablement in Cursor’s skills directory. For installation and details, see SkillHub: https://www.skillhub.cn/skills/user_3937f0b6/math-modeling-solver, API Entry: https://api.skillhub.cn/user_3937f0b6/math-modeling-solver.