Editor’s introduction
The study focuses on coding agents that solve software engineering tasks and generate detailed experience trajectories. Researchers evaluated CODESKILL, a framework that learns to extract multi-granularity procedural skills from these trajectories and evolves them through reinforcement learning. The system uses a hybrid reward signal combining skill quality assessments from rubrics and verifiable execution outcomes from a fixed downstream agent. Results show CODESKILL outperforms baseline methods—both without skills and those relying on fixed prompts or memory—on EnvBench, SWE-Bench Verified, and Terminal-Bench 2. The evidence demonstrates a measurable improvement in average pass rates, with gains of 11.03 percentage points over no-skill baselines and 5.10 over prompt-based or memory-based approaches. Findings indicate that learned skill management enhances agent performance, but the scope of this benefit remains confined to the specific benchmarks used in the evaluation.
Introduction
Large language model (LLM) agents have shown strong capabilities in complex interactive tasks, such as coding agents that resolve realistic software issues. These long-horizon interactions produce rich trajectories with reusable experience beyond individual tasks. To reuse such experience, recent agent systems explore memory mechanisms that store prior episodes, retrieve relevant cases, or summarize past trajectories. Beyond raw episodic memory, higher-level procedural knowledge such as skills provides a more compact and reusable way to specify when a recurring situation arises and what actions should be taken. Skill-based agents and skill libraries have been shown effective in long-horizon and tool-use settings, making skills an important form of reusable agent knowledge for improving future behavior.
Inspired by the effectiveness of skills, recent work has begun to automate the distillation of skills and other reusable knowledge from past trajectories to support self-evolving agents. Across general agents and coding agents, these methods use LLMs to analyze prior successes and failures, extract reusable lessons, workflows, or reasoning patterns, and update memory over time for future task solving.
Despite this progress, existing approaches still rely heavily on fixed prompts and heuristic criteria, which predefine what to extract and how to update memory rather than adapting these decisions to the downstream agent. This limitation is especially salient for software-engineering (SWE) agents, where long-horizon, tool-driven trajectories contain dense and heterogeneous feedback, making it difficult to distinguish reusable procedural knowledge from task-specific or accidental details. As a result, it remains unclear what evidence should be extracted, how abstract a skill should be, and how the skill bank should be revised so that the resulting skills are both reusable across tasks and actionable for concrete agent decisions.
Self-evolving Long-term Memory
Long-term memory enables LLM agents to retain experience beyond a single interaction and improve over time. Early memory-augmented agents store reflections, past experiences, or persistent user information for later retrieval. Recent self-evolving agents further learn utility estimates for episodic memories, distill trajectories into reusable principles, or construct reasoning and workflow memories from successes and failures. Procedural memory summarizes agent behaviors into reusable action knowledge. Beyond general agent settings, several works augment software-engineering agents with memories distilled from past repair trajectories or shared across agent frameworks. Another line studies how coding agents can retrieve and reuse related issue contexts or subtask-level histories. These works show that coding agents can benefit from past experience, but they mainly retrieve or summarize prior cases. CODESKILL instead learns to extract, evolve, and maintain procedural memories using downstream feedback.
Agent Skills & Automatic Skill Management
Agent skills have emerged as a procedural form of memory that augments agents with reusable workflows, instructions, scripts, or tool-use knowledge. Unlike episodic memories that mainly recall past interactions, skills are designed to provide actionable guidance when similar situations arise. Recent work has therefore studied automatic skill construction from trajectories and interaction histories, where agents distill reusable lessons, workflows, or failure patterns into skill banks that can be reused and updated over time. Several methods further combine skills with reinforcement learning or agent self-improvement loops. These works typically improve the task-solving policy with skills, train agents to use skill libraries, or co-evolve skills with the solver. In contrast, CODESKILL focuses on skill management itself, learning how to generate and maintain skills that are adapted to a frozen downstream coding agent. Recent studies on software-engineering skills also show that static skill injection does not always improve coding agents, and that skill usefulness depends strongly on task fit and context. This further motivates adaptive skill management rather than relying on a fixed skill management strategy.
Skill Bank Construction
For skill extraction, the input is trajectory evidence ranging from a single trajectory to a small set of related trajectories, and the output is either a new task-level skill, a new event-driven skill, or skip when the evidence does not support reusable knowledge. Task-level extraction abstracts high-level procedures from related task trajectories, while event-driven extraction captures local execution patterns from a specific trajectory. For skill evolution, the input is an existing skill together with new or failed trajectory evidence, and the output is a revised candidate skill or skip. This operation updates the applicability condition or procedural guidance of a skill when new evidence reveals missing cases, more effective procedures, or failure modes.
Skill Usage
For downstream task solving, relevant skills are retrieved from the updated skill bank and inserted into the prompt of the frozen coding policy as prior knowledge. Retrieval is based on dense semantic similarity, matching task-level skills to the task goal and event-driven skills to the agent’s current reasoning and observation through their trigger conditions. The original task prompt and policy parameters remain unchanged.
Attribution-Aware Hybrid Reward Design
This attribution-aware design combines dense quality supervision with baseline-relative execution feedback, gated by behavioral evidence of skill use. It provides a practical proxy for skill-level credit assignment by discounting execution feedback when the rollout does not reflect the skill’s trigger conditions or prescribed behavior.
Benchmarks
We evaluate CODESKILL on three software-engineering benchmarks. EnvBench tests environment setup and dependency repair, SWE-Bench Verified tests repository-level issue resolution, and Terminal-Bench 2 tests terminal-based problem solving. Since EnvBench and SWE-Bench Verified are also used for training, we use disjoint held-out splits for evaluation. For SWE-Bench Verified, we randomly sample 150 of the 500 Verified instances for evaluation and use the remaining 350 for RL training. For EnvBench, we sample 150 of 994 repositories for evaluation, covering 107 JVM and 43 Python repositories, and split the remaining 844 repositories evenly for SFT trajectory collection and RL training. Terminal-Bench 2 is not used during training, and serves as an out-of-distribution benchmark for testing whether the learned skill-management policy generalizes to new coding-agent tasks. We use mini-SWE-agent for SWE-Bench Verified and Terminal-Bench 2, and a ReAct-style agent for EnvBench. Although the benchmarks and agent wrappers differ, all agents interact with the environment through bash-command-based actions. We therefore normalize their trajectories into the same reasoning-action-observation format, allowing a single CODESKILL model to manage skills across different SWE tasks. We report task pass rate on all benchmarks. For EnvBench, we also report average issue count, and for all benchmarks we report the average number of reasoning steps on the common subset of instances solved by all compared methods within each benchmark and downstream-policy setting.
Baselines
We compare CODESKILL with representative memory and skill-management baselines. First, we evaluate prompt-based skill-management pipelines that use the same operation space as CODESKILL but replace the learned policy with fixed prompts and heuristic decisions. This baseline follows the common design of prior automatic skill-bank management methods, such as SkillRL and AutoSkill, while keeping the downstream coding policy frozen. We also compare with reasoning-oriented subtask-level memory, a strong coding-agent memory baseline that decomposes long software-engineering trajectories into subtasks and distills reusable memories from the resulting sub-trajectories.
Test-Time Skill Bank Construction
We construct the skill bank through two preparatory passes over the test set before final evaluation. In the first pass, CODESKILL extracts skills from no-skill rollout trajectories. In the second pass, it evolves skills using trajectories from skill-conditioned rollouts. Every extracted or evolved candidate undergoes maintenance through add, merge, or drop decisions. Together, these passes simulate a skill lifecycle of experience accumulation and refinement across tasks. We track the source instances of each skill, preserving their provenance through evolution and merging. During final evaluation, we exclude any skill whose provenance includes the current test instance to prevent access to knowledge derived from that instance. Task-level and event-driven skills are retrieved using task goals and local execution signals, respectively. Detailed retrieval procedures are provided in Appendix C.
Comparison with Baselines
We first compare CODESKILL with baselines under Qwen3.5-35B-A3B as the downstream coding policy. Compared with the no-skill baseline, CODESKILL improves average pass rate from 29.32 to 40.35, showing the benefit of managed procedural skills for downstream coding agents. Prompt-based skill management with the small Qwen3.5-4B backbone brings little improvement over no-skill, indicating that a weak model is insufficient for the same skill-management pipeline. Stronger baselines are more effective, with subtask-level memory and GPT-5.4-mini prompt-based skill management improving over no-skill by 4.16 and 5.93 average pass rate, respectively. However, they still underperform CODESKILL by 6.87 and 5.10. SFT-CODESKILL improves average pass rate over no-skill, but remains weaker than prompt-based management with a stronger closed-source model. After RL training, CODESKILL achieves the best pass rate on all benchmark groups, improving over the strongest baseline by 14.5% relative gain on average. Overall, the results suggest that downstream-feedback optimization learns a skill-management policy better suited to the frozen coding agent than fixed-prompt skill distillation methods.
Efficiency
We also compare the average number of reasoning steps on the common subset of instances successfully solved by all compared methods, ensuring that all averages are computed over the same tasks. Skill-based methods generally reduce the reasoning cost compared with the no-skill baseline, suggesting that retrieved procedural guidance can help the coding agent reach successful solutions more directly. Under the Qwen3.5-35B-A3B policy, CODESKILL achieves the lowest average reasoning steps, reducing the average from 44.12 for no-skill to 35.99. This indicates that learned skill management improves not only task success but also the efficiency of successful problem solving.
Generalization across Tasks
We first examine whether CODESKILL generalizes beyond the task distributions used for training. CODESKILL is trained with trajectories from EnvBench and SWE-Bench Verified, while Terminal-Bench 2 is held out and used only for evaluation. Although Terminal-Bench 2 shares the same bash-command interaction interface, it contains different terminal-based problem-solving tasks and therefore tests out-of-distribution generalization within software engineering. Under the Qwen3.5-35B-A3B coding policy, CODESKILL improves Terminal-Bench 2 pass rate from 25.88 to 36.47 over no-skill, and also outperforms the strongest baseline on this benchmark, subtask-level memory with GPT-5.4-mini, by 5.88 pass rate. In contrast, SFT-CODESKILL does not improve over no-skill on Terminal-Bench 2. This suggests that supervised warmup alone may not generalize reliably to unseen SWE task types, while RL with downstream feedback helps CODESKILL learn more transferable skill-management behavior.
Conclusion
We presented CODESKILL, an LLM-based framework that learns to extract, evolve, and maintain reusable skills from coding-agent trajectories. CODESKILL formulates skill management as a learnable policy and optimizes it with verifiable downstream feedback and rubric-based skill-quality judgments by reinforcement learning. Experiments on EnvBench, SWE-Bench Verified, and Terminal-Bench 2 show that learned skill management improves over no-skill execution, prompt-based skill management, and memory-based baselines. These results highlight learned procedural-memory management as a promising direction for coding agents that accumulate and reuse long-horizon software-engineering experience. These gains are achieved without updating the downstream coding policy, emphasizing the value of learning how experience is organized and reused. Future work could extend this framework to strictly streaming task settings and evaluate the end-to-end cost of skill acquisition, maintenance, and use.
Trajectory Sources
We construct SFT data from coding-agent trajectories collected across software-engineering tasks. The initial SWE-style trajectory pool is downloaded from publicly available mini-SWE-agent rollouts on SWE-smith, where Qwen3-30B is used as the coding agent. We additionally collect EnvBench trajectories using a ReAct-style agent. Since different sources use different logging formats, we normalize all trajectories into a unified representation containing task context, interleaved reasoning/action/observation steps, and final outcome information.
Teacher Data Construction
We use teacher models to generate supervised targets for the skill-management action space. For task-level and event-driven extraction, the teacher reads normalized trajectory evidence and outputs either a reusable skill or a skip decision. For skill evolution, we synthesize training instances by retrieving an existing skill whose applicability condition or rules match a new trajectory, especially a failed or partially successful one. The paired trajectory is selected to expose missing conditions, better procedures, or failure modes not fully covered by the existing skill, and the teacher is asked to revise the skill or skip when no meaningful update is supported. This avoids collecting an additional round of skill-conditioned rollouts. For skill-bank maintenance, each candidate skill is paired with retrieved similar skills from the bank, and the teacher outputs add, merge, or drop.
-stage RL Training
Since CODESKILL learns multiple operation types and verifiable task feedback is sparse, we use a three-stage curriculum that follows the lifecycle of skill management and enables data reuse across stages. Phase 1 focuses on skill extraction from trajectory evidence. During this stage, generated skills are injected into the frozen coding policy to compute execution rewards, and the resulting skill-conditioned trajectories provide evidence for constructing phase-2 evolution prompts. Phase 2 trains extraction and evolution together, allowing CODESKILL to revise existing skills with new trajectory evidence. Skills produced by the first two stages are then reused as candidate skills and bank entries for phase-3 maintenance prompts. Phase 3 contains the full action space, including extraction, evolution, and maintenance.
Skill Retrieval
The frozen downstream coding policy solves each task with retrieved skills injected as prior knowledge. We build separate retrieval indexes for task-level and event-driven skills, so that the two granularities are matched with different query signals. For each skill, the retrieval document is constructed from its title, when_to_apply, and rules. We encode retrieval documents with sentence-transformers/all-MiniLM-L6-v2 and build dense indexes separately for each benchmark and skill type. Retrieval is scoped to the same benchmark and same granularity, and skills generated from the same evaluation instance are filtered out to avoid same-instance leakage.
For task-level skills, the query is constructed from the task goal, problem statement, and available repository or benchmark context. Task-level skills are retrieved once before task solving and appended to the initial downstream policy user prompt as prior knowledge. For event-driven skills, the query is constructed online from local execution signals, including the current task context, recent reasoning, executed actions, observations, error messages, command outputs, and test-output snippets when available. Each instance is solved with retrieved skills through skill-conditioned generation, and every resulting skill-conditioned trajectory is prompted to CODESKILL as evidence for skill evolution. Each newly extracted or evolved skill is then passed to the maintenance stage, where it may be added, merged, or dropped to update the current skill bank.
Baselines
We compare CODESKILL with no-skill execution, prompt-based skill management, and subtask-level memory. The no-skill baseline uses the same frozen downstream coding policy without any prior-knowledge section. The prompt-based skill-management baseline is designed as an adaptation of recent automatic skill-bank methods to software-engineering tasks. Many such methods follow an extraction, evolution, and maintenance pipeline, or use a subset of these operations, but do not provide a software-engineering implementation. We therefore keep the same pipeline, action space, prompts, retrieval procedure, downstream policy, and decoding settings as CODESKILL, while replacing the learned skill-management policy with fixed prompt-based decisions.
We also compare with a subtask-level memory baseline. This baseline is relevant to software-engineering tasks because long-horizon coding trajectories naturally decompose into smaller reasoning and action segments, and prior work has shown strong performance for reasoning-oriented memory in SWE settings. Since the original implementation is not publicly available, we implement a high-level reproduction. We segment each trajectory into subtasks using rule-based patterns based on agent action types and execution boundaries. Each sub-trajectory is then summarized into a memory item using a reasoning-oriented prompt, and relevant memory items are retrieved and injected into the downstream policy prompt in the same format used by other baselines.


