SkillOpt

July 14, 2026 · View on GitHub

SkillOpt

Train Agent Skills Like Neural Networks

Optimize natural-language skill documents through iterative rollout, reflection, and gated validation — with epochs, learning rates, and validation gates — without touching model weights.

Get Started :material-rocket-launch:{ .md-button .md-button--primary } View on GitHub :material-github:{ .md-button }


Two Complementary Workflows

WorkflowPackage / commandUse it for
Research engineskillopt, skillopt-train, skillopt-evalTrain and evaluate skill documents on explicit benchmark splits.
SkillOpt-Sleep (preview)skillopt_sleep, skillopt-sleepReview supported coding-agent sessions and stage proposed memory/skill updates for human adoption.

They share the idea of bounded text updates and validation, but they are separate entry points with different configs and safety boundaries. Start with the SkillOpt-Sleep overview before using real session data.


How It Works

🎯
Rollout
Target executes tasks
🔍
Reflect
Optimizer analyzes trajectories
🔗
Aggregate
Merge edit patches
✂️
Select
Rank & clip edits
📝
Update
Apply to skill doc
🚦
Gate
Validate & accept
🔄 Slow Update
🧠 Meta Skill
Epoch Boundary

Deep Learning Analogy

SkillOpt brings the familiar deep-learning training paradigm to agentic prompt optimization:

Deep LearningSkillOpt
Model weightsSkill document (Markdown)
Forward passRollout (target executes tasks)
Loss / gradientReflect (optimizer produces edit patches)
Gradient clippingEdit selection (learning_rate = max edits)
SGD stepPatch application to skill
Validation setGated evaluation on selection split
LR schedulelr_scheduler: cosine, linear, constant
EpochsMulti-epoch with slow update & meta skill memory

Supported Benchmarks

BenchmarkTypeConfig
DocVQADocument QAconfigs/docvqa/
ALFWorldEmbodied AIconfigs/alfworld/
OfficeQAEnterprise QAconfigs/officeqa/
SearchQAOpen-domain QAconfigs/searchqa/
LiveMathematicianBenchMath reasoningconfigs/livemathematicianbench/
SpreadsheetBenchSpreadsheet editingconfigs/spreadsheetbench/

Model Backends

Optimizer and target roles are configured separately. Chat backends include Azure OpenAI (openai_chat), the provider-neutral openai_compatible backend, the Claude Code CLI (claude_chat), Qwen, and MiniMax. Codex and Claude Code exec harnesses are target-only and require adapter support. Despite its name, claude_chat launches claude -p; it is not a direct Anthropic API client.

If a provider implements OpenAI Chat Completions, begin with the built-in compatible backend instead of adding a new integration. See Configuration for authentication and per-role overrides.


Quick Example

# Clone and install the research checkout plus the SearchQA data extra
git clone https://github.com/microsoft/SkillOpt.git
cd SkillOpt
python -m pip install -e ".[searchqa]"

# Configure credentials (choose one auth mode in .env)
cp .env.example .env
set -a; source .env; set +a

# Materialize the runnable split from the checked-in ID manifest
python scripts/materialize_searchqa.py

# Train on SearchQA into a predictable output directory
python scripts/train.py \
  --config configs/searchqa/default.yaml \
  --out_root outputs/searchqa_quickstart

# Evaluate best skill
python scripts/eval_only.py \
  --config configs/searchqa/default.yaml \
  --skill outputs/searchqa_quickstart/best_skill.md \
  --split valid_unseen