Apply to my task
arXiv:2610.35434 ★ 96 Oct 26, 2026

Skill∞: Recursive Optimization of Agent Skills via a Meta-Skill

Key result

A skill the agent writes for itself doesn't help: 42.9% success versus 45.5% with no skill at all. The Skill∞ method lets you automatically refine SKILL.md (folders of instructions for Claude Code, Codex and OpenCode). The result: 60.7% success versus 56.4% for human-written skills. The trick: an edit is accepted only if a run showed improvement on the exact error it was meant to fix. A separate meta-agent reads the run logs, finds the action that caused the failure, and sends each edit to an independent reviewer for verification.

01

TL;DR

Skill∞ is a way to automatically refine agent skills (folders with a SKILL.md file that Claude Code, Codex and OpenCode load on their own). Here's how it works. A separate "meta-agent" follows a meta-skill: another SKILL.md that spells out how to refine other skills. Each round, the meta-agent reads the run logs (how the agent behaved while doing the task), pins down why it failed, proposes 1–2 edits and sends each one for independent review. Then it decides whether to keep going or stop. The killer trick: the meta-skill itself gets refined the exact same way.

The headline finding: a skill the agent writes for itself without feedback doesn't help. It hits 42.9% success versus 45.5% with no skill at all. The agent confidently writes "helpful" instructions but never checks whether they actually change its behavior. Skill∞ closes that gap. An edit is accepted only if a real run shows improvement on the exact error it was meant to fix. It's not enough for the edit to just mention the problem in its text. The result: 60.7% success versus 56.4% for human-written skills.

The core of the method: a six-step loop baked into the meta-skill. History log → failure analysis → 1–2 candidates → test run → independent reviewer in a clean context → "continue / stop" decision. The evaluation (the success check) sits out of reach of the self-improvement loop. So the agent can't "improve" its score by tweaking the grading criteria.

Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

02

Method Blueprint

LOOP (until the budget runs out or the agent decides to stop):
STEP 1: Review the archive — what's been tried, what worked → notes
STEP 2: Run the current skill on the tasks, analyze the failure logs → diagnosis: which agent action caused the error
STEP 3: Create 1–2 candidates from the current skill → each with a rationale (proposal)
STEP 4: Run the candidates on the tasks → scores, logged to the archive
STEP 5: Hand each candidate to an independent reviewer (isolated context) → accept / reject
STEP 6: Decide: continue or stop; pick the next "parent" (possibly rolling back) → optimized skill

OUTER LOOP: the same cycle is applied to the meta-skill itself across several optimization tasks from different domains → a "polished" meta-skill → used for any new skills.

Steps 1–6 run in a single meta-agent session. Task runs and the reviewer run in separate sessions.

03

Example in Practice

The method works well wherever there's a verifiable result (a test, a reconciliation, a checklist you can actually run). Subjective tasks like "write something beautiful" aren't a fit.

Task: You run the analytics team for an Amazon seller. Every week an agent (Claude Code) pulls the order and return exports, reconciles them against the settlement report and flags discrepancies. The "amazon-reconciliation" skill was thrown together in an afternoon, and the agent keeps mixing up referral fees with FBA fulfillment fees or missing last month's returns. You have 6 past weeks with known correct totals: that's your "grader."

Prompt:

Use the "skill-optimizer" skill (in .claude/skills/skill-optimizer/SKILL.md).

Optimization target: the skill .claude/skills/amazon-reconciliation/SKILL.md
Tasks: 6 folders /tests/week_01 … /tests/week_06
(each contains the exports and an expected.json file with the correct totals)
Success check: python /tests/check.py <result_folder> — returns 0 or 1.
Do not edit it or work around it.
Budget: at most 4 candidates total.
Keep the archive in /tmp/optimizer/archive.md.

Result: The agent runs the current skill on all 6 weeks and shows a failure table. For each failure it names the specific action that caused the error (for example, "used the 'Gross Proceeds' column instead of 'Net Disbursement'"). It proposes 1–2 skill edits and launches an independent reviewer, which rejects any edit that merely rewords the text without changing behavior. The archive keeps the history of attempts. At the end you get an improved SKILL.md and a short report: what was fixed, what the runs confirmed, and what got rejected.

