modusbrain skillopt — Self-evolving skills
Treat your SKILL.md files as the trainable parameters of an agent that
itself never changes. Write a benchmark of realistic tasks; SkillOpt watches
the agent run them, proposes specific edits, re-tests, and only keeps changes
that measurably improve the score.
Based on SkillOpt (Microsoft Research,
May 2026).
New to this? Start with the hands-on tutorial:
Auto-improve a skill with modusbrain skillopt.
It walks you from “I have a skill” to “I accepted a measurably better version”
in ~20 minutes, including how to write your first benchmark. This page is the
reference — flags, exit codes, cost model, safety guards.
The 30-second pitch
routing-eval.jsonl? Swap step 1 for
--bootstrap-from-routing — but routing tasks test dispatch, not output quality.)
What’s in the box
~/.modusbrain/audit/skillopt-YYYY-Www.jsonl
(ISO-week rotated; honors MODUSBRAIN_AUDIT_DIR).
How the loop works
For each step:- Forward pass. Run the candidate skill against a batch from
D_train. - Backward pass. Two reflect calls (failures + successes per D7) propose edits to address what worked / didn’t work.
- Rank + clip. Top-N edits within the LR budget (cosine schedule by
default; D10 has the ASCII curve in
orchestrator.ts). - Apply. D9 tagged-result patches the body (frontmatter forbidden per D5; ambiguous anchors rejected to the rejected-buffer).
- Validation gate. D12 median-of-3 + epsilon=0.05: every sel-task runs the judge 3 times, takes the median; only accepts if median > best by more than 0.05.
- Commit. D8 history-intent-first 5-step atomic write — crash-safe.
Flags
Exit codes
Cost model
A typical 20-task benchmark with defaults costs ~$0.90 per run:- 32 rollouts × Sonnet (0.29
- 8 reflect calls × Opus (cached) ≈ $0.25
- 24 sel-judges × Sonnet (cached) ≈ $0.10
- Final test eval ≈ $0.07
- Total ≈ $0.71
--max-cost-usd.
Safety guards (the cathedral)
When NOT to use SkillOpt
- No benchmark. Optimizing against guesses is worse than not optimizing.
- Write-flavored skills. Skills whose job is to
put_pageheavily can’t use the v1 read-only sandbox; mocked-write capture is a v0.42 follow-up. - Tiny benchmarks (< 10 tasks). D_sel < 5 refuses by default; meaningful validation needs ≥20 tasks total per the paper.
Related skills
modusbrain skillify scaffold <name>— create a new skill (use BEFORE skillopt)modusbrain skillpack-check <name>— audit conformance + skillopt statusmodusbrain check-resolvable— routing MECE validation (NOT mutated by skillopt)