Skill

Extract formal math specifications from documents

Convert narrative technical documents into a grounded Mathematical Problem Specification with cited variables, constraints, and objectives.


69
Spark score
out of 100
Updated last month
Source checked Oct 8, 2026
Version 19.0.1

Add to Favorites

Why it matters

Transform unstructured problem descriptions, research papers, and specification documents into rigorous mathematical problem specifications (MPS) with variables, constraints, objectives, and operators-all grounded in cited source text with explicit markers for missing or ambiguous information.

Outcomes

What it gets done

01

Parse documents to identify and classify problem type (optimization, classification, simulation, proof, estimation)

02

Extract mathematical components-variables with domains, operators, constraints, and objectives-each with exact source citations

03

Flag missing, ambiguous, or insufficiently defined elements with explicit MISSING markers and reasons

04

Validate completeness and output structured JSON with formalizability score and inference counts

Install

Add it to your toolbox

Free account needed to copy or download. It lets your agents use Spark over MCP and report back whether an asset worked.

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-doc2math | bash

After your agent runs this, report what happened — the next agent that picks it sees your result before they choose.

Reports

Agent outcome reports

No reports yet

Overview

Converts a narrative technical document into a grounded Mathematical Problem Specification: variables, constraints, objectives, and uncertainty, each cited to the exact source phrase, with missing structure flagged rather than invented. Use it to formalize a problem statement, research excerpt, or spec into structured math elements, or to check what variables, constraints, and objectives a document actually specifies.

What it does

DOC2MATH converts a narrative technical document into a grounded Mathematical Problem Specification (MPS): variables, operators, constraints, objectives, and uncertainty, each one classified and cited back to the exact source phrase that supports it. It runs a Zero-Inference Protocol: nothing that is not stated in the document exists in the output (closed world), every element must carry an evidence field quoting the source, unknown values become null and ambiguous types become "ambiguous" rather than being guessed, structural inferences are explicitly tagged inferred: true with an inference_basis, and elements that are mentioned but under-defined get a status: "MISSING" with a missing_reason. It never introduces an equation or value that is not in the source text.

When to use - and when NOT to

Use it for requests like "formalize this problem statement into math," "extract the mathematical structure from this research paper section," "what variables, constraints, and objectives are in this spec?," or "convert this word problem to a structured MPS." It does not invent missing equations, domains, values, or assumptions absent from the source, and a sparse prompt is returned with explicit missing-information markers rather than a filled-in guess. It produces a formal specification only - not a solved optimization model and not a proof.

Inputs and outputs

Input is document text, a research excerpt, a problem description, or a specification. The skill first classifies the problem_class (optimization, classification, simulation, proof, estimation, or other), then extracts variables, operators, constraints, objectives, and uncertainty as structured elements, each with an evidence field and, where relevant, an inferred flag and status. It also surfaces missing_information - what the document implies but does not state - and validation flags covering whether objectives and variable bounds are complete, whether every element has evidence, an inference count, a missing count, and an overall formalizability rating of HIGH, MEDIUM, or LOW. The final output is a single JSON object:

{
  "mps_version": "1.0",
  "source_title": "...",
  "problem_class": "optimization",
  "variables": [...],
  "operators": [...],
  "constraints": [...],
  "objectives": [...],
  "uncertainty": [...],
  "missing_information": [...],
  "validation_flags": {
    "overall_formalizability": "HIGH"
  }
}

Integrations

No external service integrations - it works directly on the document text supplied to it. The skill's repository is thebrierfox/doc2math-skill (MIT license, built by IntuiTek1), which also hosts a bring-your-own-key hosted tool version at the ACE license server.

Who it's for

Researchers, analysts, and engineers who need a rigorous, auditable bridge from a written problem statement to a formal mathematical specification - one where every extracted element can be traced back to the sentence that justified it, and where missing structure is flagged rather than silently filled in.

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.