04

Why It Works

The weakness. Ask an agent to "improve the instructions" and it will rewrite them to sound nicer, not necessarily to work better. A score tells you whether things got better, but not why. And whoever wrote the edits tends to praise their own work. That's why self-generated skills are no better than having no skill at all.

The LLM's strength. Models are good at reading run logs and finding the cause of an error: "at step 3 the agent skipped the check." They reason well about causes, not just numbers. And a fresh model instance, free of someone else's reasoning, critiques more honestly.

How the method exploits this. The search turns into reasoning about errors instead of blind trial-and-error on scores. A tie isn't thrown out if the candidate made progress on the target error. A reviewer in an isolated context weeds out hollow edits, so noise isn't mistaken for progress. Recursion adds improvement of the process itself. In the paper, self-improving the meta-skill wrote a stricter standard of evidence into it (confirm an edit only with a run).

Prompt control levers: - Candidate budget (max 4 per skill in the paper) → fewer for simple skills, more for stubborn failures. - Candidates per round (1 or 2) → 2 to explore different ideas, 1 to dig deeper into one line. - Stopping condition → let the agent stop on its own once the diagnosis shows no failures left. - Review strictness → require rejecting edits that don't change behavior and edits the agent will never invoke. - What gets optimized → the skill's description too: the agent sees only the name and description and decides on its own whether to load the skill.

05

Prompt Template

The original meta-skill is in Appendix G of the paper; its text isn't in the excerpt we analyzed. Below is a reconstruction based on the described algorithm (six steps, archive, independent reviewer, adaptive budget), formatted as a SKILL.md.

---
name: skill-optimizer
description: Use when you need to improve an existing skill based on
  task runs: diagnosing failures from logs, edits, independent review.
---

<Role>
You are a meta-agent. Your job is to optimize the skill {target_skill}.
You do not solve tasks yourself: you improve the instructions another agent uses to solve them.
</Role>

<Inputs>
Target skill: {skill_path}
Tasks: {task_folder_or_list}
Success check: {check_command}  (run only, do NOT modify or bypass)
Budget: {max_candidates} candidates total
Archive: {archive_path}
</Inputs>

<Loop>
Repeat until you decide to stop or the budget runs out:

1. INSPECT: read the archive: which versions existed, what changed, how they scored, what the reviewer rejected.
2. DIAGNOSE: run the current version (the "parent") on the tasks. Analyze the failure logs. For each failure, name the specific agent action that caused the error.
3. CREATE: create k candidates (1 ≤ k ≤ 2, no more than the remaining budget). For each, write a proposal: which error we're fixing, what behavior should change, and why.
   Reduce the remaining budget by k.
4. EVALUATE: run the candidates on the same tasks. Record the scores in the archive.
5. REVIEW: hand each candidate to an independent reviewer (a separate subagent without your reasoning). Give it only: the parent, the candidate, the proposal and the run data.
   The reviewer rejects a candidate if:
   — there are no substantive changes;
   — the skill was never loaded by the agent;
   — the skill is unusable as written.
6. DECIDE: decide whether to continue. Pick a new parent from the archive.
   — Don't discard a candidate with the same score but real progress on the target error.
   — If the gain can't be tied to the edit, keep the parent.
   — If a line of edits has stalled, roll back to an earlier version.
   — If the diagnosis leaves almost nothing to improve, stop.
</Loop>

<Rules>
- Accept an edit only if a run shows improvement on the target error,
  not just because the skill text mentions the problem.
- Improve the skill's description too: the agent sees only the name and description.
- Do not change the success check and do not tailor the skill to specific tests.
- Do not skip the REVIEW step.
</Rules>

<Output>
The final skill at {result_path} and a short report: what was fixed, what was confirmed, what was rejected.
</Output>

What to fill in: {skill_path} — your SKILL.md. {task_folder_or_list} — real task examples with known correct answers. {check_command} — a script, test or checklist that returns "pass / fail". {max_candidates} — for example, 4.

🚀 Quick start — paste into a chat or your agent:

Here's a meta-skill template for optimizing skills. Adapt it to my task: [describe which skill or agent instructions you want to improve]. 
Ask me questions to fill in the fields.

[paste the template above]

