Agent skill

Milp Solver Workflow

by benchflow-ai in benchflow-ai/skillsbench

A skill your agent uses for formulating, solving, debugging, and validating mixed-integer linear optimization models with open-source solvers, including variable indexing, sparse constraints…

Apache-2.0Auto-check passedDevelopment

Install Milp Solver Workflow

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill milp-solver-workflow -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install benchflow-ai/skillsbench milp-solver-workflow --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tasks/energy-unit-commitment/environment/skills/milp-solver-workflow .claude/skills/milp-solver-workflow && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
milp-solver-workflow
GitHub stars
1.8k
Token cost
~1.6k tokens
SKILL.md length
599 words
Files
1
Skills in repo
178
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses for formulating, solving, debugging, and validating mixed-integer linear optimization models with open-source solvers, including variable indexing, sparse constraints…

  • Works in 10 steps: Parse and normalize data into ordered… → Define decision states before coding:… → Build a deterministic variable map. → …
  • Validating mixed-integer linear optimization models with open-source solvers
  • SKILL.md covers Workflow, Variable Map Pattern, Sparse Constraint Pattern and Sign-Safe Encoding, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Milp Solver Workflow is an agent skill from benchflow-ai/skillsbench. Use for formulating, solving, debugging, and validating mixed-integer linear optimization models with open-source solvers, including variable indexing, sparse constraints, linearized costs, solver limits, MIP gaps, incumbent extraction, numerical tolerances, and deterministic output reporting.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Debugging. The repository describes itself as: SkillsBench evaluates how well skills work and how effective agents are at using them. The licence is Apache-2.0.

When your agent uses it

  • Validating mixed-integer linear optimization models with open-source solvers
  • Including variable indexing
  • Sparse constraints
  • Linearized costs

Example prompts

  • “/milp-solver-workflow”

Requirements

  • Python 3

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Parse and normalize data into ordered arrays.
  2. Define decision states before coding: status, transitions, continuous quantities, slacks, segments, tiers.
  3. Build a deterministic variable map.
  4. Add constraints family by family: bounds, linking, balance, time coupling, capacity/ramp limits, cost logic.
  5. Solve with an available open-source MILP solver.
  6. Extract a candidate solution, rounding binaries only if near integral.
  7. Convert internal variables into the report convention.
  8. Independently validate extracted arrays.
  9. Recompute objective and summaries from extracted arrays.
  10. Write final output only after validation passes.

What it can do on your machine

Read from SKILL.md and the folder at commit 9a1f4dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Milp Solver Workflow loads about 1.6k tokens when it runs. Until then it costs about 79 tokens; SKILL.md has 599 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~79
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from benchflow-ai/skillsbench at commit 9a1f4dd, republished under its Apache-2.0 licence (© benchflow-ai). 599 words, ~1,641 tokens.

