Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ attribution ledger.
| --- | --- | --- | --- | --- |
| Root repository router | Current `VeryMath/AI4Math-Optimization` repository | [Conan Xu](https://github.com/ConanXu-math), conanxu <1845830029@qq.com> | Root README, bilingual repository map, package routing layer, and public repository structure. | Preserved through repository commit history. |
| `skills/osqp-solver` | New package prepared in the AI4Math Skill Library from official OSQP documentation | [Conan Xu](https://github.com/ConanXu-math) | Package commissioning, integration, review, and release stewardship; implementation was AI-assisted and independently tested. | Preserve through the upstream integration commit and pull request. |
| `skills/optskills` | [fujiwaranoM0kou/OptSkills](https://github.com/fujiwaranoM0kou/OptSkills) | [Haochen Yang](https://github.com/fujiwaranoM0kou) and the OptSkills paper authors | Released optimization problem-archetype skill cards; VeryMath adds standalone packaging, indexing, documentation, and update instructions. | Original MIT notice is preserved in `skills/optskills/LICENSE`; source scope is recorded in `skills/optskills/SOURCES.md`; import authorship is preserved in the import commit. |
| Optimization skill packages | Repository history and imported optimization work | [ricercar77](https://github.com/ricercar77) | Optimization skill contributions and package content. | Preserved through GitHub contributor graph, repository history, and this ledger. |
| `skills/linear-programming`, `skills/mixed-integer-programming`, `skills/second-order-cone-programming`, `skills/or-solver` | Current package metadata | 李爽夕 | LP, MIP, SOCP, solver-setup workflow content, examples, and benchmark materials. | Recorded in package metadata and this ledger. |

Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ manifold-constrained optimization.
[中文说明](README.zh-CN.md) · [Contributors](CONTRIBUTORS.md) · [Skill packages](#skill-packages) · [Installation](#installation) · [Quick start](#quick-start) · [Security model](#security-and-scope)

![version](https://img.shields.io/badge/version-0.1.0-blue)
![skills](https://img.shields.io/badge/skills-7-2ea44f)
![skills](https://img.shields.io/badge/skills-8-2ea44f)
![license](https://img.shields.io/badge/license-MIT-green)

</div>
Expand Down Expand Up @@ -39,6 +39,9 @@ package that matches the problem class.
| [`second-order-cone-programming`](skills/second-order-cone-programming/) | SOCP modeling and cvxpy-based conic solver workflows. | [`README`](skills/second-order-cone-programming/README.md) · [`SKILL`](skills/second-order-cone-programming/SKILL.md) |
| [`or-solver`](skills/or-solver/) | Shared solver detection, installation planning, license checks, and solver selection for OR skills. | [`README`](skills/or-solver/README.md) · [`SKILL`](skills/or-solver/SKILL.md) |
| [`osqp-solver`](skills/osqp-solver/) | OSQP modeling, repeated solves, status gates, and independent verification for continuous convex QPs. | [`README`](skills/osqp-solver/README.md) · [`SKILL`](skills/osqp-solver/SKILL.md) |
| [`optskills`](skills/optskills/) | Standalone selection and use of 103 released OptSkills problem-archetype cards, with explicit upstream updates. | [`README`](skills/optskills/README.md) · [`SKILL`](skills/optskills/SKILL.md) |

`optskills` is self-contained and does not require sibling packages.

## Installation

Expand All @@ -57,6 +60,7 @@ Skill paths:
- skills/second-order-cone-programming
- skills/or-solver
- skills/osqp-solver
- skills/optskills

Steps:
1. Clone or update the repository locally.
Expand All @@ -80,6 +84,7 @@ ln -s "$PWD/skills/mixed-integer-programming" ~/.codex/skills/mixed-integer-prog
ln -s "$PWD/skills/second-order-cone-programming" ~/.codex/skills/second-order-cone-programming
ln -s "$PWD/skills/or-solver" ~/.codex/skills/or-solver
ln -s "$PWD/skills/osqp-solver" ~/.codex/skills/osqp-solver
ln -s "$PWD/skills/optskills" ~/.codex/skills/optskills
```

If your agent uses a different local Skill directory, replace `~/.codex/skills` with that configured path.
Expand Down Expand Up @@ -112,6 +117,12 @@ For continuous convex QPs solved with OSQP, start with:
skills/osqp-solver/SKILL.md
```

For natural-language operations-research archetypes, start with:

```text
skills/optskills/SKILL.md
```

## Repository Layout

```text
Expand All @@ -126,6 +137,7 @@ AI4Math-Optimization/
├── mixed-integer-programming/
├── or-solver/
├── osqp-solver/
├── optskills/
└── second-order-cone-programming/
```

Expand Down
14 changes: 13 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[English](README.md) · [贡献者](CONTRIBUTORS.md) · [技能包](#技能包) · [安装](#安装) · [快速开始](#快速开始) · [安全边界](#安全边界)

![version](https://img.shields.io/badge/version-0.1.0-blue)
![skills](https://img.shields.io/badge/skills-7-2ea44f)
![skills](https://img.shields.io/badge/skills-8-2ea44f)
![license](https://img.shields.io/badge/license-MIT-green)

</div>
Expand All @@ -35,6 +35,9 @@
| [`second-order-cone-programming`](skills/second-order-cone-programming/) | SOCP 建模和基于 cvxpy 的锥优化求解流程。 | [`README`](skills/second-order-cone-programming/README.md) · [`SKILL`](skills/second-order-cone-programming/SKILL.md) |
| [`or-solver`](skills/or-solver/) | 为 OR skills 提供统一求解器检测、安装规划、license 检查和选择策略。 | [`README`](skills/or-solver/README.md) · [`SKILL`](skills/or-solver/SKILL.md) |
| [`osqp-solver`](skills/osqp-solver/) | 面向连续凸 QP 的 OSQP 建模、重复求解、状态门槛与独立验证。 | [`README`](skills/osqp-solver/README.zh-CN.md) · [`SKILL`](skills/osqp-solver/SKILL.md) |
| [`optskills`](skills/optskills/) | 独立选择和使用 OptSkills 已发布的 103 个优化问题原型知识卡,并支持显式的上游更新。 | [`README`](skills/optskills/README.zh-CN.md) · [`SKILL`](skills/optskills/SKILL.md) |

`optskills` 是自包含的,不依赖相邻技能包。

## 安装

Expand All @@ -53,6 +56,7 @@ Skill 路径:
- skills/second-order-cone-programming
- skills/or-solver
- skills/osqp-solver
- skills/optskills

请执行:
1. 本地 clone 或更新仓库。
Expand All @@ -76,6 +80,7 @@ ln -s "$PWD/skills/mixed-integer-programming" ~/.codex/skills/mixed-integer-prog
ln -s "$PWD/skills/second-order-cone-programming" ~/.codex/skills/second-order-cone-programming
ln -s "$PWD/skills/or-solver" ~/.codex/skills/or-solver
ln -s "$PWD/skills/osqp-solver" ~/.codex/skills/osqp-solver
ln -s "$PWD/skills/optskills" ~/.codex/skills/optskills
```

如果你的 agent 使用别的本地 Skill 目录,把 `~/.codex/skills` 替换成对应配置路径。
Expand Down Expand Up @@ -107,6 +112,12 @@ skills/cdopt-optimization/SKILL.md
skills/osqp-solver/SKILL.md
```

自然语言运筹优化问题原型从这里开始:

```text
skills/optskills/SKILL.md
```

## 仓库结构

```text
Expand All @@ -121,6 +132,7 @@ AI4Math-Optimization/
├── mixed-integer-programming/
├── or-solver/
├── osqp-solver/
├── optskills/
└── second-order-cone-programming/
```

Expand Down
4 changes: 4 additions & 0 deletions SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Use this repository as a routing layer for optimization workflows.
- `skills/or-solver/`: shared optimization solver setup and selection.
- `skills/osqp-solver/`: continuous convex QP modeling, OSQP execution,
status gates, and independent solution or infeasibility-certificate checks.
- `skills/optskills/`: standalone selection and use of released OptSkills
problem-archetype cards. Read its `SKILL.md`, combined
`skill_library/index.json`, and selected card files. It does not depend on
sibling skill packages.

Prefer package-local instructions over this router when running a concrete
workflow.
21 changes: 21 additions & 0 deletions skills/optskills/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Haochen Yang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
50 changes: 50 additions & 0 deletions skills/optskills/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# OptSkills

OptSkills is a standalone thin entrypoint to 103 released OptSkills
problem-archetype cards. It helps an agent select a card, formulate the
user's actual operations-research problem, solve it when the environment
permits, and report what was checked.

## Source selection

The library contains 93 NanoCO cards and 10 learned-only cards. It includes no
cluster duplicate and no `ingredients.json`. The selected cards and their
relative paths are listed in `skill_library/index.json`.

## Installation

Clone `VeryMath/AI4Math-Optimization`, then link only `skills/optskills` into
the agent's skill directory:

```bash
git clone https://github.com/VeryMath/AI4Math-Optimization.git
cd AI4Math-Optimization
mkdir -p ~/.codex/skills
ln -s "$PWD/skills/optskills" ~/.codex/skills/optskills
```

## Quick start

Use this prompt:

> Read `SKILL.md`, select the relevant OptSkills cards through
> `skill_library/index.json`, formulate my problem, solve it if possible, and
> check the key constraints.

## Updates

Use this prompt only when an upstream update is wanted:

> Update this standalone OptSkills package from the official upstream. Read `UPDATE.md`, report proposed changes first, and wait for approval before editing.

## Boundaries

Raw cards may contain placeholders or unverified examples. Being installed,
loaded, solved, and checked are different claims; report each state separately.
Normal use is package-local and does not call sibling skills or require the
upstream training, agent, chat, or embedding system.

## License and sources

See [SOURCES.md](SOURCES.md) for upstream attribution and [LICENSE](LICENSE)
for licensing information.
43 changes: 43 additions & 0 deletions skills/optskills/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# OptSkills

OptSkills 是一个独立的薄入口,连接 103 张已发布的 OptSkills
问题原型卡片。它帮助智能体选择卡片、为用户的实际运筹问题建模、在环境允许时求解,并如实报告已检查的内容。

## 来源选择

该库包含 93 张 NanoCO 卡片和 10 张仅来自 learned 的卡片;不包含重复的
cluster 卡片,也不包含 `ingredients.json`。选中的卡片及其相对路径列在
`skill_library/index.json` 中。

## 安装

克隆 `VeryMath/AI4Math-Optimization`,然后只把 `skills/optskills`
链接到智能体的技能目录:

```bash
git clone https://github.com/VeryMath/AI4Math-Optimization.git
cd AI4Math-Optimization
mkdir -p ~/.codex/skills
ln -s "$PWD/skills/optskills" ~/.codex/skills/optskills
```

## 快速开始

使用下面的提示:

> 阅读 `SKILL.md`,通过 `skill_library/index.json` 选择相关的 OptSkills
> 卡片,为我的问题建模,在可以时求解,并检查关键约束。

## 更新

只有需要上游更新时才使用下面的提示:

> Update this standalone OptSkills package from the official upstream. Read `UPDATE.md`, report proposed changes first, and wait for approval before editing.

## 边界

原始卡片可能含有占位符或未经验证的示例。已安装、已加载、已求解和已检查是不同的声明;应分别报告。普通使用仅依赖本包,不调用同仓库的其他技能,也不要求上游的训练、智能体、聊天或嵌入系统。

## 许可与来源

上游署名见 [SOURCES.md](SOURCES.md),许可信息见 [LICENSE](LICENSE)。
53 changes: 53 additions & 0 deletions skills/optskills/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: optskills
description: Use when a coding agent must model or solve a natural-language operations-research problem by selecting from the released OptSkills problem-archetype cards, or when the user explicitly asks to update this standalone OptSkills library from its official upstream repository.
---

# OptSkills

Use this package independently. Do not call sibling skills in the enclosing
repository and do not require the OptSkills training, agent, chat, or embedding
system.

## Lightweight version check

At the start of every normal use, read only the `Upstream snapshot commit` line
from `SOURCES.md` and run
`git ls-remote https://github.com/fujiwaranoM0kou/OptSkills.git HEAD`. Compare
only those two commits; do not fetch or inspect upstream cards. If they match,
continue silently. If they differ or the lookup fails, give at most one short
note and continue with the packaged cards without retrying. Read `UPDATE.md`
and inspect upstream content only when the user asks to update.

## Normal use

1. Restate the user's sets, parameters, decision variables, objective,
constraints, units, and assumptions.
2. Read `skill_library/index.json`. Compare the problem structure with each
entry's `name` and `description`, then select one to three candidates.
3. Read only the selected files using their relative `path` fields. Never
invent a path from a skill ID.
4. Choose the closest card by variables, objective, and constraint structure.
If none fits, say that no released card matched and continue with general
mathematical modeling without claiming a card was used.
5. Apply the card to the user's actual data. Card examples are guidance, not
proof that the new model is correct.
6. Use only solver libraries and licenses actually available in the current
environment. Ask before installing dependencies.
7. Check solver status before reading values. Recompute the objective and the
problem's key constraints whenever execution is possible.
8. Report separately: selected card, completed model, solver execution,
constraint checks, and unresolved limitations.

## Explicit update requests

Only when the user asks to update or synchronize OptSkills, read `UPDATE.md`
and follow it. Do not update during an ordinary modeling task.

## Source boundary

The files under `skill_library/` are released upstream material. Do not rewrite
them as part of normal use. If a card contains a placeholder, missing
dependency, inconsistent notation, or suspected error, correct the active task
explicitly, report the issue, and leave the card unchanged until an upstream
release replaces it.
31 changes: 31 additions & 0 deletions skills/optskills/SOURCES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Sources and attribution

This package provides a thin, standalone entrypoint to released optimization
skill cards from [OptSkills](https://github.com/fujiwaranoM0kou/OptSkills).

Upstream snapshot commit: d9e14300df4b499529c74ea1981e2c1aba0628b8

Paper: *OptSkills: Learning Generalizable Optimization Skills from Problem
Archetypes via Cluster-Based Distillation*, arXiv:2605.29829.

Paper authors: Haochen Yang, Ke Zhao, Mengyuan Ma, Xingyu Lu, Xiangfeng Wang,
and Hong Qian.

## Included material

- all 93 Markdown cards from `skill_library_nanoco_learned`;
- the 10 `skill_library_learned` cards whose `skill_id` is absent from NanoCO;
- the selected entries from the two upstream `index.json` files.

The Markdown card bodies and selected index fields are kept as published
upstream. VeryMath adds only the standalone entrypoint, combined index, human
documentation, and reviewed update instructions.

## Excluded material

The OptSkills training, clustering, self-learning, trajectory, evaluation,
agent, LLM, embedding, dataset, and `ingredients.json` components are not part
of this package and are not runtime dependencies.

The included upstream material is distributed under the MIT license in
`LICENSE`. Consult the source repository and paper for the original project.
53 changes: 53 additions & 0 deletions skills/optskills/UPDATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Updating the standalone OptSkills library

Run this workflow only after the user explicitly asks for an upstream update.

1. Read `SOURCES.md`, this file, and the current `skill_library/index.json`.
2. Fetch the official `fujiwaranoM0kou/OptSkills` repository.
3. Inspect the current NanoCO, learned, and cluster indexes. If their meaning,
fields, or directory structure changed, stop and explain the change before
applying the old selection rule.
4. Before any edit, preflight each selected upstream index and every file it
names. Within each index, require unique non-empty `skill_id` values and
unique `path` values. Accept a path only when it is a direct-child Markdown
filename under that source library. Reject absolute paths, separators or
nested paths, `.` or `..`, non-`.md` suffixes, missing files, and symlinks.
Never follow an upstream path outside its source library.
5. Form the new selected set in this order: NanoCO first, learned only for IDs
absent from NanoCO, and cluster only for IDs absent from both when cluster is
still published as directly usable cards. Require the selected set itself
to have unique non-empty IDs and unique paths.
6. Complete the comparison before writing. Compare the selected set with the
local package by `skill_id` and ordinary text review. Report every addition,
body change, source switch, path change, full upstream removal, path
collision, and license or attribution change. Never rely only on the index
`version` field.
7. Treat an ID moving from NanoCO to learned or cluster as a source switch, not
a removal. Ask again for every current ID removed from all three upstream
libraries. Resolve every approval before editing; if any removal is
declined, leave the entire package unchanged.
8. Compare every proposed path with all currently occupied local paths,
including paths owned by IDs that will move or disappear. A path occupied
by a different current ID remains a collision until that ID's move or
removal is approved. Stop on any unresolved collision, and never overwrite
a current card while its removal is unresolved.
9. Treat any upstream license, copyright-holder, or attribution change as a
separate stop. Do not import that release until redistribution compatibility
is confirmed and the user explicitly approves it. If approved, update
`LICENSE`, `SOURCES.md`, root `CONTRIBUTORS.md`, and any affected README
claims together.
10. After all comparisons and approvals are complete, copy selected card text
and index fields as published upstream. Follow each accepted upstream path;
when an ID moves, remove its obsolete path. Update every affected card plus
index, source, count wording, and the `SOURCES.md` upstream snapshot commit
in `index.json`, `SOURCES.md`, and any affected package or root README files
in the same reviewable Git change.
11. Validate every index path and run real problems for every affected card.
Report file updates separately from solver execution and checked results.
If final validation fails, do not publish the change; restore the pre-update
state through the repository's normal review/rollback workflow. Do not
create an old-content backup directory.

Do not add a synchronization script, retain old card copies, rewrite card
content into a local style, modify sibling skill packages, or add integrity,
receipt, manifest, authorization, or execution-unlock mechanisms.
Loading
Loading