The model will ask how to check success (a command, test or checklist), which examples to run on and what attempt budget to use. Without a verifiable criterion the loop is pointless: the reviewer and the diagnosis need facts, not gut feelings. Then it will put together a ready-to-use SKILL.md for your tool (Claude Code, Codex, OpenCode).

06

Limitations

⚠️ You need a verifiable result: the method relies on runs with automated checks (tests, reconciliation, a script). For subjective tasks (style, creativity, "persuasiveness") it won't give a reliable signal.

⚠️ You need runs: every candidate is scored by running the agent on several tasks, sometimes five times each. That's tokens, time, and hand-building a task set with reference answers. You can't reproduce the method in a regular chat.

⚠️ Not better than humans everywhere: results vary by domain. In cybersecurity, natural sciences and finance, human-written skills came out ahead (in finance Skill∞ scored 26.7% versus 37.8%). The method's lead rests on software engineering, media and math.

⚠️ The recursive part is expensive: polishing the meta-skill itself requires several optimization tasks from different domains. For a single task of your own, the off-the-shelf meta-skill without self-improvement is enough: it already delivers 55.9%, higher than most automated methods.

⚠️ The original prompt isn't in the analyzed text: the meta-skill lives in the appendix, and the code is promised on GitHub. The template above is reconstructed from the algorithm description, not quoted verbatim.

⚠️ Results are tied to the model and environment: the headline numbers come from a single model-plus-tool combo. On another model and another tool the method also beat human-written skills, but by a different margin.

07

How They Tested It

The researchers took 83 agentic tasks from SkillsBench (eight domains: software development, cybersecurity, science, finance, office work, media, manufacturing, math). Each task was run five times, and they measured the share of successful runs. The main setup: Codex CLI with the GPT-6 Luna model. They compared against five baselines: no skill at all, human-written skills, skills written by the agent itself, skills from skill-creator, and the previous method SkillEvolver. The optimization budget was capped at four candidates per skill. To test on a "continuous" metric they also used KernelBench: GPU code speedup relative to a reference.

Results: Skill∞ scored 60.7%, humans 56.4%, SkillEvolver 54.5%, no skill 45.5%. On KernelBench the average speedup was 1.62 versus 1.18 for SkillEvolver. The most telling bit: skills the agent wrote for itself scored 42.9%, meaning worse than no skill at all.

The ablation design is simple: same method, but with the original meta-skill and no self-improvement. That got 55.9%, so the loop with review alone already beats prior methods, and recursion adds roughly five more points. Self-improvement helped most in math (+24 pts), media (+22) and software development (+11). The authors attribute the gain to the polished meta-skill learning to confirm an edit only with a run. They also tested a different model (66.5% versus 61.2% for humans) and a switch to OpenCode as the tool (56.9% versus 53.3%).

One more design detail: skills are loaded the standard way, just like in real work. The agent isn't told "use this skill"; it sees only the name and description and decides for itself. So the description is part of the optimization too, and the measured gain doesn't depend on a hint at launch. Tables with finer-grained breakdowns are cut off in the analyzed text.

08

Adaptations and Extrapolations

🔧 Technique: Optimize the description → the agent loads the right skill more often

In the paper, a skill only fires if the agent decides to open it based on its name and description. Add an explicit step to the loop:

7. TRIGGER-CHECK: for 5 typical user requests, check whether the agent would load the skill based on the description alone. If it doesn't, rewrite the description and repeat the check.

Extrapolation: applying it to CLAUDE.md / AGENTS.md. The same principles work for a project instructions file. The rules "an edit is accepted only when a run confirms it fixes the target error" and "a reviewer in a clean context" apply to any agent instructions:

You are improving the CLAUDE.md file. Take the 5 most recent sessions where the agent made a mistake (logs in /logs). For each one, name the agent action that caused the error and propose one edit to CLAUDE.md. Then launch a reviewer subagent without this context: have it reject edits that just repeat what's already written or won't change behavior. Re-verify the accepted edits by re-running the same tasks.

This extrapolation is mine; the paper optimizes skills, not CLAUDE.md.

09

