К основному содержанию
скилл CX Codex

optim-agent — скилл для Claude Code: подбор параметров через реальные

Скилл, который превращает агента в сэмплер: читает код, предлагает конфигурацию, запускает оценку и записывает результат через ask/tell API.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add Optim-Agent/optim-agent --skill optim-agent -a claude-code
Открыть на GitHub

Что делает optim-agent

optim-agent работает как сэмплер внутри сессии кодинг-агента. Вместо того чтобы полагаться на интуицию модели, он читает проект, понимает смысл параметров и их взаимодействия, затем предлагает одну конфигурацию и запускает реальный evaluator. Результат фиксируется через ask/tell API пакета optim-agent, поэтому решение принимает измеренная метрика, а не догадки агента.

Подходит для дорогих black-box оценок: обучение моделей, инференс, количественные стратегии, reinforcement learning, научные пайплайны. Для работы нужен Python и доступ к файлам и shell в окружении агента.

Пакет ставится из PyPI (python -m pip install optim-agent) или из GitHub. Артефакты хранятся в .optim-agent-runs/, история — в JSON или SQLite. Последовательные запуски выбраны по умолчанию: каждое предложение должно учитывать всю предыдущую историю. Это повод проверить, хватит ли у агента доступа к репозиторию и прав на запуск evaluator.

Какие задачи решает

  • подобрать параметры под измеримую целевую метрику
  • запускать оценку конфигурации и записывать результат
  • не повторять уже испытанные комбинации
  • возобновить прерванный эксперимент без потери истории
  • отличить упавший запуск от осознанно остановленного

Примеры запросов агенту

  • Запусти optim-agent для подбора threshold и budget в моём проекте
  • Прочитай код, предложи конфигурацию и прогони evaluator с минимизацией метрики
  • Возобнови оптимизацию из .optim-agent-runs/ с прежним направлением

Как установить optim-agent

1Через Skills CLI (Vercel)

npx skills add Optim-Agent/optim-agent --skill optim-agent -a claude-code

2Вручную: положить файлы

~/.claude/skills/optim-agent/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/optim-agent/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Похожие

experiment-pipeline EvoScientist Ведёт исследовательский эксперимент по четырём стадиям с лимитами попыток и условиями перехода. Пригодится, когда базовый результат ещё не воспроизведён, а метод уже хочется проверять. CX Codex +1 389установок arbor K-Dense-AI Скилл организует автономный цикл оптимизации кода, моделей и промптов через дерево гипотез. Пригодится для длинных серий экспериментов, когда ручной учёт правок заходит в тупик. CX Codex +1 1 200установок scipy-best-practices Mindrally Скилл задаёт агенту правила научных вычислений на SciPy: оптимизация, линейная алгебра, статистика, сигналы. Пригодится, когда код на Python считает числа, а не рисует интерфейсы. CX Codex +1 1 000установок cost-latency-optimizer patricio0312rev Скилл разбирает, куда уходят деньги и время в LLM-приложении, и предлагает кеш, выбор модели, батчинг и сжатие промптов. CX Codex +1 322установок tao-run-automl NVIDIA Corporation Запускает AutoML и подбор гиперпараметров для моделей NVIDIA TAO через AutoMLRunner. Нужен для настройки обучения, оценки, инференса, дистилляции, прунинга или квантования. CX Codex +1 1 600установок V3 Performance Optimization ruvnet Скилл для оптимизации claude-flow v3 с Flash Attention, HNSW-индексированием и полным набором бенчмарков. Достигает ускорения поиска в 150–12 500 раз и снижения памяти на 50–75%. CX Codex +1 1 100установок

Рядом в теме «ИИ и ML»

Всё по теме «ИИ и ML» →

Вопросы о optim-agent

Как установить optim-agent в Claude Code?

Выполни npx skills add Optim-Agent/optim-agent --skill optim-agent -a claude-code. Скилл появится в ~/.claude/skills/optim-agent/SKILL.md.

Что делает optim-agent?

Скилл превращает кодинг-агента в сэмплер: он читает код проекта, предлагает одну конфигурацию параметров, запускает реальную оценку и записывает результат через ask/tell API пакета optim-agent.

Какое хранилище использовать для истории запусков?

По умолчанию — JSON в .optim-agent-runs/. SQLite (skill-study.db) стоит брать только когда нужны параллельные процессы, потому что последовательные запуски дают каждому предложению полную историю.

Исходный текст

