Microsoft SkillOpt: Agent Skills That Transfer Across Models
The standard playbook for improving coding agents goes like this: fine-tune the model, or write better prompts, or both. Microsoft Research just published something that breaks that assumption. SkillOpt does not touch model weights. It does not change the agent runtime. It edits one file—an agent’s skill definition—and the agent gets meaningfully better at its job.
The numbers are striking. After SkillOpt optimized a skill file, Codex improved by 24.8 points on SWE-bench Verified. Claude Code improved by 19.1 points. And when SkillOpt took a skill file optimized inside Codex and dropped it into Claude Code without any further tuning, Claude Code went from a baseline of 22.1 to 81.8—slightly beating the 80.4 it reached when optimizing its own skill from scratch.
Think about what that means for a second. A text file optimized in one agent’s environment transferred to a completely different agent running a different model with different tools and different APIs, and it worked as well as the native optimization. That is a comparison worth paying attention to.
What SkillOpt Actually Does
SkillOpt is a text-space optimizer. That is not a term I am making up—it is what the paper calls it, and it accurately describes the mechanism. You give SkillOpt an initial skill file (a markdown document with instructions, rules, and examples for the agent), a training set of tasks, and an evaluation metric. SkillOpt iteratively rewrites the skill file, tests the agent’s performance after each rewrite, and keeps the versions that improve the score.
The optimization loop works like a mini training run, except the “parameters” being updated are natural language sentences, not floating-point numbers. Each iteration produces a candidate skill file. The agent runs the task set with that file. If the score goes up, the candidate becomes the new baseline. If not, SkillOpt tries a different rewrite.
The GitHub repo is open source under MIT. The code is straightforward: a Python orchestrator that manages the edit-evaluate loop, calling the target agent (Codex, Claude Code, or any harness that exposes a CLI interface) as a subprocess.
The Transfer Results
This is the part that matters. Skill transfer between AI agents has been mostly theoretical—people talk about “agent skills” as if they are portable, but in practice, a prompt that works well for Claude often needs rework for GPT, and a system instruction tuned for Codex rarely helps Copilot.
SkillOpt’s cross-model transfer numbers challenge that assumption:
| Scenario | Codex Score | Claude Code Score |
|---|---|---|
| Baseline (no optimization) | ~55 | 22.1 |
| Self-optimized skill | 79.8 (+24.8) | 80.4 (+58.3) |
| Skill optimized in other agent | N/A | 81.8 (+59.7) |
The “other agent” scenario is the interesting one. A skill file optimized inside Codex, where the agent uses Codex’s tool set, code navigation, and model behavior—dropped directly into Claude Code—produced results indistinguishable from a Claude-native optimization.
This suggests something about what makes agent skills effective. The optimization is not learning to work around quirks of a specific model or tool API. It is learning to express task strategies clearly enough that any competent model can execute them. Good skills, it turns out, are good skills.
How This Compares to Other Approaches
Agent optimization has been an active research area for about two years now. SkillOpt sits in a specific niche.
Prompt optimization frameworks like DSPy and TextGrad also optimize natural language instructions through iterative evaluation. The difference is scope. DSPy optimizes prompts for individual model calls. SkillOpt optimizes full agent skill definitions that guide multi-step, tool-using workflows. A DSPy-optimized prompt might tell a model how to classify sentiment better. A SkillOpt-optimized skill file tells an agent how to approach an entire SWE-bench task.
Fine-tuning works at the model level and produces permanent improvements, but it costs thousands of dollars in compute and requires ongoing maintenance as base models improve. SkillOpt’s output is a markdown file. When a new model comes out, you run the evaluation again with the same skill file. If it still works, you are done. If not, you run SkillOpt again. The cost is API calls, not GPU hours.
Manual skill authoring—which is what most teams do today—works well for a handful of skills but does not scale. A human can write a good skill for “fix this bug” or “add a test.” Writing and maintaining optimized skills for dozens of task types across multiple agent platforms is not realistic. SkillOpt automates the part that is tedious, repetitive, and error-prone.
The Optimization Loop in Detail
The mechanics are worth understanding because they explain why the transfer works as well as it does. Here is what one iteration looks like:
- SkillOpt reads the current skill file and the evaluation set (a collection of task descriptions with pass/fail criteria).
- It sends the skill file plus the task descriptions to a strong LLM (the paper uses GPT-5, but any capable model works) with instructions to propose edits that might improve performance.
- The LLM returns a modified skill file. SkillOpt writes it to disk.
- SkillOpt launches the target agent (Codex, Claude Code, etc.) with the modified skill file and runs each task in the evaluation set.
- It collects pass/fail results, computes the aggregate score, and compares it to the previous best.
- If the score improved, the modified skill file becomes the new baseline. If not, it is discarded. Go to step 2.
The loop runs for a fixed number of iterations or until the score plateaus. In the paper, most skills converged within 15-25 iterations, which translates to roughly $50-200 in API costs depending on the evaluation set size and the target model.
What makes this work as transfer is that the optimizer never sees the agent’s internals. It interacts with the agent through the same interface a human would: write a skill file, run the agent, read the results. The optimization surface is the text of the skill file. The agent is a black box. When the optimized skill file moves to a different agent, it brings the same surface-level strategy. If that strategy is sound—clear instructions, good examples, structured checkpoints—the new agent executes it just as well.
This is similar in spirit to how a well-written onboarding document helps a new engineer regardless of which IDE they use or what programming language they prefer. The document is good because it captures the right information and structure, not because it was written for a specific reader.
A Concrete Before-and-After
The paper includes examples of how skill files change through optimization. A skill for fixing bugs started as:
You are a helpful coding assistant. When given a bug report, reproduce the issue, identify the root cause, implement a fix, and verify it works.
After SkillOpt’s optimization loop, it became:
- Read the bug report and the associated test file.
- Run the failing test to confirm the bug. Record the exact error message.
- Locate the function or method producing the error. Read its full implementation.
- Identify the root cause. State it in one sentence before writing any code.
- If the cause is a logic error: write the correction and explain your reasoning. If it is a missing edge case: add the condition and write a new test for it.
- Run the test again. If it passes, verify no other tests broke. If it fails, go back to step 3.
- If you cannot reproduce the bug or identify the cause after three attempts, report what you tried and ask for clarification.
The optimized version is longer, more structured, and more honest about what the agent should do when it gets stuck. The checklist format gives the optimizer clear insertion points for refining individual steps. The failure handling (step 7) prevents the agent from looping indefinitely on unsolvable bugs. These are all things a human skill author could write, but in practice tends to skip because writing them out is tedious. SkillOpt does the tedious part.
When Not to Use SkillOpt
I want to be direct about the downsides, because the paper’s results are strong enough that people will over-apply this.
It overfits to the evaluation set. Just like model fine-tuning, SkillOpt can produce a skill file that scores high on the training tasks but fails on tasks it has not seen. The paper addresses this by evaluating on held-out benchmarks, and the transfer results hold up. But if your evaluation set does not represent the variety of tasks your agents actually face, the optimized skill will not generalize.
It does not help with tasks that require external knowledge. SkillOpt optimizes the agent’s process, not its knowledge. If your agent fails because it does not know your codebase’s architecture or your team’s conventions, no amount of skill optimization will fix that. You need better context injection, not better skill files.
The metric matters more than the skill. If your evaluation metric rewards speed over correctness, SkillOpt will optimize for speed. If it rewards passing tests but ignores code quality, the optimized skill will produce code that passes tests at the expense of readability. Choose your metric carefully—the optimizer will optimize for exactly what you measure, not what you actually want.
Best Practices for Skill Design That SkillOpt Surfaces
Reading through the paper and the repo, a few patterns emerge in what makes a skill optimizable. These are the best practices that SkillOpt consistently reinforces:
Be specific about failure modes. Skills that describe what the agent should do when things go wrong outperform skills that only describe the happy path. “If the test fails, read the error message, identify the line, and propose a fix before moving on” beats “run the tests.”
Structure tasks as checklists. Skills formatted as step-by-step procedures optimize better than prose descriptions. The optimizer can insert, reorder, and refine individual steps more effectively than it can restructure paragraphs.
Include concrete examples. Skills with worked examples of input and expected output consistently produce higher scores. The examples give the optimizer a template to follow when rewriting.
Separate strategy from implementation. Skills that describe what to do and leave how to the agent’s tools optimize better than skills that prescribe specific commands or API calls. The former transfers across agents; the latter ties the skill to a specific environment.
Keep skills under 2,000 words. Longer skill files do not produce better results. SkillOpt’s optimization loop tends to compress verbose skills toward a mean of about 800-1,200 words, cutting filler while keeping the structural elements that drive performance.
Who Should Use SkillOpt (and Who Should Not)
SkillOpt is useful if you maintain a team of coding agents and want them to follow consistent practices without writing and debugging skill files by hand. If your agents regularly run SWE-bench-style tasks—fixing bugs, adding features, refactoring codebases—the optimization loop will likely improve their success rate.
It is less useful if your agents do creative or open-ended work where evaluation is subjective. SkillOpt needs a clear metric to optimize against. If you cannot define “good” in a way a script can verify, the optimizer has nothing to steer toward.
It is also worth noting that SkillOpt optimizes for task completion, not for code quality in the sense a human reviewer would care about. An agent with a SkillOpt-optimized skill file might solve more tasks but produce code that is harder to maintain. The metric is pass/fail on SWE-bench-style evaluation—whether the patch passes tests, not whether it is well-structured or readable. If your team values maintainability over throughput, the optimization might push in the wrong direction.
What This Means for Agent Development
I think the SkillOpt paper points toward a future where agent skills are treated as first-class artifacts, versioned alongside code, and optimized through automated evaluation pipelines. The fact that skills transfer across models means the investment in optimizing a skill pays off even as you change the underlying model or agent platform.
It also suggests that the “prompt engineering” part of building agents has more structure than it looks like from the outside. SkillOpt found consistent improvements by iterating on what amounts to a system prompt. The improvements were not random—they followed patterns that generalize across models and environments. Good agent instructions are not magic. They are testable, optimizable, and reusable.
The repo is at github.com/microsoft/SkillOpt. If you maintain coding agents, it is worth an afternoon to try it on one of your skill files and see what happens.
Sources: