cdopt-optimization

A workflow for using CDOpt, a software package for optimization on curved mathematical spaces called manifolds. It covers modeling, examples, package checks, and small CPU-based tests.

In plain words
What is it for?
Use it to validate a CDOpt installation, run smoke tests, model a problem from text or a paper, or adapt examples involving tools such as NumPy, PyTorch, JAX, and SciPy.
Why use it?
It helps keep CDOpt tasks organized by separating model review, code changes, testing, and diagnosis. It also prevents using CDOpt when the problem does not fit manifold-based optimization.

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/verymath/ai4math-optimization/cdopt-optimization
Any agent
npx skills add VeryMath/AI4Math-Optimization --skill cdopt-optimization
Clone the repo
git clone --depth 1 https://github.com/VeryMath/AI4Math-Optimization

Made for: Claude Code, Codex.

Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,459 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.00080 $0.02459
Opus 5 $0.00040 $0.01229
Sonnet 5 $0.00016 $0.00492
Haiku 4.5 $0.00008 $0.00246

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

Security

Grade A, and why

cdopt-optimization 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 yesterday.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/check_cdopt_environment.py, scripts/write_constrained_layer_runner.py, scripts/write_constrained_rnn_runner.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.

skills/cdopt-optimization/SKILL.md · 225 lines

How it starts

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

CDOpt Optimization

Overview

Use this skill as a CDOpt-specific workflow extracted from the broader optimization skill. Keep the same core discipline: model first, run only after approval, and report from durable evidence.

The center is CDOpt and manifold-constrained optimization. If the problem is not a CDOpt or Riemannian/manifold workflow, say that and route to a broader optimization skill or repository-native solver path instead of forcing CDOpt.

Interaction

If a new session has not chosen a language, ask only:

Would you like to work in Chinese or English?

After the language is known, ask for the concrete CDOpt task or optimization problem directly. Do not begin with a long questionnaire.

Classify the task as one of these modes:

  • Package validation: check whether CDOpt and its numerical stack are installed and usable.
  • Smoke test: run the local manifold notebook suite or a tiny CPU-only CDOpt problem after approval.
  • Problem modeling: turn a natural-language, LaTeX, paper, or official Problem Description card into a reviewed model.
  • Code adaptation: study an official CDOpt example for reference, then adapt it only after the model has been reviewed.
  • Comparison experiment: compare solvers, backends, or baselines only when the user asks for method selection, a report, or reproducibility evidence.
  • Failure diagnosis: inspect dependency errors, API mismatches, solver status, feasibility, stationarity, or numerical warnings.
  • Result interpretation: summarize saved JSON/log evidence, not just console snippets.

Workflow

  1. Read the task and identify whether CDOpt is actually appropriate.
  2. Before modeling, generating code, or running validation, create a task workspace under outputs/{run_id}/. Put checkpoints, generated code, logs, JSON results, and summaries for this task under that directory. Use a short, stable run_id such as 2026-06-11-dictionary-learning or stiefel-backend-comparison.
  3. For package validation, run:

Read the full file on GitHub · 225 lines

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. yesterday First seen · 225 lines · 80 tokens per session scan A f1dc52f7f9cf

Subscribe to this mod's changes

cdopt-optimization is a skill published in the GitHub repository VeryMath/AI4Math-Optimization (5 stars, last pushed 1mo ago), licensed MIT. It adds 80 tokens to every session and 2,459 once invoked, about $0.0004 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-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…

VeryMath/AI4Math-Writing · 100 tokens

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.

VeryMath/AI4Math-Writing · 40 tokens

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.

VeryMath/AI4Math-Writing · 48 tokens

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.

VeryMath/AI4Math-Writing · 43 tokens

claim-evidence-ledger

Use when auditing mathematical paper drafts for supported claims, missing citations, overclaims, proof status, experiment support, or source-to-text traceability.

VeryMath/AI4Math-Writing · 35 tokens

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.

VeryMath/AI4Math-Writing · 45 tokens