Resources

  • Skill∞: Recursive Self-Improvement for Agent Skill Optimization
  • Authors: Wangcheng Tao, Zhanglu Yan, Weng-Fai Wong (National University of Singapore), Han Wu (City University of Hong Kong)
  • Code (promised by the authors): https://github.com/taowangcheng/Skill-Infinity
  • Related work cited in the paper: SkillsBench (Li et al., 2026), SkillEvolver (Zhang et al., 2026), MetaSkill-Evolve (Wang et al., 2026), KernelBench (Ouyang et al., 2025), the Agent Skills specification (Anthropic, 2025)

Research digest

Key result

A skill the agent writes for itself doesn't help: 42.9% success versus 45.5% with no skill at all. The Skill∞ method lets you automatically refine SKILL.md (folders of instructions for Claude Code, Codex and OpenCode). The result: 60.7% success versus 56.4% for human-written skills. The trick: an edit is accepted only if a run showed improvement on the exact error it was meant to fix. A separate meta-agent reads the run logs, finds the action that caused the failure, and sends each edit to an independent reviewer for verification.

Principle

The whole method is baked into a single meta-skill (also a `SKILL.md`). It runs a six-step loop: 1. Reviews the archive: what's already been tried. 2. Runs the current skill and analyzes the failure logs. 3. Makes 1–2 candidates, each with a rationale. 4. Runs the candidates on the tasks. 5. Hands each one to a reviewer in a clean context. 6. Decides: move forward, roll back, or stop. The success check sits out of the agent's reach: it can't tweak the criteria to look better. It's like an exam where the kid who wrote the cheat sheet doesn't get to grade himself. A script assigns the score, and a third party checks whether the edit is honest. There's also an outer loop. The same cycle is applied to the meta-skill itself on tasks from different domains. The result is a polished meta-skill for any new skills.

Why it works

Ask it to "improve the instructions" and the agent will rewrite them to sound nicer. They won't actually get better. Edit authors love their own edits, which is why homemade skills are no better than no skill at all. A numeric score tells you whether things got better, but not why. The model is good at reading run logs. It finds causes like "at step 3 the agent skipped the check." A fresh instance without someone else's reasoning critiques more honestly. The search runs on reasoning about errors, not blind trial-and-error on scores. Ties aren't thrown out either: if a candidate made progress on the target error, it stays. The reviewer filters out hollow edits, so noise isn't mistaken for progress. Recursion adds one more effect. The meta-skill, improved by itself, wrote a stricter standard of evidence into itself: confirm an edit only with a run. Even the off-the-shelf meta-skill without self-improvement gets 55.9%. That beats most automated methods.

When to apply

Building skills and instructions for agents → specifically for tasks with a verifiable result (a test, a reconciliation, a script that answers "pass / fail"), especially when the agent keeps making the same mistake. The method performed best in software engineering, media and math. NOT a fit for subjective tasks like "write something beautiful": there's no reliable signal. Weaker than humans in cybersecurity, natural sciences and finance (in finance, 26.7% versus 37.8%). You can't reproduce the method in a regular chat: it needs real agent runs, which means tokens and time.

Mini recipe

