arXiv(opens in a new tab)cs.SESep 2026Cited by 3 papers on PaperVantage

Manuscript Offprint

arXiv:2609.05571

Grounded Skill Synthesis from Code at Scale for Agentic Intelligence

Yongqi Tong, Pan Wang, Hang Wang, Jianshe Li, Xin Zhang, Jiang-Ming Yang, Wei Wu

Abstract

Reusable skills endow agentic systems with transferable procedural knowledge, making scalable skill acquisition essential for extending agents beyond their accumulated experience. Existing skill synthesis methods have two main limitations: trajectory-based skill synthesis inherently coupled to the environments, while document-sourced productions may lack evidence support and verifications. Source code offers a different pathway—it requires no previous experience while retaining executable evidence for grounding later abstractions. Hence, we present Code2Skill, a fully automated pipeline that lifts selected code units into implementation-anchored atomic-operation, composite-workflow, and recurring-pattern skill records, and verifies them through source-body-blind reconstruction followed by source-aware comparison. Applying Code2Skill to 19,769 popular and actively maintained GitHub repositories yields our CodeSkillBank, a grounded skill bank containing 1,006,822 accepted records with workflow, boundary, provenance, and source-evidence metadata. Across 72 protocol-matched evaluations spanning nine model settings and eight benchmarks, models augmented with retrieved CodeSkillBank skills achieve an average performance gain of 11.7% over their matched baselines, outperforming them in 57 cases. Under a unified downstream interface, Code2Skill also outperforms the compared trajectory-derived skill banks on all seven shared benchmarks, showing that repository-derived skills can provide effective procedural knowledge before agents accumulate sufficient experience through their own interactions. Moreover, extensive analysis further shows that skills synthesized from tested AI-generated code achieve a 93.50% pass rate, compared with 93.00% for those derived from human-written code, providing initial evidence that the same pipeline can continue to expand CodeSkillBank as AI-generated code becomes increasingly prevalent. Taken together, Code2Skill offers a new paradigm for reusing human procedural knowledge in agentic systems by transforming expertise embedded in software repositories into grounded, verifiable, and transferable skills.

Keywords: agentic AI, skill synthesis, code mining, procedural knowledge, reinforcement learning

1 Introduction

Large foundation models have endowed modern artificial intelligence (AI) systems with sophisticated reasoning capabilities. However, agentic AI must tackle complex, long-horizon tasks that extend beyond what is encoded in model parameters. Beyond generating content following user instructions and reasoning over internal knowledge, agents must interact with external environments, invoke tools appropriately [Yao et al., 2023b, Schick et al., 2023, Qin et al., 2024], learn from failures and feedback [Shinn et al., 2023, Madaan et al., 2023], plan over extended horizons [Yao et al., 2023a, Zhou et al., 2024], coordinate specialized agents [Bansal et al., 2024, Hong et al., 2024], access external memory [Park et al., 2023], and more. Consequently, a capable foundation model in an agentic system typically operates within a well-designed skill or harness, which encapsulates reusable procedural knowledge together with the conditions under which it applies, enabling an agent to retrieve and execute relevant procedures at inference time [Wang et al., 2024, Zhao et al., 2024, Wang et al., 2025, Ni et al., 2026, Liang et al., 2026].

In this work, we focus on skills as a fundamental component of the agent harness. A skill encapsulates reusable procedural knowledge together with the conditions under which it applies, enabling an agent to retrieve and execute relevant procedures at inference time [Wang et al., 2024, Zhao et al., 2024, Wang et al., 2025, Ni et al., 2026, Liang et al., 2026]. Because skills can be updated, versioned, and deployed independently at relatively low cost, they provide a practical, plug-and-play interface for incorporating domain-specific and continuously evolving knowledge into agentic systems. For general-purpose agents, scalable skill synthesis

∗^{*} Corresponding author

Grounded Skill Synthesis from Code at Scale for Agentic Intelligence

Figure

Figure 1: The pipeline of Code2Skill. Source units are ranked, converted into atomic, composite, or recurring-pattern skill records, checked through source-body-blind reconstruction and source-aware comparison, and retained with evidence for retrieval.

introduces a new scaling dimension beyond model parameters and inference-time computation, allowing the agent harness to continuously expand and evolve. For specialized agents, it provides a systematic pathway for transforming raw domain data into reusable, executable knowledge assets that bridge general-purpose foundation models and domain-specific expertise.

