Data & Analysis · GitHub ↗

SkillOpt

Microsoft's Agent Skill Optimizer

SkillOpt is Microsoft's tool for improving a skill instead of rewriting it: it evaluates the skill against real tasks, finds where the instructions are ambiguous or wasteful, and proposes a tighter version. The point is measurable — fewer tokens, fewer failed tool calls, the same output. This page covers what it does, how to run it on a skill you already have, and where it fits in a review workflow. If you publish skills of your own, run them through this first.

Stars
19,432
Last Updated
Nov 28, 2026
Status
active
Source
microsoft/SkillOpt

Install command

pip install skillopt

What SkillOpt actually does

Most skills are written once, by hand, and never measured again. SkillOpt treats the skill document itself as the trainable state of a frozen model: it runs the skill against a task set (rollouts), scores the outputs, has a separate optimizer model propose bounded edits — add, delete, replace — and accepts a candidate only when it strictly improves a held-out validation score. The loop borrows its discipline from deep learning: epochs, a textual learning-rate budget, a rejected-edit buffer, and slow/meta updates between epochs.

The deployed artifact is a compact `best_skill.md` — typically 300 to 2,000 tokens — that runs against the unchanged target model with zero extra inference-time calls. In Microsoft's evaluation across six benchmarks, seven target models, and three harnesses (direct chat, Codex CLI, Claude Code CLI), the optimized skill was best or tied-best in all 52 cells; on GPT-5.5 it lifted average no-skill accuracy by +23.5 points in direct chat and +19.1 inside Claude Code.

The companion: skillopt-sleep

v0.2.0 added SkillOpt-Sleep, a nightly offline self-evolution engine: it reviews past agent sessions, replays recurring tasks, and consolidates validated skills behind the same held-out gate. Where the main CLI optimizes a skill you wrote, Sleep builds one from what your agent actually does — harvest, mine, replay, consolidate — while you are away. Integration shells for Claude Code, Codex, Copilot, and Devin ship in the repo (not the PyPI wheel).

When to use it — and when not

  • Use it before publishing a skill — it finds ambiguous instructions and token waste that manual review misses, and hands you a measured diff rather than vibes.
  • Use it when a skill regressed after a model update — re-running the training loop against the new model re-tunes the document without rewriting it.
  • Use skillopt-sleep when your agent repeats the same tasks nightly — it consolidates what keeps working into a skill automatically.
  • Don't use it to author the first draft — it optimizes existing skills against a task set; you still need a skill and evaluable tasks to start.
  • Don't use it on skills with no measurable outcome — if there's no way to score a rollout, the validation gate has nothing to check against.

What it looks like in practice

A typical run: `pip install skillopt`, point it at your skill file plus a small benchmark of tasks, and let the rollout → reflect → update loop run for a few epochs. The output is `best_skill.md` — the version that scored best on held-out validation — which you install exactly like any other SKILL.md. A Gradio WebUI (`pip install -e ".[webui]"`, then `python -m skillopt_webui.app`) shows the training curve if you want to watch edits get accepted and rejected.

Related tutorials

Compare with

  • SkillSpector — the security-audit counterpart to SkillOpt's quality pass
  • Prompt Master — for writing the first draft SkillOpt will later tighten

Related skills

FAQ

What does SkillOpt do?
SkillOpt trains a skill document like a parameter: it runs your skill against a task set, scores each rollout, and applies bounded edits that only survive if they improve a held-out validation score. The result is a tightened `best_skill.md` — typically 300–2,000 tokens — that performs measurably better without any model weight changes or extra inference calls.
How do I run SkillOpt on my own skill?
Install the Python package with `pip install skillopt`, then point the CLI at your SKILL.md plus a set of tasks it can score. The training loop rolls out, reflects, aggregates, and updates across epochs, keeping a held-out set as the acceptance gate. Optional extras add a Gradio dashboard (`.[webui]`), and docs/sleep covers the nightly self-evolution companion.
How is SkillOpt different from editing a prompt by hand?
Hand edits are unmeasured — you hope the new wording helps. SkillOpt scores every proposed edit against held-out tasks and rejects the ones that don't strictly improve, so the document evolves with evidence instead of taste. It also runs unattended (including the overnight skillopt-sleep mode) and transfers across models and harnesses without re-optimization.

Related guide: what are Claude skills — the skill document format SkillOpt optimizes