model-formulator

model-formulator is a skill for Claude Code, Codex from Morningstar202604/awesome-skillkit. It costs 180 tokens per session (2,988 once invoked), scanned A, original, Apache-2.0.

A tool that converts a written problem into a structured mathematical model. It identifies variables, constraints, goals, and a model type such as optimization, differential, statistical, stochastic, or Bayesian.

In plain words
What is it for?
Use it to define decision or state variables, objectives, and constraints from a natural-language description, then produce a model specification for a solver.
Why use it?
It gives a vague problem a form that a numerical solver can consume, reducing the chance of skipping an important variable or rule. It does not calculate the final solution.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to define decision or state variables, objectives, and constraints from a natural-language description, then produce a model specification for a solver.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/morningstar202604/awesome-skillkit/model-formulator
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.

Any agent
npx skills add Morningstar202604/awesome-skillkit --skill model-formulator
Clone the repo
git clone --depth 1 https://github.com/Morningstar202604/awesome-skillkit

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 model-formulator

README.md
[![agentmods](https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/model-formulator/github.svg)](https://agentmods.dev/skills/morningstar202604/awesome-skillkit/model-formulator)
Your own site
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/model-formulator"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/model-formulator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for model-formulator

Your own site · 80×15
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/model-formulator"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/model-formulator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 180 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,988 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00180 $0.02988
Opus 5.5 $0.00072 $0.01195
Sonnet 5.5 $0.00036 $0.00598
Haiku 4.5 $0.00018 $0.00299

Measured 2mo ago against content hash 63c0303d082f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

model-formulator 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 2mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/model_formulator.py, scripts/test_smoke_model_formulator.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.

expert-teams/teams/academic-paper-team/skills/model-formulator/SKILL.md · 194 lines

How it starts

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

Model Formulator(文字问题 → 数学模型规格)

把文字问题转成结构化数学模型规格(变量 / 约束 / 目标函数 / 模型类型),作为 model-solver 的输入。

本 skill 供「研究设计师」(academic-research-designer)使用。建模最容易翻车的不是算不出来,而是一开始就把问题抽象错了:变量定义含糊、假设写不出来、目标函数和研究问题对不上。本 skill 负责把一句大白话逼成一份可求解、可审的数学表述。

这是什么

建模五步走:

  1. 抽实体:把自然语言里的对象、因素、关系挑出来。
  2. 定变量:决策变量、外生参数、状态变量、输出变量各归其位,量纲写清。
  3. 写假设:哪些是为了可解而人为简化的,必须显式列出并讨论放宽后果。
  4. 立目标与约束:优化问题写 min/max + 约束;统计问题写待估参数 + 似然/结构;预测问题写输入输出映射。
  5. 边界与退化:极端参数下模型会怎样,哪种情况模型直接失效。

何时使用

  • 用户说"我想建个模型研究 X"但只给了现象描述。
  • 选题确定后、动手写代码前的设计阶段。
  • 论文 Method 部分需要把研究问题严格形式化。
  • 团队 W1 的 Phase 2 研究设计环节。
  • 问题已用文字描述但缺乏数学结构,需要先定变量与目标再求解时。
  • 不用于数值求解(已有形式化模型 → model-solver)与结果作图(→ result-visualizer)。

输入清单

输入 必需 说明
problem 是 自然语言问题描述,含实体、数量、关系
domain 否 optimization / differential / statistical / stochastic / bayesian
knowns 否 已知量 JSON,如 {"routes": 50, "trucks": 5}
unknowns 否 待求变量名列表,如 route_assignment truck_schedule

缺失时一次性问齐:「请提供:① problem(文字描述)。domain / knowns / unknowns 我会按缺省或自动推断。」

前置自检

# 1. Python 可用
python3 --version
# 2. 脚本存在
test -f scripts/model_formulator.py && echo "OK script present"
  • 预期:python3 --version 输出版本号;脚本存在打印 OK script present。
  • 若失败:未装 Python → 安装 Python 3.10+ 后重试;脚本缺失 → STOP,回报脚本未随技能分发。

工作流

步骤 1:解析并分类问题

  • 动作:从 problem 抽取实体、数量、关系,判定 domain(确定性 vs 随机、连续 vs 离散)。
  • 预期:得到 domain 与一个初步模型类型候选(见决策树)。
  • 若失败:描述过于模糊 → 回到输入清单要求补充 problem 细节,不要臆测。

步骤 2:定义变量与约束

  • 动作:列出决策变量、状态变量、目标函数与全部物理/逻辑约束。
  • 预期:每个变量有明确类型(如 binary / continuous)与含义。
  • 若失败:约束冲突 → 标注为假设或退回步骤 1 重新分类。

步骤 3:选择模型类型并生成规格

  • 动作:运行脚本生成结构化规格。
python3 scripts/model_formulator.py \
  --problem "Minimize delivery cost for 50 routes, 5 trucks, time windows 8-18h" \
  --domain optimization \
  --knowns '{"routes": 50, "deliveries": 200, "trucks": 5}' \
  --unknowns route_assignment truck_schedule total_cost \
  --output model_spec.json
  • 预期:标准输出一段 JSON,含 model_type、variables、objective、constraints、assumptions、solver_hint。若给 --output 则同时写入该文件。
  • 若失败:argparse 报错(如 domain 不在 choices)→ 用 --help 核对取值;网络/文件错误 → 修正路径后重试。

Read the full file on GitHub · 194 lines

Files

What ships with it

4 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. 2mo ago Changed · +55 lines · +54 tokens per session 63c0303d082f
  2. 2mo ago Changed · -165 tokens per session 711bd8b6e1e7
  3. 2mo ago First seen · 139 lines · 291 tokens per session scan A 1ad9b8ca4a27

Subscribe to this mod's changes

model-formulator is a skill published in the GitHub repository Morningstar202604/awesome-skillkit (0 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 180 tokens to every session and 2,988 once invoked, about $0.0007 per session on Opus 5.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-09-19.

Related

model-formulator compared with skills from other repositories

model-formulator next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
model-formulatorMorningstar202604/awesome-skillkitSkill02mo agoApache-2.0A180Claude Code, Codex
drug-discoveryNousResearch/hermes-agentSkill267ktodayMITA19Claude Code, Codex
sglang-diffusion-cache-ditsgl-project/sglangSkill39ktodayApache-2.0A161Claude Code
detecting-pv-signalsmaziyarpanahi/openmedSkill5.9kyesterdayApache-2.0A218Claude Code
coding-icd10maziyarpanahi/openmedSkill5.9kyesterdayApache-2.0A209Claude Code
deidentifying-clinical-textmaziyarpanahi/openmedSkill5.9kyesterdayApache-2.0A144Claude Code
extracting-sdohmaziyarpanahi/openmedSkill5.9kyesterdayApache-2.0A163Claude Code