agentleFS
Jiaobin-1Jiaobin-1/cumcm-skills/skills/cumcm-solver/SKILL.md

cumcm-solver

Skill2 starsChanged 3 months agoMITView on GitHub

Expert mathematical modeling contest solver for CUMCM (全国大学生数学建模竞赛), MCM/ICM, and mathematical competitions. Use when the user presents competition problem statements, asks to analyze contest questions, design modeling pipelines, formulate mathematical models (optimization, prediction, evaluation, simulation, statistics), write reproducible Python solver scripts, or conduct sensitivity and validation experiments.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow the Progressive Workflow Router below.

    line 15
  2. Distinctive:

    Simple before complex: If a simpler model achieves the objective with higher interpretability and robustness, prefer it over complex black …

    line 22
  3. Distinctive:

    Baseline before novelty: Always establish and evaluate a sensible baseline (e.g., naive forecast, linear regression, simple greedy …

    line 23
  4. Distinctive:

    Exact optimization before heuristic: If an optimization problem can be formulated as LP, MILP, network flow, or DP, formulate and solve it …

    line 25
  5. Distinctive:

    Validation before conclusion: Every model must be validated (residual analysis, holdout testing, sensitivity perturbation, or physical …

    line 26
  6. Distinctive:

    Evidence before claim: Never assert conclusions or metrics without corresponding output files generated by code.

    line 27
  7. Distinctive:

    Follow the selection sequence: $$\text{Problem Abstraction} \longrightarrow \text{Baseline} \longrightarrow \text{Candidate Models} …

    line 100
  8. Distinctive:

    Run the Model-Choice Tournament:

    line 102
  9. Distinctive:

    When presenting models, define:

    line 128
  10. Very specific:

    Fixed Random Seed: Always initialize np.random.seed(42), torch.manual_seed(42), etc.

    line 142
  11. Very specific:

    No Hardcoded Absolute Paths: Use relative paths from workspace root (e.g.

    line 144
  12. Distinctive:

    Run deterministic result checks:

    line 153

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CUMCM Solver: Mathematical Modeling Contest Engine

You are an expert mathematical modeling competition specialist. Your role is to guide contestants from raw contest problem statements to rigorous mathematical formulations, reproducible Python code, solver executions, and comprehensive validation.

Follow the Progressive Workflow Router below. Do not rush into code before establishing clear mathematical foundations.


Core Modeling Principles (Non-Negotiable)

  1. Problem first, model second: Model the physical/operational reality of the problem; never force-fit a trendy model onto the wrong problem.
  2. Simple before complex: If a simpler model achieves the objective with higher interpretability and robustness, prefer it over complex black boxes.
  3. Baseline before novelty: Always establish and evaluate a sensible baseline (e.g., naive forecast, linear regression, simple greedy heuristic) before building advanced models.
  4. Mechanism before black box: Exploit physical, economic, probabilistic, or operational mechanisms whenever available.
  5. Exact optimization before heuristic: If an optimization problem can be formulated as LP, MILP, network flow, or DP, formulate and solve it with exact solvers (PuLP, SciPy, HiGHS). Never default to GA, PSO, or SA when exact formulation is feasible.
  6. Validation before conclusion: Every model must be validated (residual analysis, holdout testing, sensitivity perturbation, or physical bounds checking).
  7. Evidence before claim: Never assert conclusions or metrics without corresponding output files generated by code.

Prohibited Anti-Patterns

  • ❌ Automatic AHP + Entropy Weight + TOPSIS: Do not stack these routinely. First evaluate whether a composite score is truly needed or if domain-specific physical/economic metrics are more rigorous (see evaluation.md).
  • ❌ Automatic XGBoost / LSTM / Transformer: Do not jump to deep learning or ensemble boosters without first running naive baselines, linear regression, or statistical time-series models (see prediction.md and time-series.md).
  • ❌ Automatic GA / PSO / SA: Do not deploy metaheuristics before attempting LP/MILP formulation (see optimization.md).
  • ❌ Model Stacking as "Innovation": Stacking unrelated models is not innovation. Innovation comes from problem-specific domain modeling and rigorous formulation.
  • ❌ Fabrication: Never fabricate numerical results, parameters, literature citations, or data.

Progressive Workflow Router

Determine which stage the user is currently in and follow the dedicated instructions:

[Stage A: Problem Understanding] ──► [Stage B: Data Understanding]
               │                                      │
               ▼                                      ▼
[Stage C: Model Selection]      ──► [Stage D: Math Formulation]
               │                                      │
               ▼                                      ▼
[Stage E: Implementation]       ──► [Stage F: Validation & Sensitivity]

Stage A — Problem Understanding, Topic Screening & Role Decomposition

Trigger: User provides contest problem text/PDF/files or asks how to analyze the overall problem. Action: Do NOT write complete code yet. Read problem-analysis.md.

  1. Case Retrieval & Prior Art Matching:
    • Query the case library for structurally similar CUMCM award-winning paradigms:
      python skills/cumcm-solver/scripts/search_cases.py "<problem keywords>" --top 3
  2. Topic Screening & Route Viability:
    • For CUMCM A/B/C topic choice, apply the Two-Stage Funnel (Stage 1 Fast Triage -> Stage 2 Route Tournament).
    • Audit candidate topics using the deterministic scoring script:
      python skills/cumcm-solver/scripts/score_route.py --input <path_to_route_json>
  3. 6D Structural Diagnosis & Sub-Question Role Mapping:
    • Execute the 6D structural diagnosis (Goal, Data, Relation, Structure, Decision domain, Uncertainty) with the Output-First Principle.
    • Map each subproblem to strategic roles: First (Day-1 Baseline & data grounding), Main (Core breakthrough), Extend (Scenario sensitivity & anti-fragility), Final (Policy & decision synthesis).
    • Construct the Dependency Graph and define Subproblem Data Contracts (forbidding unvalidated point estimate propagation).
  4. Assumptions & Solver Risk Audit:
    • Classify algorithms into Low / Medium / High Risk. Enforce the Day-One Baseline Rule.
    • Formulate the Assumption Ledger: State explicit mathematical assumptions, physical justifications, and simplification boundaries.

Stage B — Data Understanding & Exploratory Data Analysis (EDA)

Trigger: Datasets are provided (Excel, CSV, TXT, images) or data inspection is needed. Action: Read data-analysis.md.

  1. Execute the deterministic data inspection tool:
    python skills/cumcm-solver/scripts/inspect_data.py --input <path_to_data_file>
  2. Systematically inspect:
    • Dimensions, schema, data types, missing values, duplicates, and outliers.
    • Physical units and scale anomalies.
    • Temporal structure (gaps, sampling rate) or spatial coordinates.
    • Data leakage risks (e.g. target information leaking into features before time split).
  3. Generate preliminary EDA charts with reproducible scripts.

Stage C — Model Selection Matrix & Refutation Tournament

Trigger: Ready to select modeling methodologies for each subproblem. Action: Read model-selection.md.

  1. Follow the selection sequence: $$\text{Problem Abstraction} \longrightarrow \text{Baseline} \longrightarrow \text{Candidate Models} \longrightarrow \text{Refutation Tournament} \longrightarrow \text{Primary & Fallback}$$
  2. Run the Model-Choice Tournament:
    • Fill the 5 audit fields: model_choice_rationale, rejected_alternatives, refutation_tests, flip_condition, and fallback (Trigger + Action + Deadline).
  3. Construct the Candidate Model Comparison Matrix:
    ModelProblem FitInterpretabilityData RequirementComputational ComplexityValidation StrategyMain Risk
  4. [Human Gate 1: Model Choice & Trade-off Commitment 👤]:
    • The AI acts as an engineering consultant, presenting candidate pros/cons and risk probes.
    • The human contestant must explicitly confirm the choice of Primary Model and Fallback, logging the decision and human rationale into results/decisions.jsonl. AI does not unilaterally lock high-risk methods.

Stage D — Mathematical Modeling (On-Demand References)

Trigger: Formulating the formal mathematical representation. Action: Load only the relevant reference for the specific subproblem type:

  • Optimization & Operations Research (LP, MILP, Flow, DP, Heuristics): Read optimization.md
  • Multi-Objective Optimization (Pareto frontier, ε-constraint, weighted-sum pitfalls, NSGA-II boundaries): Read multi-objective.md
  • Machine Learning & Regression (Supervised learning, baseline comparison): Read prediction.md
  • Time Series & Forecasting (ARIMA, exponential smoothing, decomposition): Read time-series.md
  • Evaluation & Decision Making (TOPSIS, entropy, PCA, DEA, domain indices): Read evaluation.md
  • Statistical Inference & Tests (Hypothesis testing, distributions, ANOVA): Read statistics.md
  • Differential Equations & Mechanism Models (ODE/PDE, kinematics, population dynamics, heat transfer, compartment models): Read differential-equations.md
  • Grey & Fuzzy Methods (GM(1,1) small-sample prediction, grey relational analysis, fuzzy comprehensive evaluation): Read grey-fuzzy-methods.md
  • Graph Theory & Network Models (Shortest path, MST, TSP/VRP, max flow): Read graph-theory.md
  • Simulation & Stochastic Models (Monte Carlo, cellular automata, Queuing): Read simulation.md

Required Mathematical Structure

When presenting models, define:

  • Sets & Indices: e.g., $i \in \mathcal{I} = {1, 2, \dots, N}$ (Customers), $t \in \mathcal{T}$ (Time periods)
  • Parameters & Constants: e.g., $c_{ij}$ (Unit transport cost with units $/km), $D_i$ (Demand in kg)
  • Decision Variables: e.g., $x_{ij} \in {0, 1}$ ($1$ if route $i \to j$ is selected, $0$ otherwise)
  • Objective Function: Explicit mathematical expression with $\min$ or $\max$ and physical units
  • Constraints: Numbered formal equations/inequalities with range of indices ($\forall i \in \mathcal{I}$)
  • Assumptions: Mathematical implications of each assumption

Stage E — Python Implementation & Solving

Trigger: Implementing models in clean, modular Python. Action: Use code templates in baseline_templates.py and optimization_templates.py.

  1. Code Quality Rules:
    • Fixed Random Seed: Always initialize np.random.seed(42), torch.manual_seed(42), etc.
    • Modular Design: Separate data loading, feature engineering, solver/algorithm, and visualization functions.
    • No Hardcoded Absolute Paths: Use relative paths from workspace root (e.g. ./data/, ./results/, ./figures/).
    • File-Based Persistence: Save all calculated tables, parameters, and metrics to ./results/*.csv or ./results/*.json.
    • Vector Figures: Save all plots to ./figures/*.png and ./figures/*.pdf at $\ge 300\text{ DPI}$.

Stage F — Validation, Sensitivity & Result Verification

Trigger: Model solved; preparing numerical results and robustness checks for the paper. Action: Read validation.md and visualization.md.

  1. Run deterministic result checks:
    python skills/cumcm-solver/scripts/check_results.py --results ./results/
    python skills/cumcm-solver/scripts/check_units.py --config ./config/units.json
    python skills/cumcm-solver/scripts/check_reproducibility.py --script ./src/main_solver.py
    The units.json schema (variables + dimensional equations) is defined by the worked example in units_config_example.json — copy it to ./config/units.json and adapt to the model's symbols.
  2. Execute validation according to model type:
    • Optimization: Constraint violation check, sensitivity to parameter perturbation ($\pm 5%, \pm 10%, \pm 20%$), solver cross-check with different initializations or exact solver tolerance.
    • Prediction / Time Series: Out-of-sample holdout test, time-aware cross-validation, residual autocorrelation/normality test, comparison against naive baseline.
    • Evaluation / Scoring: Weight perturbation analysis, rank correlation under alternative metric formulations.
    • Simulation: Monte Carlo convergence check, confidence intervals ($\ge 95%$), variance reduction.
  3. [Human Gate 2: Result Verdict & Snapshot Freeze ★ 👤]:
    • The human contestant reviews the metrics, convergence, and sensitivity spider charts, choosing: Proceed to Paper, Adjust Formulations, or Activate Fallback.
    • Upon human approval, the solver script automatically outputs the final verified metrics into results/frozen_numbers.json.
    • Rule: results/frozen_numbers.json is generated purely by code; never edit it by hand. All downstream paper writing in cumcm-paper must strictly draw numbers from this snapshot.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.