math-modeling

math-modeling is a skill for Claude Code, Codex from MrSGSA/math-modeling-skill-dify. It costs 101 tokens per session (4,457 once invoked), scanned A, original, MIT.

A Chinese-language workflow for mathematical modelling, such as using mathematics and code to analyse a real problem or enter a modelling competition.

In plain words
What is it for?
Use it to choose models, write and run solving code, review results, create visualisations, prepare papers, check competition rules, and revisit completed cases.
Why use it?
It separates model design, programming, independent checking, and paper writing so errors and unsupported conclusions can be found before publication.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mrsgsa/math-modeling-skill-dify/math-modeling
Any agent
npx skills add MrSGSA/math-modeling-skill-dify --skill math-modeling
Clone the repo
git clone --depth 1 https://github.com/MrSGSA/math-modeling-skill-dify

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for math-modeling

README.md
[![agentmods](https://agentmods.dev/badge/skills/mrsgsa/math-modeling-skill-dify/math-modeling.svg)](https://agentmods.dev/skills/mrsgsa/math-modeling-skill-dify/math-modeling)
Your own site
<a href="https://agentmods.dev/skills/mrsgsa/math-modeling-skill-dify/math-modeling"><img src="https://agentmods.dev/badge/skills/mrsgsa/math-modeling-skill-dify/math-modeling.svg" alt="Measured on agentmods" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,457 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00101 $0.04457
Opus 5 $0.00051 $0.02228
Sonnet 5 $0.00020 $0.00891
Haiku 4.5 $0.00010 $0.00446

Measured 4d ago against content hash b9f02a5d457f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

math-modeling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 16 executable files (references/roles/model-programmer/scripts/check_env.py, references/roles/model-programmer/scripts/repro_manifest.py, references/roles/model-reviewer/scripts/red_team_gate.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/math-modeling/SKILL.md · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

数学建模

本 Skill 用四个职责隔离的阶段完成数学建模,其中评审阶段在真实计算完成后、论文定稿前执行红队门禁。阶段可以由同一代理顺序执行,也可以由不同代理执行;无论执行者是谁,评审都必须重新建立主张—证据关系,不能沿用上游的确定性措辞。生成的论文仅供用户参考。论文结构与格式必须以目标竞赛当届官方规则和官方模板为准,不能用往届经验替代官方要求。

根目录契约

  • SKILL_ROOT:本文件所在目录,只读。角色说明、算法资料、脚本和模板都从这里读取。
  • PROJECT_ROOT:用户题目和项目所在目录,所有新产物只能写入这里。
  • 两个根目录必须不同;默认禁止覆盖 SKILL_ROOT 内任何文件。
  • 输入附件只读。确需修改模板时,先复制到 PROJECT_ROOT 再处理。
  • 不自动添加、删除或推断 AI 使用披露,也不把模型或厂商名写入默认作者、批注者、修订者或文档元数据。是否披露及披露内容由用户依据目标竞赛当届官方规则决定;规则强制要求时必须遵守,并把人工决定和规则依据留在项目发布记录中。

用户追加硬限制

  • 完整建模、论文生成或论文修改开始前,必须完整读取 references/用户追加硬限制.md,筛选适用于当前任务的有效条目。
  • 把适用条目逐项写入项目发布清单:官方规则进入 official_rules.hard_constraints,用户质量硬限制进入 quality_target 并设置 blocking=true。只在对话中记住、不进入门禁,不算落实。
  • 后续用户新增、修改或撤销限制时,更新同一文件中的独立条目,保留范围、优先级、验证方式、依据和状态;不得用新要求悄悄覆盖旧要求。
  • 官方规则与用户限制冲突时执行更严格且合法的一项,并在交付说明中指出冲突;不得以篇幅目标为由突破官方上限或采用灌水排版。

路由

用户意图 加载入口 是否要求前一阶段已完成
完整建模、完成整题 references/roles/model-designer/SKILL.mdreferences/roles/model-programmer/SKILL.mdreferences/roles/model-reviewer/SKILL.mdreferences/roles/paper-writer/SKILL.md 按顺序执行
只做题目分析、选模型 references/roles/model-designer/SKILL.md
只写代码、跑结果、出图 references/roles/model-programmer/SKILL.md 需要题目和可执行的模型说明;缺失时先补齐必要分析
只做复核、审稿或检查现有方案 references/roles/model-reviewer/SKILL.md 需要题目、模型、代码或结果证据;缺失项标为待验证
只写或修改论文 references/roles/model-reviewer/SKILL.mdreferences/roles/paper-writer/SKILL.md 需要题目、模型、真实运行结果和图表;重大审计失败时回退

不要在单阶段任务中强制执行完整流程。

私有知识库检索

  • 需要选模型、查算法、核验竞赛规则、参考优秀案例、补充领域知识、查实现细节或寻找相关图表时,优先调用 search_math_modeling_knowledge,再结合题目附件和当前任务作独立判断。默认用 knowledge_scope="core" 只检索算法、编程、规则、领域和写作主体文本库。
  • 查询应明确、独立且不超过 250 字。核心层和经验层先只查文字,不自动检索多模态库。当确实需要原图、图表结构或版面证据时,再用 knowledge_scope="multimodal"include_images=true 定向查图;先用默认 max_images=4,不足时最多增至 8。
  • 完整建模先按子问题、模型、算法、验证和实现分层检索核心文本层,再用 knowledge_scope="experience" 单独检索优秀案例、错题本和实践复盘文本层。经验层查询要明确写出“这是新的当前题,只返回可迁移思路、风险提示和验证方法,不把旧题答案作为当前答案”。只有用户要求全部文本库审计或跨库总览时才使用 knowledge_scope="all";该范围也不包含多模态库。
  • 经验库的使用原则是“借鉴但不接管”:既不机械沿用旧方案,也不因旧题不同而完全忽略。对每个命中建立“历史经验—当前题相同点—当前题差异—拟作调整—采用与否—独立验证”记录;只有适用条件匹配且能在当前题重新推导、独立实现、真实验证的部分才进入方案。
  • 练习任务开始时,用 knowledge_scope="experience" 按“新题题型+当前阶段+风险”检索 数学建模-错题本。后续阶段优先复用已记录的命中;只有出现新风险、新模型、新数据特征、审计失败或原命中覆盖不足时才增量检索。命中只作为防错提示,不能把旧错误场景误认为当前题已经发生,也不能机械套用旧修正。
  • 需要借鉴完整建模过程时,用 knowledge_scope="experience" 检索 数学建模-实践复盘库,优先召回“候选模型—取舍理由—实现架构—验证链—适用边界”。命中描述的是历史题的决策记录,不是模型正在处理的当前题;实际比赛可前置用于启发,同题独立练习仍在主方案锁定后再作对照。
  • 多模态库同时包含核心资料与经验资料的视觉内容,不能用于替代文本分层。先从 coreexperience 命中中确定来源文档、图号、图表主题或所需视觉证据,再以这些限定词调用 knowledge_scope="multimodal"。必须实际查看返回的图片内容块,不能只根据文件名、图片说明或相对路径推断图片含义。
  • 在回答和交付物中保留知识库名与来源文档名。过滤低相关命中;私有案例不能替代题目原文、当届官方规则、原始数据或可追溯文献。
  • math_modeling_knowledge_status 只用于首次接入检查、故障诊断或用户明确要求查看状态,不要在每个普通任务中重复调用。
  • MCP 不可用或检索失败时,继续使用题目附件与本 Skill 的本地资料完成可完成部分,并明确说明降级;禁止伪造知识库结果或图片。
  • 仅做用户已提供文件的机械转换、排版或代码修改,且不需要领域知识时,不必强制检索。

Read the full file on GitHub · 151 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 151 lines · 101 tokens per session scan A b9f02a5d457f

Subscribe to this mod's changes

math-modeling is a skill published in the GitHub repository MrSGSA/math-modeling-skill-dify (4 stars, last pushed 1mo ago), licensed MIT. It adds 101 tokens to every session and 4,457 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

math-modeling-solver

数学建模竞赛解题全流程指导。覆盖国赛(CUMCM)和美赛(MCM/ICM)全部题型(A-F),提供12种问题本质分析、95+场景模型决策矩阵、5本算法Cookbook、11本完整例题Playbook、22个Python+7个MATLAB可运行代码模板。与math-modeling-paper形成"解题→写作"配对。当用户提及建模思路、选什么模型、怎么建模、赛题求解、粘贴赛题文本、美赛/国赛题目分析、CVaR/NSGA-II/Monte Carlo/时间序列/ANOVA/灰色关联、网络流/图论/生态建模、模型命名/Memo/Letter/Our Work流程图时,使用此skill。.

Lupynow/math-modeling-skills · 186 tokens

math-modeling-paper

数学建模竞赛论文写作全流程指导。覆盖国赛(CUMCM)和美赛(MCM/ICM),从论文结构规划、各章节撰写、模型检验、参考文献规范到最终格式检查。与math-modeling-solver形成"解题→写作"配对——可接收solver输出的论文草稿片段直接展开写作。当用户提及数学建模论文写作、建模比赛、国赛/美赛/电工杯/亚太杯/深圳杯/华为杯论文、CUMCM、MCM/ICM、数模论文结构、摘要写作、模型检验、灵敏度分析、latex建模模板、word建模排版、Memo/Letter写作、模型命名、Our Work流程图,或需要写/修改/优化/检查建模论文的任何部分时,都必须使用此 skill。.

Lupynow/math-modeling-skills · 202 tokens

ez-math-model

Use when solving CUMCM, MCM, ICM, or other mathematical modeling tasks that need contest problem intake, model selection, Python solving, figures, paper writing, quality audit, and packaged deliverables.

woodfishhhh/EZ_math_model · 48 tokens

brainstorming

Use when EZmathmodel model selection is unclear after the modeling decision tree, the problem spans multiple domains, or modeler needs several candidate approaches before writing modelingplan.md.

woodfishhhh/EZ_math_model · 38 tokens

scientific-slides

Use when the user explicitly asks EZmathmodel to create defense slides, academic presentation slides, Beamer slides, or PPT after the modeling paper has been packaged.

woodfishhhh/EZ_math_model · 37 tokens

interpret-modeling-problems

根据原始赛题和附件,生成可回查证据的国赛及类似数学建模赛题解读,建立小问输入输出、约束与歧义、附件审计、模型蓝图、验证方案和论文交付接口。适用于选题比较、正式建模前的完整解读和已有解读复核;不用于在缺少原题时臆测题意,也不把候选模型伪装成已经验证的数值求解。.

zhoufz021/interpret-modeling-problems · 114 tokens