1. Collect tasks with reference answers: 5–10 real examples where the correct answer is known. 2. Write a check: a script or test that returns 0 or 1. The agent is forbidden to modify or bypass it. 3. Set a budget: for example, 4 candidates total. A simple skill needs fewer. 4. Create the meta-skill: paste the template below into `.claude/skills/skill-optimizer/SKILL.md`. Or ask the model to adapt it to your tool. 5. Run the optimization: specify the target skill, tasks, check, budget and archive path. 6. Review the report: what was fixed, what the runs confirmed, what the reviewer rejected. 7. Don't forget the description: let the agent edit the skill's `description` too. The agent sees only the name and description and uses them to decide whether to load the skill. Meta-skill template (a reconstruction from the algorithm description; the verbatim original isn't in the analyzed text): ``` --- name: skill-optimizer description: Use when you need to improve an existing skill based on task runs: diagnosing failures from logs, edits, independent review. --- You are a meta-agent. You optimize the skill {skill_path}. You do not solve tasks yourself. You improve the instructions another agent uses to solve them. Tasks: {task_folder_or_list} Success check: {check_command} (run only, do NOT modify or bypass) Budget: {max_candidates} candidates total Archive: {archive_path} Repeat until you decide to stop or the budget runs out: 1. INSPECT: read the archive. Which versions existed, what changed, how they scored, what the reviewer rejected. 2. DIAGNOSE: run the current version on the tasks. Analyze the failure logs. For each failure, name the specific agent action that caused the error. 3. CREATE: create k candidates (1 or 2, no more than the remaining budget). For each, write a proposal: which error we're fixing, what behavior should change, and why. Reduce the remaining budget by k. 4. EVALUATE: run the candidates on the same tasks. Record the scores in the archive. 5. REVIEW: hand each candidate to an independent reviewer (a separate subagent without your reasoning). Give it only the parent, the candidate, the proposal and the run data. The reviewer rejects a candidate if: there are no substantive changes; the skill was never loaded by the agent; the skill is unusable as written. 6. DECIDE: decide whether to continue, and pick a new parent from the archive. - Don't discard a candidate with the same score but real progress on the target error. - If the gain can't be tied to the edit, keep the parent. - If a line of edits has stalled, roll back to an earlier version. - If the diagnosis leaves almost nothing to improve, stop. - Accept an edit only if a run shows improvement on the target error, not just because the skill text mentions the problem. - Improve the skill's description too. - Do not change the success check. Do not tailor the skill to specific tests. - Do not skip the REVIEW step. The final skill at {result_path} and a short report: what was fixed, what was confirmed, what was rejected. ```

Examples

[BAD]: `Rewrite my amazon-reconciliation skill so it's clearer and works better` [GOOD]: `Use the "skill-optimizer" skill (in .claude/skills/skill-optimizer/SKILL.md). Optimization target: the skill .claude/skills/amazon-reconciliation/SKILL.md. Tasks: 6 folders /tests/week_01 ... /tests/week_06 (each containing the exports and an expected.json file with the correct totals). Success check: python /tests/check.py , returns 0 or 1. Do not edit it or work around it. Budget: at most 4 candidates total. Keep the archive in /tmp/optimizer/archive.md.` What you get: a failure table across the six weeks. For each failure the agent names the action that caused the error. For example: "used the 'Gross Proceeds' column instead of 'Net Disbursement'." Then it proposes 1–2 edits. An independent reviewer rejects any edit that just rewords the text without changing behavior. At the end you get an improved `SKILL.md` and a report: what was fixed, what the runs confirmed, what was rejected.

In plain words

Ask a model to just "make the instructions better" and it'll pour in fluff, sprinkle in some polite wording and call it a day. What you actually get is total garbage, because a model always grades its own work on a generous curve. The Skill$^{\infty}$ method fixes this at the root: a separate meta-agent analyzes not some abstract text but the actual error log, finds the exact cause of the failure and surgically rewrites the skill's system file, SKILL.md.

It's like letting a student grade their own final exam — they'll always ace it with zero knowledge. The researchers swapped self-admiration for an independent auditor with a dashcam. The meta-agent watches the crash footage (the execution log), sees exactly which turn the agent got wrong, and rolls out a dry, no-nonsense fix: at this step, do it this way, not that way.

The whole scheme rests on three rock-solid rules: analyzing failure logs, a strict cap of 1–2 edits per round, and mandatory independent verification of every change through tests. The real trick is recursive self-improvement: the meta-agent optimizes not only the skills of the bots it supervises but also its own meta-skill, methodically scrubbing bugs out of its own workflow logic.

The mechanics were tested in environments like Claude Code and Codex, but the principle is universal for any task with a verifiable result: writing scripts, API calls, parsing or checking against checklists. Trying to bolt this onto subjective matters of taste like writing social posts is pointless: without a hard benchmark the system can't tell whether things got better or worse, and it quickly slides into hallucinations.

Bottom line: stop polishing prompts by hand and taking the agent's word when it claims it has "fixed everything". Pack your logic into SKILL.md, unleash the meta-instruction on it, and close the feedback loop with automated tests. Whoever hands agent tuning over to algorithms built on verifiable logs can forget about manual debugging and build a truly autonomous system.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on Skill∞: Recursive Optimization of Agent Skills via a Meta-Skill arXiv:2610.35434

Sign in to apply this study New accounts get 50 free credits.