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.
npx agentmods add skills/verymath/ai4math-optimization/osqp-solvernpx skills add VeryMath/AI4Math-Optimization --skill osqp-solvergit clone --depth 1 https://github.com/VeryMath/AI4Math-OptimizationWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00131 | $0.02071 |
| Opus 5 | $0.00066 | $0.01035 |
| Sonnet 5 | $0.00026 | $0.00414 |
| Haiku 4.5 | $0.00013 | $0.00207 |
Grade A, and why
osqp-solver 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 2d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 245 lines — stays where its author put it; the contents beside it link to each section on GitHub.
OSQP Solver
Scope
Work only with the continuous convex QP
[ \begin{array}{ll} \operatorname{minimize} & \frac12 x^\top P x + q^\top x \ \operatorname{subject\ to} & l \leq A x \leq u, \end{array} \qquad P=P^\top\succeq 0. ]
Treat OSQP as a numerical solver, not as a modeling oracle. Derive the model, check dimensions and convexity, solve, and then independently verify what the returned status means.
Route elsewhere when the task contains integer variables, a genuinely indefinite (P), nonlinear constraints, or cones that cannot be represented by linear bounds. Do not claim that failure to detect nonconvexity proves convexity.
Workflow
1. Freeze the interpreted model
Write a short modeling checkpoint before executable code:
source:
variables and units:
objective before conversion:
constraints before conversion:
canonical P, q, A, l, u:
dimensions and expected sparsity:
why P is positive semidefinite:
requested accuracy and runtime budget:
ambiguities:
Confirm any interpretation that changes the mathematics. Keep the factor (\tfrac12) visible: if the original quadratic is (x^\top Qx), then OSQP usually needs (P=2Q).
2. Inspect the environment
Run the non-mutating probe:
python3 scripts/check_osqp_environment.py --json
Require osqp, numpy, and scipy. If they are missing, report:
python3 -m pip install 'osqp>=1,<2'
Obtain approval before changing an existing environment. Do not infer solver
availability from a package listing alone; import it with the probe. Require
ready: true: an importable but unsupported OSQP major version is not ready
for this runner.
3. Construct solver data deliberately
- Store
PandAasscipy.sparse.csc_matrix. - Reject materially asymmetric input. For differences within the declared
symmetry tolerance, construct one canonical symmetric
Pand use that same matrix for the PSD, objective, stationarity, setup, and update checks. Pass its upper triangle to OSQP because the solver uses upper-triangular storage. - Encode one row of (l\leq Ax\leq u) per equality, interval, lower bound, or
upper bound. Use
numpy.inffor open sides. - Check
P.shape == (n, n),q.shape == (n,),A.shape == (m, n), andl.shape == u.shape == (m,). - Check
l <= u, finiteP,q, andA, and the scale of every row and column. Avoid accidental dense construction for large problems.
What ships with it
12 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.
- agents/openai.yaml 251 B
- README.md 4.2 KB
- README.zh-CN.md 4.0 KB
- references/citation.md 805 B
- references/dual-infeasible-example.json 184 B
- references/feasible-example.json 323 B
- references/primal-infeasible-example.json 242 B
- references/python-api.md 3.5 KB
- references/verification.md 3.3 KB
- requirements-test.txt 11 B
- scripts/check_osqp_environment.py 3.7 KB runs code
- scripts/solve_qp.py 32 KB runs code
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.
- 2d ago First seen · 245 lines · 131 tokens per session scan A c3290c2ca248
osqp-solver is a skill published in the GitHub repository VeryMath/AI4Math-Optimization (5 stars, last pushed 1mo ago), licensed MIT. It adds 131 tokens to every session and 2,071 once invoked, about $0.0007 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.
Other skills, from other repositories
math-beamer
Use when creating, revising, or auditing source-grounded mathematical Beamer slide decks from papers, notes, proofs, lectures, experiments, or existing LaTeX slides across pure mathematics, applied mathematics, computational mathematics, statistics, optimization, geometry, topology, algebra, number theory…
paper-writing
Use when drafting, revising, or auditing source-grounded mathematical paper text, including abstracts, introductions, related work, theorem exposition, experiment narratives, revision plans, and response letters.
latex-build-and-layout-audit
Use when checking LaTeX paper projects for compilation, latexmk logs, undefined references, citation issues, duplicate labels, macro/package hygiene, layout warnings, floats, arXiv, or venue compatibility.
paper-skeleton-and-logical-architecture
Use when turning mathematical notes, theorem statements, proof sketches, experiments, or reading outputs into a paper skeleton, section plan, result dependency map, or contribution architecture before prose drafting.
proof-obligation-and-assumption-audit
Use when checking mathematical paper results for assumptions, quantifiers, domains, dependency fit, edge cases, external theorem use, proof coverage, or theorem-to-claim consistency.
claim-evidence-ledger
Use when auditing mathematical paper drafts for supported claims, missing citations, overclaims, proof status, experiment support, or source-to-text traceability.