SKILL.md · MIT
---
name: optim-agent
description: Use when the user wants to optimize configurable system parameters against a measurable scalar objective, especially for model training, inference, quantitative strategies, reinforcement learning, scientific workflows, or other expensive black-box evaluations where reading the project can improve trial selection.
---

# optim-agent

Act as the sampler inside any coding-agent session: Claude Code, Codex,
OpenCode/OpenClaw, or another agent that can read project files and run shell
commands. Read the project to understand parameter meaning and interactions,
propose one configuration, run the real evaluator, and record the result
through optim-agent's ask/tell API. Let the measured objective, not the agent's
intuition, decide what works.

## Load the workflow

Use this file as the operating guide for the active coding agent. In Codex, it
can be installed directly from GitHub:

```text
$skill-installer install https://github.com/Optim-Agent/optim-agent
```

In Claude Code, OpenCode/OpenClaw, or another coding-agent environment, place
this repository or `SKILL.md` in the agent-visible workspace and ask the agent
to follow the optim-agent workflow. The workflow does not depend on Codex-only
APIs; it needs file access, shell access, and Python.

Ensure the Python package is importable. Choose one source; do not install both:

```bash
# Stable release from PyPI
python -m pip install optim-agent

# Latest source from GitHub
python -m pip install "optim-agent @ git+https://github.com/Optim-Agent/optim-agent.git"
```

For a reproducible GitHub install, append `@<tag-or-commit>` after `.git`.

## Workflow

1. **Understand the system.** Read the evaluation entry point and every file
   that defines the target parameters. Record each parameter's type, legal
   range, semantics, interactions, and operational constraints.
2. **Define the experiment.** Confirm the scalar objective, `minimize` or
   `maximize`, trial budget, evaluation command, runtime/cost limit, and fixed
   workload or seed. For multiple metrics or hard constraints, agree on one
   scalar feasibility or penalty rule before running trials.
3. **Establish a baseline.** Evaluate the current/default configuration with the
   same command and environment used for every later trial.
4. **Initialize or resume.** Keep artifacts in the repository's ignored
   `.optim-agent-runs/` directory:

   ```bash
   if git rev-parse --git-dir >/dev/null 2>&1 && ! git check-ignore -q .optim-agent-runs/; then
     printf '/.optim-agent-runs/\n' >> "$(git rev-parse --git-path info/exclude)"
   fi
   ```

   ```python
   from pathlib import Path
   import optim_agent as oa

   run_dir = Path(".optim-agent-runs")
   run_dir.mkdir(exist_ok=True)
   study = oa.create_study(
       direction="minimize",
       storage=run_dir / "skill-study.json",
       seed=0,
   )
   print([(t.params, t.value, t.state) for t in study.trials])
   ```

5. **Run one informed trial.** Choose parameters from code understanding and all
   completed history, then use explicit ask/tell:

   ```python
   params = {"threshold": 0.72, "budget": 80}
   trial = study.ask(params)
   try:
       value = evaluate_system(**trial.params)
   except Exception:
       study.tell(trial, state="failed")
       raise
   else:
       study.tell(trial, value)
   ```

   For a deliberately stopped trial, report the latest valid intermediate
   metric first, then call `study.tell(trial, state="pruned")`.
6. **Select the next point.** Avoid accidental repeats, explore broadly before
   exploiting, respect bounds and constraints, and treat failed regions as
   evidence. If the evaluator is noisy, repeat promising configurations under
   the same workload before declaring a winner.
7. **Stop and report.** Stop at the approved budget or stopping condition.
   Report the baseline, best value and parameters, trial count, failed/pruned
   trials, convergence trend, and exact reproduction command.

## Recovery

JSON storage records a trial when `study.tell` runs. Before launching an
expensive external evaluation, save its parameters, command, and output path in
a per-trial directory under `.optim-agent-runs/`. After interruption, inspect
that output before rerunning: if a valid result exists, recreate the same point
with `study.ask(params)` and record it; otherwise rerun it deliberately.

Use SQLite storage (`skill-study.db`) only when the user explicitly wants
multiple processes. Sequential trials are the default because each proposal
should use the complete prior history.

## Rules

- Use ask/tell in skill mode; do not delegate proposal selection to
  `AgentSampler` when the session agent is meant to read and reason over code.
- Keep evaluation inputs and outputs isolated from production configuration.
- Never fabricate, infer, or manually improve an objective value.
- Record crashes as `failed`; record intentional early stops as `pruned`.
- Preserve the study and trial artifacts so the result is auditable and resumable.
- Do not tune secrets, credentials, or unbounded parameters.

© Optim-Agent · MIT · Optim-Agent/optim-agent

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой