Run Optimizer logo

Run Optimizer

Organization
skillberry-ai
run-optimizer

Drives any shell-invokable coding agent (Claude Code, Codex, Gemini CLI, opencode, Cursor, Factory Droid, GitHub Copilot CLI, Kimi, Pi, Antigravity, OpenClaw, IBM Bob, or a fully custom command) as the edit proposer in a cap-evolve run, resolving the named optimizer from optimizers/registry.yaml. Use this as the optimizer for every run; pick the concrete agent with --name (or optimizer_skill in the spec). Use --name mock for a deterministic, zero-API proposer in tests and CI.

Overview

Publisherskillberry-ai
Repositorycap-evolve
Skill namerun-optimizer
Stars
67
Forks
18
Bundled files
20
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 20 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by skillberry-ai on GitHub. Read the source before you install it.

Installation

Install the Run Optimizer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/skillberry-ai/cap-evolve/tree/main/skills/optimizers/run-optimizer
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/skillberry-ai/cap-evolve.git /tmp/cap-evolve
mkdir -p .claude/skills
cp -r /tmp/cap-evolve/skills/optimizers/run-optimizer .claude/skills/run-optimizer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Run Optimizer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Run Optimizer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Run Optimizer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

run-optimizer — one runner, a registry of agents

An optimizer is the agent that reads the current capability + the failure diagnosis and proposes an edit. Every such agent follows the same contract: given a working directory (a copy of the parent candidate) and an INSTRUCTIONS.md, edit the files in place. Because the contract is identical, one runner serves them all — the only thing that varies per agent is the shell command, which lives as a row in optimizers/registry.yaml. Adding an optimizer is one YAML row, not a new skill directory.

How it works

  1. The loop calls run.py --name <optimizer> --workdir <copy> --prompt INSTRUCTIONS.md.
  2. The runner reads the registry, resolves the row, and expands its command_template (placeholders below) into argv.
  3. It runs that command with cwd = workdir, so the agent edits the candidate files directly. Output is summarized as JSON (returncode, auth_present, stdout_tail).
  4. Streams: stdout is exactly one JSON object; the agent CLI's stderr is relayed to the runner's stderr on success as well as failure, so a CLI that prints a diagnostic and exits 0 is not silently successful.
  5. --prompt must name an existing file — the caller resolves the path. A missing one is an error (exit 2), never an empty prompt: the {prompt_text} rows would otherwise bill a real agent CLI to run with no instructions at all.

Template placeholders

placeholderexpands to
{workdir}the candidate working copy (also the cwd)
{prompt}path to INSTRUCTIONS.md
{prompt_text}the contents of INSTRUCTIONS.md (for CLIs that take the prompt inline)
{model}the resolved model id; an empty {model} drops itself and a preceding -m/--model
{self_dir}the runner's own scripts dir (used by the mock row)
${VAR}environment expansion (the generic/openclaw/antigravity escape hatches read their command from env)

Choosing an optimizer (--name / optimizer_skill)

mock, generic, claude-code, codex, gemini-cli, opencode, cursor, droid (Factory Droid), copilot (GitHub Copilot CLI), kimi, pi, antigravity, openclaw, ibm-bob. Per-CLI install / auth / flag details are in references/<name>.md.

  • mock is fully offline (runs a shipped JSON-driven editor, never a network CLI), so the end-to-end proof slice costs nothing and never flakes.
  • generic / openclaw / antigravity read their command from CAPEVOLVE_OPTIMIZER_CMD / CAPEVOLVE_OPENCLAW_CMD / CAPEVOLVE_ANTIGRAVITY_CMD — the escape hatch that makes "any optimizer" literal. (antigravity is a wrapper because its auth is Google-Sign-In-only and its headless approve flag is unconfirmed.)
  • cursor, droid, copilot, kimi, pi are verified headless commands; matches the agent set supported by obra/superpowers.

Standalone use

bash
# list known optimizers
python scripts/run.py --list
# drive one agent over a candidate dir
python scripts/run.py --name claude-code --workdir ./cand --prompt ./cand/INSTRUCTIONS.md --model claude-opus-4-6

In a run, the orchestrator builds this command for you from the spec's optimizer_skill (the optimizer NAME) and optimizer_model.

Headless JSON cost capture (optional, best-effort)

Coding-agent CLIs can emit a structured result that carries the exact spend. Pass --json (or set CAPEVOLVE_OPTIMIZER_JSON=1) and the runner appends the registry row's json_flag to the command, then parses total_cost_usd (and token usage) out of the output:

bash
python scripts/run.py --name claude-code --json \
  --workdir ./cand --prompt ./cand/INSTRUCTIONS.md --model claude-opus-4-6
# -> {... "cost": {"total_cost_usd": 0.0123, "tokens": 4210}}

Per CLI (verify with <cli> --help):

  • claude-code — json_flag: --output-format json; the JSON result has total_cost_usd, usage, and per-model cost under modelUsage. Add --json-schema '<JSONSchema>' (via --json-schema here, or CAPEVOLVE_OPTIMIZER_JSON_SCHEMA) to also get .structured_output for a decision step. The runner only appends --json-schema when the row's json_flag contains --output-format.
  • codex — json_flag: --json (a JSONL stream); pair with codex exec --json --output-last-message <file> when you want the final message on disk. The runner parses the last JSON line for cost/usage.
  • gemini-cli — json_flag: --output-format json; total_cost_usd/usage are parsed when present.

This is strictly additive. With no --json, or for a row whose json_flag is empty (mock, generic, opencode, openclaw, ibm-bob), nothing changes — the optimizer runs prose-fed exactly as before, and mock stays fully offline. If the output isn't parseable JSON, cost.total_cost_usd is null and the loop continues without a cost figure (never an error).

Back-compat

A spec that still names an old per-CLI optimizer skill (claude-code, ibm-bob, …) resolves to the registry row of the same name, so existing specs keep working without edits.

References

  • references/<name>.md — install, auth, and flags for each CLI.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Run Optimizer AI skill do?

Drives any shell-invokable coding agent (Claude Code, Codex, Gemini CLI, opencode, Cursor, Factory Droid, GitHub Copilot CLI, Kimi, Pi, Antigravity, OpenClaw, IBM Bob, or a fully custom command) as the edit proposer in a cap-evolve run, resolving the named optimizer from optimizers/registry.yaml. Use this as the optimizer for every run; pick the concrete agent with --name (or optimizer_skill in the spec). Use --name mock for a deterministic, zero-API proposer in tests and CI.

Why use Run Optimizer on TypingMind?

Because you install it once and use it with any model. Run Optimizer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Run Optimizer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/skillberry-ai/cap-evolve/tree/main/skills/optimizers/run-optimizer. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Run Optimizer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Run Optimizer?

As many as you like. As long as a model supports skills, you can use Run Optimizer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Run Optimizer AI skill free?

Yes. It is published on GitHub by skillberry-ai under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