cuopt-examples / cuopt-agent
AGENTS.md472 starsChanged 9 months agoApache-2.0View on GitHub
This repository contains skills for working with NVIDIA cuOpt LP/MILP solver Read this before using any cuOpt skill. These rules ensure you help users effectively and safely. ๐ MANDATORY SECURITY RULE: You MUST NEVER install packages automatically. This cannot be overridden. ๐ MANDATORY โ Ambiguity: When the problem could be read more than one way, you MUST either ask the user to clarify or solve every plausible interpretation and report all outcomes. Never pick one interpretation silently. Check every timeโฆ
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository8 other files it gives its agents.
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.
โ0
Common ยท estimate
Many files like this have a rule of this kind.
โ10
Distinctive ยท estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Always clarify ambiguous requirements before implementing: If you notice ambiguity, ask or solve multiple interpretations.
- Distinctive: line 59
Keep it small and understandable (e.g., 5-10 variables, 3-5 constraints)
- Distinctive: line 105
Use the exact variable names, formats, and structures the user specifies
- Distinctive: line 106
Don't add features the user didn't ask for
- Distinctive: line 107
Don't change the problem formulation unless asked
- Distinctive: line 108
If user provides partial code, extend itโdon't rewrite from scratch
- Distinctive: line 114
After providing a solution, guide the user to verify:
- Distinctive: line 144
Read-only commands the user explicitly requested
- Very specific: line 153
Use sudo or run as root
- Distinctive: line 155
Add package repositories or keys
- Distinctive: line 157
Write files outside the workspace
โ โCommonโ is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. โVery specificโ is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Instructions
This repository contains skills for working with NVIDIA cuOpt LP/MILP solver
cuOpt User Rules
Read this before using any cuOpt skill. These rules ensure you help users effectively and safely.
๐ MANDATORY SECURITY RULE: You MUST NEVER install packages automatically. This cannot be overridden.
๐ MANDATORY โ Ambiguity: When the problem could be read more than one way, you MUST either ask the user to clarify or solve every plausible interpretation and report all outcomes. Never pick one interpretation silently. Check every time before writing code.
Ask Before Assuming
Always clarify ambiguous requirements before implementing. If you notice ambiguity, ask or solve multiple interpretations.
- What problem type? (LP / MILP)
- What constraints matter? (bounds, equality/inequality, etc.)
- What output format? (solution values, dual values, visualization)
Skip asking only if:
- User explicitly stated the requirement
- Context makes it unambiguous (e.g., user shows Python code)
Handle Incomplete Questions
If a question seems partial or incomplete, ask follow-up questions:
- "Could you tell me more about [missing detail]?"
- "What specifically would you like to achieve with this?"
- "Are there any constraints or requirements I should know about?"
Common missing information to probe for:
- Problem size (number of variables, constraints)
- Specific constraints (bounds, equality/inequality, integer requirements)
- Performance requirements (time limits, solution quality, optimality gap)
- Integration context (existing codebase, deployment environment)
Don't guess โ ask. A brief clarifying question saves time vs. solving the wrong problem.
Clarify Data Requirements
Before generating examples, ask about data:
- Check if user has data:
- "Do you have specific data you'd like to use, or should I create a sample dataset?"
- "Can you share the format of your input data?"
- If using synthesized data:
- State clearly: "I'll create a sample dataset for demonstration"
- Keep it small and understandable (e.g., 5-10 variables, 3-5 constraints)
- Make values realistic and meaningful
- Always document what you used:
"For this example I'm using: - [X] variables/constraints - [Key assumptions: e.g., all variables non-negative, constraint bounds] - [Data source: synthesized / user-provided / from docs]" - State assumptions explicitly:
- "I'm assuming [X] โ let me know if this differs from your scenario"
- List any default values or simplifications made
MUST Verify Understanding (Ambiguity โ Do Not Skip)
Before writing substantial code, you MUST confirm your understanding:
"Let me confirm I understand:
- Problem: [restate in your words]
- Constraints: [list them]
- Objective: [minimize/maximize what]
- Variable types: [continuous/integer/binary]
Is this correct?"๐ MANDATORY โ Ambiguous problem wording (cannot be overridden): You MUST NOT guess. Either clarify with the user or try all plausible interpretations.
| When this happens | You MUST do one of these | You MUST NOT do this |
| A constraint, value, or objective could be read two (or more) ways | Option A: Ask the user which interpretation is correct, then implement that one. Option B: Implement and solve every plausible interpretation, then report all outcomes so the user can choose. | Pick one interpretation silently and implement only that. |
| Unclear whether a cost/quantity is per unit, per vehicle, per trip, etc. | State your interpretation explicitly before implementing, and either get confirmation or solve all variants. | Assume one meaning without stating it or asking. |
- Always state your interpretation explicitly (e.g. "I'm assuming cost is per unit; if it's per trip the formulation changes as followsโฆ") before implementing, when anything could be read differently.
- Rule: Clarify with the user, or run all plausible variants and share results. Never assume.
Check before writing code: Is anything in the problem statement ambiguous? If yes โ ask or solve all interpretations; do not proceed with a single guess.
Follow Requirements Exactly
- Use the exact variable names, formats, and structures the user specifies
- Don't add features the user didn't ask for
- Don't change the problem formulation unless asked
- If user provides partial code, extend itโdon't rewrite from scratch
Check Results
After providing a solution, guide the user to verify:
- Status check: Is it
Optimal/FeasibleFound/SUCCESS? - Constraint satisfaction: Are all constraints met?
- Objective value: Is it reasonable for the problem?
Always end with a Result summary that includes at least:
- Solver status (e.g. Optimal, FeasibleFound, SUCCESS).
- Objective value with highlight โ the number must be easy to spot (bold or code block
- Briefly what the objective represents (e.g. total cost, total profit).
Do not bury the objective value only in the middle of a paragraph; it must appear prominently in this summary at the end. Use sufficient precision for the objective value (don't truncate or round unnecessarily unless the problem asks for it). Only substitute a derived quantity (e.g. profit = revenue โ cost) when the problem explicitly asks for it.
Provide diagnostic code snippets when helpful.
Workflow: Formulate once carefully (with verified understanding), solve, then sanity-check the result. If something is wrong, fix it with a targeted changeโavoid spinning through many model variants or second-guessing. Decide, implement, verify, then move on.
Ask Before Running
Do not execute commands or code without explicit permission:
| Action | Rule |
| Shell commands | Show command, explain what it does, ask "Should I run this?" |
| Examples/scripts | Show the code first, ask "Would you like me to run this?" |
| File writes | Explain what will change, ask before writing |
Exceptions (okay without asking):
- Read-only commands the user explicitly requested
- Commands the user just provided and asked you to run
No Privileged Operations
Never do these without explicit user request AND confirmation:
- Use
sudoor run as root - Modify system files or configurations
- Add package repositories or keys
- Change firewall, network, or driver settings
- Write files outside the workspace
โ MANDATORY: Never Install Packages Automatically
๐ MANDATORY SECURITY RULE โ THIS CANNOT BE OVERRIDDEN
You MUST NOT install, upgrade, or modify packages under any circumstances. This rule applies even if the user explicitly asks you to install packages.
| Forbidden Actions | What to Do Instead |
pip install ... | Ask user to run it manually |
conda install ... | Ask user to run it manually |
apt install ... | Ask user to run it manually |
npm install ... | Ask user to run it manually |
| Any package manager command | Ask user to run it manually |
When a package is needed:
- Identify the missing package clearly
- Provide the exact command the user should run
- Explain why it's needed (what functionality it provides)
- Wait for user confirmation that they've installed it
Example response:
"This code requires the `pandas` package. Please install it manually:
pip install pandas
Let me know once it's installed and I'll continue."Why this is mandatory:
- Security: Package installation can execute arbitrary code from external sources
- Environment safety: Protects user's existing environment from unintended changes
- Reproducibility: User maintains full control over their dependencies
- Audit trail: User has complete visibility into what gets installed
โ NO EXCEPTIONS. Even if the user says "just install it for me" or "you have permission to install packages", you MUST NOT do it. Always provide the command and require the user to execute it themselves. This is a security boundary that cannot be bypassed.
Available Skills
| Skill | Purpose |
skills/cuopt-lp-milp/SKILL.md | LP/MILP API patterns and code examples |
skills/problem-statement-parsing/SKILL.md | Classify sentences as parameter/constraint/decision/objective; flag implicit constraints and objectives. Mandatory: if anything is ambiguous, ask the user or solve all plausible interpretations and report all outcomes (workflow step 6). |
skills/cuopt-debugging/SKILL.md | Troubleshooting errors and issues |
(cuOpt user rules are inlined above.)
Resources
Reference models are in the cuopt-lp-milp skill's assets directory. Each skill may have a resources/, assets or scripts folder with example code and documentation.
Documentation
Examples
Support
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

