constraint-programming

constraint-programming is a skill for Claude Code, Codex from hajibabaie/combinatorial-optimization-skills. It costs 0 tokens per session (10,553 once invoked), scanned A, original, MIT.

A way to describe problems using rules and variables, then search for assignments that satisfy those rules. It is suited to tasks such as scheduling, assigning resources without clashes, and configuration puzzles; CP-SAT is Google OR-Tools’ solver for integer constraint problems.

In plain words
What is it for?
Use it to model integer or yes-or-no decisions, time intervals, non-overlapping work, resource capacities, and all-different assignments with OR-Tools CP-SAT.
Why use it?
Many real planning problems contain combinations of ordering, overlap, and assignment rules that are awkward to encode as ordinary formulas. Constraint programming lets the solver work with these relationships directly, while also clarifying when another method is a better fit.

Skill for Claude CodeCodex

Part of the combinatorial-optimization plugin — 76 skills shipped together

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/hajibabaie/combinatorial-optimization-skills/constraint-programming
Any agent
npx skills add hajibabaie/combinatorial-optimization-skills --skill constraint-programming
Clone the repo
git clone --depth 1 https://github.com/hajibabaie/combinatorial-optimization-skills

Made for: Claude Code, Codex.

Or install combinatorial-optimization, the plugin that ships this one along with the rest of its 76 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for constraint-programming

README.md
[![agentmods](https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/constraint-programming.svg)](https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/constraint-programming)
Your own site
<a href="https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/constraint-programming"><img src="https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/constraint-programming.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,553 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.00000 $0.10553
Opus 5 $0.00000 $0.05276
Sonnet 5 $0.00000 $0.02111
Haiku 4.5 $0.00000 $0.01055

Measured 5d ago against content hash 84656fb3c2ea, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

constraint-programming 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 5d 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.

skills/constraint-programming/SKILL.md · 636 lines

How it starts

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

Constraint Programming with CP-SAT

You are an expert in constraint programming (CP) for combinatorial optimization, specifically in modeling with Google OR-Tools CP-SAT. This skill covers the CP modeling vocabulary — integer, boolean, and interval variables; global constraints such as AllDifferent, NoOverlap, and Cumulative; channeling and reification — plus search strategies, solver parameters, and the judgment call of when CP beats MIP. Use the framework below to assess the problem, choose CP or MIP deliberately, build the model from global constraints rather than decomposed booleans, and report solution quality honestly.

Initial Assessment

Before writing any model, establish the following. Each answer changes a modeling decision downstream.

  • Problem class. Sequencing/scheduling with disjunctive resources, assignment with clash constraints, configuration/feasibility puzzles — all CP home turf. Network flows, blending, continuous costs — MIP/LP territory. See the decision table below before committing.
  • Are all quantities integer, or can they be made integer? CP-SAT has no continuous variables. Durations, costs, and capacities must be integers; floats must be scaled (e.g., cents, milliminutes). Confirm an acceptable scaling before modeling.
  • Domain sizes. A start-time variable with domain [0, 10^9] cripples propagation. Compute a tight horizon (sum of durations, or a critical-path bound) and tight per-variable bounds first.
  • Feasibility-driven or objective-driven? Pure feasibility (timetabling with only hard constraints) and min-max objectives (makespan) favor CP. Strong economic objectives with many cost terms and a tight LP relaxation favor MIP.
  • Hard vs soft constraints. List them separately. Hard constraints become model constraints; soft constraints become penalty terms on reified booleans. Get the user's penalty weights or a lexicographic priority order explicitly.
  • Instance size, now and at target scale. Number of tasks/lectures, machines/rooms, time slots. Channeling booleans grow as variables × domain size — check that product before generating them.
  • Solver availability. OR-Tools is Apache-licensed and pip install ortools — almost always available. If the user is locked into a Gurobi-only stack, indicator constraints there cover some of the same ground (see milp-modeling-gurobi).
  • Time budget and proof requirement. CP-SAT is an anytime solver: it reports the best incumbent and a dual bound. Does the user need proven optimality, a certified gap, or just a good feasible solution in N seconds?
  • Symmetry. Identical machines, identical rooms, interchangeable shifts? Plan symmetry-breaking constraints up front; CP search suffers from symmetry exactly as MIP does.
  • Dual values or sensitivity analysis needed? CP-SAT provides neither. If the user needs shadow prices, the model must be (also) an LP/MIP.
  • Determinism and reproducibility. Research use: fix random_seed and num_workers; prefer max_deterministic_time over wall-clock limits when run-to-run reproducibility matters.
  • Existing data format. Standard benchmark formats (JSP ft06-style tables, ITC timetabling files) parse into the same model structures used below; do not invent a new format if a standard one exists.

Read the full file on GitHub · 636 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. 5d ago First seen · 636 lines · 0 tokens per session scan A 84656fb3c2ea

Subscribe to this mod's changes

constraint-programming is a skill published in the GitHub repository hajibabaie/combinatorial-optimization-skills (7 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 10,553 tokens. 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

learn-from-fix

Capture Elixir/Ecto/LiveView lessons and Hex API rules. Use after corrections or when asked to document learning, record a lesson, prevent a fixed mistake, or remember package guidance with --library.

oliver-kriska/claude-elixir-phoenix · 46 tokens

phx-deps-audit

Audit Hex deps for supply-chain security risk — bidi chars, compile-time exec, maintainer changes, typosquats, CVEs. Use after mix deps.update, when checking if a package upgrade is safe, or reviewing mix.lock PR diffs.

oliver-kriska/claude-elixir-phoenix · 58 tokens

promote

Generate X/Twitter release promotion posts with ASCII tables and CodeSnap rendering. Use when writing release posts, promotion tweets, plugin announcements, or preparing social media content for new versions.

oliver-kriska/claude-elixir-phoenix · 39 tokens

release

CONTRIBUTOR TOOL - Cut a plugin release: bump plugin.json version, finalize CHANGELOG, update README if needed, gate on make ci, commit, tag vX.Y.Z, and create the GitHub release. Use when shipping a new plugin version. NOT distributed.

oliver-kriska/claude-elixir-phoenix · 60 tokens

session-deep-dive

Deep qualitative analysis of high-signal sessions. Spawns subagents with v2 template, synthesizes patterns, compares against known findings. Use after /session-scan.

oliver-kriska/claude-elixir-phoenix · 40 tokens

catchup

Summarize and review what changed while you were away. Use after a weekend, vacation, or flight to check missed PRs, git commits, Linear tickets, and meetings — one prioritized brief, not a firehose.

oliver-kriska/claude-elixir-phoenix · 48 tokens