doc2math
它能做什么
这个工具可以把用自然语言描述的问题转换成结构化的数学格式。它会识别变量、规则(约束条件)以及需要优化的目标(目标函数),并标注其在原文中的确切出处。
适用场景
- ✓当你有一个用文字描述的问题,并希望把它转换成数学形式时。
- ✓用于从技术文档或论文中提取数学结构。
- ✓用于检查问题描述中缺少哪些数学信息。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/doc2math/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“把这段关于库存优化的文字,转换成数学上的变量、约束条件和目标。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会读取你提供的文字,识别其中的变量、约束条件和目标等数学要素。它会确保每个识别出的部分都能在原文中找到确切出处,并且不会编造信息。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
DOC2MATH — Document-to-Mathematics Problem Specification
When to Use This Skill
- "Formalize this problem statement into math"
- "Extract the mathematical structure from this research paper section"
- "What variables, constraints, and objectives are in this spec?"
- "Convert this word problem to a structured MPS"
- "Find what's missing in this problem formulation"
Zero-Inference Protocol (Mandatory)
- Closed World — do not assert unstated facts or numeric values. Structural notation implied by source phrasing may be proposed only with the explicit inference tag required below
- Grounding Rule — every element must cite the exact source phrase (
"evidence"field) - No Silent Filling — unknown values use
null; ambiguous types use"ambiguous" - Inference Tagging — structural inferences tagged
"inferred": truewith"inference_basis" - MISSING Markers — elements mentioned but insufficiently defined get
"status": "MISSING"with"missing_reason" - No Hallucinated Math — never introduce equations or values not in the source text
Limitations
- Does not invent missing equations, domains, values, or assumptions that are absent from the source document.
- Requires enough source text to cite every extracted element; sparse prompts should be returned with explicit missing-information markers.
- Produces a formal specification, not a solved optimization model or proof.
How It Works
Step 1 — Receive Document
Accept the document text, research excerpt, problem description, or specification as input.
Step 2 — Classify
Identify problem_class: optimization | classification | simulation | proof | estimation | other
Step 3 — Extract MPS Components
Variables — id, name, symbol, type, domain, units, role, evidence, inferred, status
Operators — id, name, symbol, arity, acts_on, produces, evidence, inferred
Constraints — id, type, expression, variables_involved, evidence, hardness, inferred, status
Objectives — id, direction (minimize/maximize/satisfy/find/prove), expression, variables_involved, evidence, inferred
Uncertainty — id, type (stochastic/epistemic/measurement/model/none_stated), affects, characterization, evidence, status
Step 4 — Surface Missing Information
Identify what the document implies but doesn't state: missing_information[] with element, needed_for, missing_reason.
Step 5 — Validate and Score
validation_flags:
has_complete_objectives: true/false/partialhas_bounded_variables: true/false/partialhas_evidence_for_all_elements: true/false/partialinference_count: integermissing_count: integeroverall_formalizability: HIGH/MEDIUM/LOW
Output Format
Produce an MPS JSON object. The empty schema example below is not a complete formalization; populate only grounded entries and report missing information:
{
"mps_version": "1.0",
"source_title": "...",
"problem_class": "optimization",
"variables": [],
"operators": [],
"constraints": [],
"objectives": [],
"uncertainty": [],
"missing_information": [],
"validation_flags": {
"overall_formalizability": "LOW"
}
}
Best Practices
- ✅ Apply all 6 Zero-Inference Protocol rules before outputting any element
- ✅ Surface MISSING markers rather than silently inferring — incomplete formalization is valid output
- ✅ Cite the exact source phrase in every
evidencefield - ❌ Never introduce mathematical relationships not grounded in the source text
Additional Resources
- External hosted BYOK tools are optional and not bundled; using them may transmit documents/keys and incur costs. Obtain the applicable data/account approval instead of following the link automatically.
- Repository: thebrierfox/doc2math-skill
- Full BYOK tool: ace-license-server-production.up.railway.app/byok/doc2math
- Built by IntuiTek¹ (~K¹) — MIT License
常见问题
什么是“Mathematical Problem Specification”?
这是一种标准化格式,用清晰的数学术语描述问题,比如变量、它们的规则,以及你想达成的目标(最小化或最大化)。
“grounded”是什么意思?
意思是提取出的所有数学信息,都能在你提供的原文中找到直接依据。
这个工具会替我解出数学问题吗?
不会。它只会把问题整理成数学格式,不会计算答案,也不会编造原文中没有的方程。
详情
作者的原始描述
Convert narrative technical documents into grounded Mathematical Problem Specifications with variables, constraints, objectives, and uncertainty.
热度
- GitHub 星标
- 48k
- 排名
- #4473
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。