Download SKILL.mdSave it as .claude/skills/milp-solver-workflow/SKILL.md (or your agent's skills folder).
name
milp-solver-workflow
description
Use for formulating, solving, debugging, and validating mixed-integer linear optimization models with open-source solvers, including variable indexing, sparse constraints, linearized costs, solver limits, MIP gaps, incumbent extraction, numerical tolerances, and deterministic output reporting.

MILP Solver Workflow

Use this skill for binary/integer decisions, linear constraints, and linear or piecewise-linear objectives. It is useful for time-expanded scheduling models with many repeated resource-period constraints.

This is a workflow and implementation guide, not a complete formulation for any one task.

Workflow

  1. Parse and normalize data into ordered arrays.
  2. Define decision states before coding: status, transitions, continuous quantities, slacks, segments, tiers.
  3. Build a deterministic variable map.
  4. Add constraints family by family: bounds, linking, balance, time coupling, capacity/ramp limits, cost logic.
  5. Solve with an available open-source MILP solver.
  6. Extract a candidate solution, rounding binaries only if near integral.
  7. Convert internal variables into the report convention.
  8. Independently validate extracted arrays.
  9. Recompute objective and summaries from extracted arrays.
  10. Write final output only after validation passes.

Variable Map Pattern

Use helper functions or dictionaries, not scattered index arithmetic.

python
offset = {}
n = 0

def alloc(name, shape, lb=0.0, ub=float("inf"), integer=False):
    global n
    size = int(np.prod(shape))
    idx = np.arange(n, n + size).reshape(shape)
    offset[name] = idx
    n += size
    return idx

u = alloc("commitment", (G, T), lb=0, ub=1, integer=True)
start = alloc("startup", (G, T), lb=0, ub=1, integer=True)
dispatch = alloc("dispatch", (G, T), lb=0)
reserve = alloc("reserve", (G, T), lb=0)

Keep variable ownership obvious: type, resource, period, and optional segment/tier.

Sparse Constraint Pattern

Use sparse rows for large time-expanded models:

python
rows, cols, vals = [], [], []
lb, ub = [], []
row = 0

def add_row(terms, lo, hi):
    global row
    for j, a in terms:
        if abs(a) > 0:
            rows.append(row)
            cols.append(j)
            vals.append(float(a))
    lb.append(float(lo))
    ub.append(float(hi))
    row += 1

Use equality rows for conservation/linking and upper/lower bound rows for capacity, reserve, ramping, timing, and logic.

Sign-Safe Encoding

Write the intended inequality first, then move variable terms to the left-hand side.

python
# Intended: x + y <= cap * u - reduction * start
# Row form: x + y - cap*u + reduction*start <= 0
add_row(
    [(x, 1.0), (y, 1.0), (u, -cap), (start, reduction)],
    lo=-INF,
    hi=0.0,
)

For non-obvious rows, test a tiny hand case. Example: set u=1, start=1 and check the remaining capacity equals the intended startup capability; set u=1, start=0 and check normal capacity returns.

Match Model Rows To Validation

Keep a checklist linking each model constraint family to a validation check:

text
transition linking      -> startup/shutdown match status
online capacity         -> offline zeroes and min/max output
joint reserve capacity  -> production plus reserve fits capability
ramp deliverability     -> reserve can be deployed within ramp-up
minimum durations       -> starts/stops imply required status windows
balance equations       -> demand/load/inventory conservation
cost-curve logic        -> recomputed objective matches report

If validation checks something not in the model, the solver may produce an invalid report. If the model has a constraint not validated after extraction, conversion bugs can slip through.

Piecewise-Linear Costs

Identify the curve convention before modeling:

  • total cost at output breakpoints;
  • marginal or incremental segment cost;
  • heat-rate curve;
  • first point as minimum-output or no-load-like cost.

For segment variables, constrain segment quantities to their widths and sum them to the modeled production quantity. Use slopes only when the data represents total-cost breakpoints or incremental segment costs consistently.

Open-Source Solver Use

HiGHS through SciPy is a common default when available:

python
from scipy.optimize import milp, LinearConstraint, Bounds

result = milp(
    c=c,
    integrality=integrality,
    bounds=Bounds(lb, ub),
    constraints=constraints,
    options={"time_limit": 600.0, "mip_rel_gap": 0.01, "disp": False},
)

if result.x is None:
    raise RuntimeError(f"No incumbent: status={result.status}, message={result.message}")

Capture status, objective, incumbent values, and any reliable gap/bound. A time-limit status can be useful if a feasible incumbent exists; a failure with no incumbent is not a solution.

Show full SKILL.md (226 more words)Show less

Extraction And Validation

After solving:

  • check binary variables are close to 0/1 before rounding;
  • convert internal units/conventions to report units;
  • recompute summaries from arrays;
  • recompute objective from input data and extracted decisions;
  • run validation that reads only input data plus extracted/report arrays;
  • write "pass" self-checks only after validation passes.

Debugging Infeasibility

First suspect the model encoding. Common causes:

  • mixing total output with output above minimum;
  • applying startup/shutdown limits to the wrong quantity;
  • using the wrong t or t-1 index;
  • over-constraining initial minimum up/down obligations;
  • enforcing post-horizon obligations when the prompt excludes them;
  • treating cost curves as feasibility constraints;
  • choosing bad Big-M values;
  • requiring segment/tier variables when the trigger did not occur.

Debug in stages: check shapes, relax one family at a time, add diagnostic slack variables, print largest violations, and compare local validation with final requirements.

Repair LPs And Heuristics

A fixed-commitment repair LP is useful only if it includes every feasibility family judged in the final report. Do not repair only balance and capacity while omitting transition-dependent ramp, reserve, startup, shutdown, or minimum-duration limits.

Always rerun independent validation after repair.

Reporting Discipline

  • Use deterministic ordering and plain numeric values.
  • Do not include placeholder values.
  • Keep feasibility separate from proof quality/MIP gap.
  • Use null/empty gap when no reliable bound exists, if the schema allows it.
  • Do not trust solver status or self-reported "pass" strings without validation.

© benchflow-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in tasks/energy-unit-commitment/environment/skills/milp-solver-workflow of benchflow-ai/skillsbench.

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Milp Solver Workflow next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Milp Solver Workflow compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Milp Solver Workflow this skillbenchflow-ai/skillsbench1.8k—~1.6kAutomated safety check: PassApache-2.0
Trellis Session Insightmindfold-ai/Trellis15k4 repos~1.7kAutomated safety check: PassAGPL-3.0
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT
Debugging Executionsn8n-io/n8n207k—~2.6kAutomated safety check: PassCustom licence
Aoti Debugpytorch/pytorch104k1 repos~1.7kAutomated safety check: PassCustom licence
Herdr Throwaway Reproductionherdrdev/herdr43k—~2.4kAutomated safety check: PassApache-2.0

Similar skills

  • Trellis Session Insight

    mindfold-ai/Trellis

    Reach into past AI conversation history through the trellis mem CLI.

    15k GitHub starsUsed in 4 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • Official

    Debug failed or wrong-output workflow executions using executions tools.

    207k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Aoti Debug

    pytorch/pytorch

    Debug AOTInductor (AOTI) errors and crashes. An agent skill from pytorch/pytorch.

    104k GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed
  • Runs a disposable, uniquely named Herdr session inside an existing one so runtime, pane, terminal or API bugs can be reproduced without touching the main session.

    43k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Systematic Debugging

    ultralisp/ultralisp

    A skill your agent uses when encountering any bug, test failure, or unexpected behavior, before proposing fixes

    258 GitHub starsUsed in 51 repos~2.4k tokens
    DevelopmentAuto-check passed

More from benchflow-ai/skillsbench

All 178 skills in this repo
  • Lean4 Memories

    benchflow-ai/skillsbench

    This skill should be used when working on Lean 4 formalization projects to maintain persistent memory of successful proof patterns, failed approaches, project conventions, and user preferences…

    1.8k GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Senior Data Engineer

    benchflow-ai/skillsbench

    World-class data engineering skill for building scalable data pipelines, ETL/ELT systems, real-time streaming, and data infrastructure.

    1.8k GitHub stars~5.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Ac Branch Pi Model

    benchflow-ai/skillsbench

    AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

    1.8k GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Civ6lib

    benchflow-ai/skillsbench

    Civilization 6 district mechanics library. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • D3 Visualization

    benchflow-ai/skillsbench

    Build deterministic, verifiable data visualizations with D3.js (v6).

    1.8k GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Dc Power Flow

    benchflow-ai/skillsbench

    DC power flow analysis for power systems. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~717 tokensUpdated 2 mo ago
    Auto-check passed

Categories

Questions about Milp Solver Workflow

What does Milp Solver Workflow do?

A skill your agent uses for formulating, solving, debugging, and validating mixed-integer linear optimization models with open-source solvers, including variable indexing, sparse constraints…. Milp Solver Workflow is an agent skill from benchflow-ai/skillsbench. Use for formulating, solving, debugging, and validating mixed-integer linear optimization models with open-source solvers, including variable indexing, sparse constraints, linearized costs, solver limits, MIP gaps, incumbent extraction, numerical tolerances, and deterministic output reporting.

When should I use Milp Solver Workflow?

Milp Solver Workflow fits situations like: validating mixed-integer linear optimization models with open-source solvers; including variable indexing; sparse constraints; linearized costs.

How do I install Milp Solver Workflow in Claude Code?

Run `npx skills add benchflow-ai/skillsbench --skill milp-solver-workflow -a claude-code`. Or copy the skill folder (tasks/energy-unit-commitment/environment/skills/milp-solver-workflow in benchflow-ai/skillsbench) into .claude/skills/milp-solver-workflow in your project. Claude Code loads it when a task matches its description.

How do I install Milp Solver Workflow in Codex?

Run `npx skills add benchflow-ai/skillsbench --skill milp-solver-workflow -a codex`. Or copy the skill folder (tasks/energy-unit-commitment/environment/skills/milp-solver-workflow in benchflow-ai/skillsbench) into .agents/skills/milp-solver-workflow in your project. Codex loads it when a task matches its description.

Can I use Milp Solver Workflow in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add benchflow-ai/skillsbench --skill milp-solver-workflow -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/milp-solver-workflow, .gemini/skills/milp-solver-workflow, .github/skills/milp-solver-workflow and .opencode/skills/milp-solver-workflow in your project.

What does Milp Solver Workflow need to run?

SKILL.md names no scripts, command-line tools or credentials: Milp Solver Workflow is instructions for the agent only. Our summary lists: Python 3.

Does Milp Solver Workflow access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Milp Solver Workflow safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Milp Solver Workflow use?

Milp Solver Workflow is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Milp Solver Workflow use?

About 1.6k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Milp Solver Workflow?

Skills that share tags, products or a category with Milp Solver Workflow: Trellis Session Insight (mindfold-ai/Trellis, 15k stars), Native Data Fetching (CherryHQ/cherry-studio-app, 4k stars), Debugging Executions (n8n-io/n8n, 207k stars) and Aoti Debug (pytorch/pytorch, 104k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Milp Solver Workflow?

benchflow-ai (a GitHub organization) maintains it in benchflow-ai/skillsbench, which has 1,832 GitHub stars. The repository holds 178 skills in this directory. The repository was last updated on July 23, 2026.

Source: benchflow-ai/skillsbench on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.