Existing skill synthesis methods, however, remain insufficient for this scaling objective, largely because of the substrates from which skills are derived. Trajectory-based methods synthesize skills from execution traces, distilling successful episodes, failures, recurring workarounds, and interaction histories into compact hints, reusable procedures, or standard operating workflows [Nekoei et al., 2025, Zhao et al., 2024, Wang et al., 2025, Qiu et al., 2026, Ni et al., 2026]. While supporting self-evolving agents, trajectory-derived skills remain coupled to the model, task distribution, tools, and harness that produced them. Their quality is bounded by the generating agent's competence and experience, and changes to these components can render previously distilled skills outdated or incompatible. Document-based methods, in contrast, synthesize skills from static, human-readable text [Liang et al., 2026, Zhou et al., 2026]. They avoid dependence on agent-generated trajectories, but lack concrete executions against which the synthesized skills can be grounded and verified. These limitations motivate a complementary synthesis paradigm that can scale to large existing data corpora while grounding synthesized skills in concrete, executable implementations.

To this end, we propose skill synthesis from large-scale codebases, using source code as a natural substrate for grounding. By design, code supports execution, evaluation, verification, maintenance, and versioning—properties that closely match the operational requirements of reusable skills. Platforms such as GitHub have accumulated vast collections of actively maintained repositories containing procedures that have been implemented, debugged, and repeatedly

refined. These implementations provide concrete operational evidence for abstracting and verifying reusable procedures [Feng et al., 2020, Wang et al., 2021, Guo et al., 2021]. Transforming this knowledge into reusable skills makes it directly actionable for agentic systems.

Automatic distillation from codebases, however, is non-trivial. Real-world code interleaves generalizable procedures with framework-specific glue, project-local identifiers, duplicated implementations, implicit dependencies, and unresolved edge cases. Rather than only describing what an implementation does, a golden skill must capture when the procedure applies, which steps are essential, what invariants must hold, which failures alter the execution path, and which generalizations fall outside its scope [Ye et al., 2024]. The central challenge, therefore, is to abstract beyond a specific implementation while preserving sufficient implementation evidence to ground and verify the resulting skill.

To address these challenges, we introduce Code2Skill, a fully automated pipeline for synthesizing skills from source code at repository scale. We first ranks source units by their reusable procedural content, then abstracts selected implementations into atomic-operation, composite-workflow, or recurring-pattern records that capture applicability, execution steps, invariants, failure cases, anti-goals, and supporting evidence. To verify grounding, a large language model (LLM) reconstructs the implementation using only the synthesized skill, while a source-aware judge compares the reconstruction against the original code and filters out unsupported or incomplete records for adjudication or rejection. Accepted records are organized into a provenance-rich evidence archive, with feature-tagged and purpose-indexed views for efficient retrieval. Applying Code2Skill to 19,769 curated GitHub repositories yields CodeSkillBank, a large-scale skill base containing 1,006,822 accepted records.

Across benchmarks covering software engineering, mathematical and scientific reasoning, and system interaction, CodeSkillBank improves the macro-average score from

Grounded Skill Synthesis from Code at Scale for Agentic Intelligence

42.90 without skills to 47.90 with skills, achieving an 11.7% relative gain and improving on 57 of 72 evaluation runs. On SWE-bench Verified, all nine comparisons show consistent improvements. Under a unified downstream interface, Code2Skill outperforms each of Trace2Skill, ExpeL, and SkillRL-Bank [Ni et al., 2026, Zhao et al., 2024, Xia et al., 2026] on all seven benchmarks. Averaged across the benchmarks, Code2Skill scores 49.5 (31.0 for Trace2Skill, 27.9 for ExpeL, and 32.8 for SkillRL-Bank). On individual benchmarks, Code2Skill exceeds the strongest trajectory-derived baseline by 6.6–13.3 points. These results demonstrate repository-derived skills can provide effective procedural knowledge before an agent accumulates sufficient experience through its own interactions.

Our experiments also show that CodeSkillBank remains effective across both inference and training settings. Skills provide the greatest benefits when used to guide planning or critique concrete candidate solutions, while compact summaries retain much of their utility with substantially lower context overhead. Moreover, we empirically skills synthesized from tested AI-generated implementations perform comparably to those derived from human-written code, suggesting the same automated pipeline can continue expanding the skill bank as AI coding becomes increasingly prevalent.

Taken together, this work introduces grounded skill synthesis as a problem formulation, Code2Skill as an automated pipeline, and CodeSkillBank as a scalable procedural resource, supported by extensive experiments across models, tasks, and agentic workflows. More broadly, it offers a new, complementary scaling paradigm for agent capabilities: continually converting the growing supply of tested human-and AI-written implementations into reusable procedural knowledge for future inference and training.