SkillZip: Contract-Preserving Graph Compression for Scalable Agent Skill Libraries

arXiv cs.CL Papers

Summary

This paper introduces SkillZip, a contract-preserving graph compression framework that compresses agent skill libraries at the section level, improving retrieval and compression efficiency while preserving procedural contracts and dependency closures.

arXiv:2608.05604v1 Announce Type: new Abstract: Large Language Models (LLMs) increasingly act as agents whose procedural knowledge is stored in reusable skill packages and loaded at inference time. As skill libraries grow, a central challenge is to expose the smallest sufficient executable context under a limited context budget. Existing systems struggle to reuse routines below the whole-skill level, preserve procedural contracts during compression, keep compressed routines executable and expandable, and update the compressed library as skills evolve. These challenges reveal a unit mismatch: skills are retrieved as packages, compressed as text, and converted into execution graphs only after retrieval, whereas reliable reuse requires a contract-bearing procedural unit. We propose SkillZip, an execution-aware procedural abstraction framework that performs contract-preserving compression over section-level graphs. SkillZip rewrites recurring contract-valid motifs into reversible ported macros while preserving boundary signatures, dependency closure, verifier reachability, and source-level expansion. At inference time, it hydrates a compact, dependency-closed context and expands macros only when required. ReZip further integrates new skills and revises risky macros using execution evidence. Comprehensive experiments1 on technical and embodied agent benchmarks show SkillZip consistently outperforms the strongest baseline by up to 12.2 points, while achieving a 3.46x compression ratio with 99.2% dependency preservation and 98.7% verifier reachability. Scaling analyses further confirm robust retrieval across skill libraries ranging from 200 to 100K skills.
Original Article
View Cached Full Text

Cached at: 08/07/26, 07:51 AM

# Contract-Preserving Graph Compression for Scalable Agent Skill Libraries
Source: [https://arxiv.org/html/2608.05604](https://arxiv.org/html/2608.05604)
###### Abstract\.

Large Language Models \(LLMs\) increasingly act as agents whose procedural knowledge is stored in reusable skill packages and loaded at inference time\. As skill libraries grow, a central challenge is to expose the smallest sufficient executable context under a limited context budget\. Existing systems struggle to reuse routines below the whole\-skill level, preserve procedural contracts during compression, keep compressed routines executable and expandable, and update the compressed library as skills evolve\. These challenges reveal a unit mismatch: skills are retrieved as packages, compressed as text, and converted into execution graphs only after retrieval, whereas reliable reuse requires a contract\-bearing procedural unit\. We proposeSkillZip, an execution\-aware procedural abstraction framework that performs contract\-preserving compression over section\-level graphs\. SkillZip rewrites recurring contract\-valid motifs into reversible ported macros while preserving boundary signatures, dependency closure, verifier reachability, and source\-level expansion\. At inference time, it hydrates a compact, dependency\-closed context and expands macros only when required\. ReZip further integrates new skills and revises risky macros using execution evidence\. Comprehensive experiments on technical and embodied agent benchmarks show SkillZip consistently outperforms the strongest baseline by up to 12\.2 points, while achieving a 3\.46×\\timescompression ratio with 99\.2% dependency preservation and 98\.7% verifier reachability\. Scaling analyses further confirm robust retrieval across skill libraries ranging from 200 to 100K skills\.

LLM Agents, Agent Skills, Procedural Memory, Graph Compression, Skill Retrieval

††copyright:none## 1\.Introduction

![Refer to caption](https://arxiv.org/html/2608.05604v1/x1.png)Figure 1\.Representative skill\-library workflows\.Large Language Models \(LLMs\) are increasingly used as agents that interact with tools and environments\(Yaoet al\.,[2022](https://arxiv.org/html/2608.05604#bib.bib34); Qinet al\.,[2024](https://arxiv.org/html/2608.05604#bib.bib37)\)\. In these settings, task success often depends on procedural rather than factual knowledge, such as how to normalize a spreadsheet or verify that an artifact is correct\. Agent skills have therefore emerged as an external procedural memory layer for LLM agents\(Xu and Yan,[2026](https://arxiv.org/html/2608.05604#bib.bib4); Liet al\.,[2026b](https://arxiv.org/html/2608.05604#bib.bib3)\)\. A skill package stores instructions, supporting resources, and rules for execution and verification in an editable artifact loaded at inference time\(Xu and Yan,[2026](https://arxiv.org/html/2608.05604#bib.bib4)\), allowing procedures to change without retraining\. At inference time, a skill provider selects task\-relevant procedures from the library and exposes them to the agent\. As the library grows, the provider must distinguish among more overlapping packages while avoiding incomplete or redundant context\. This raises a central question\. How can a skill provider retrieve and expose the smallest sufficient executable context within a tight context budget?

Existing solutions retrieve each skill package as a whole\. However, a skill is not an atomic text unit, but a collection of functional sections such as intents, operations, verifiers, and outputs\. A system should therefore retrieve the smallest execution\-complete subset rather than read every relevant skill from beginning to end\. Together with their typed dependencies and verifier hooks, they define the skill’sprocedural contract: what the procedure exposes, how it executes, and how its effects are verified\. This issue becomes more pronounced when a task requires multiple skills, since their useful procedures may overlap\. For example, skills of*Clean CSV*and*Pivot Tables*may share schema inference, header normalization, and row\-count validation, while differing in their downstream operations and verifiers\. Instead of repeatedly loading each full package, the system should retrieve the shared contract\-compatible procedure once and add only the task\-specific sections\.

Challenges in existing methods\. Most existing skill\-library systems can be viewed as following a “retrieve\-compress\-execute” pipeline\. In this paradigm, an agent first retrieves relevant skill packages or metadata, optionally compresses the selected skill content to reduce prompt cost, and then builds a task\-time execution context or graph for the selected skills\. While this improves modularity and token efficiency, several challenges remain\.

Challenge 1: Reuse\-granularity mismatch\.Existing progressive\-disclosure and skill\-graph systems\(Xu and Yan,[2026](https://arxiv.org/html/2608.05604#bib.bib4); Liuet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib8); Zeng and others,[2026](https://arxiv.org/html/2608.05604#bib.bib10)\), as shown in Figure[1](https://arxiv.org/html/2608.05604#S1.F1)\(a\), use the whole skill as the retrieval unit\. They reduce the number of packages loaded, but cannot select only the relevant procedure within each package\. For example, a query to normalize headers and verify row counts matches both the*Clean CSV*and*Pivot Table*skills because they contain the same routine\. A skill\-level retriever therefore loads both packages, although the task needs only their shared sections\. Retrieving this routine at the section level instead avoids unrelated downstream operations, reducing both excess context and ambiguity between overlapping skills\. This ambiguity compounds as the library grows, because every overlapping package enters retrieval as another coarse candidate\.

Challenge 2: Contract preservation under compression\.Current skill\-compression methods\(Gaoet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib14); Xinget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib15); Wanget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib13)\), as shown in Figure[1](https://arxiv.org/html/2608.05604#S1.F1)\(b\), shorten skills by rewriting, debloating, or encoding their content into compact text or sequence representations\. These methods optimize the token budget directly, but their preserved structure is mainly textual or latent, rather than an explicit procedural contract\. For executable skills, textual closeness does not imply contract equivalence: a compressed skill can stay close to the original wording while obscuring a precondition, guard branch, or verifier hook\. For example, the two relevant skills above contain near\-identical loading routines that feed different verifiers; compressing them as similar spans can blur incompatible checks and make the resulting procedure unsafe to execute\.

Challenge 3: Persistent executable compression\.Some task\-time execution\-graph systems\(Baiet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib11); Liuet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib8); Liet al\.,[2026a](https://arxiv.org/html/2608.05604#bib.bib43)\), as shown in Figure[1](https://arxiv.org/html/2608.05604#S1.F1)\(c\), organize already selected skills into explicit procedural graphs and support verification or repair during execution\. However, these graphs are built after retrieval, over skills that have already been selected, so the library itself is not stored as a persistent compressed structure\. As a result, the recurring loading\-and\-validation routine is re\-discovered and re\-verified on every task that touches it, rather than compressed into the units later trusted by execution\.

Challenge 4: Execution\-aware maintenance\.Skill libraries are not static because new skills reveal recurring procedures, while execution traces reveal which abstractions are reliable or risky\(Mi and others,[2026](https://arxiv.org/html/2608.05604#bib.bib12); Ouyang and others,[2026](https://arxiv.org/html/2608.05604#bib.bib20)\)\. A one\-shot compressor can neither recognize a routine that becomes reusable only after later skills arrive nor revise a macro that repeatedly triggers expansion, verifier failure, or downstream repair\. For example, later spreadsheet skills may establish period alignment and balance checking as a reusable routine, whereas formula\-bearing tasks may expose a generic export macro that lacks a required verifier\. Compression should therefore be maintained as the library grows and as execution evidence accumulates\.

These challenges reveal a common unit mismatch\. Current skill provider systems retrieve whole skill packages, compress skill text, and build execution graphs only after retrieval, i\.e\., three decisions made over three different units\. For agent skills, they should target the same object: a contract\-bearing section subgraph whose procedural contract survives retrieval, compression, and execution alike\. We call a compressioncontract\-preservingif it shortens a routine while retaining the interface, execution, and verification aspects of this contract\. Source pointers are preserved separately so that the routine can be expanded back to its original sections when needed\.

Contribution\. In this paper, we introduceSkillZip, a contract\-preserving graph compression framework for scalable agent skill libraries as shown in Figure[1](https://arxiv.org/html/2608.05604#S1.F1)\(d\)\. SkillZip changes the basic representation unit from whole skill packages to source\-grounded, contract\-bearing section\-level unit connected by procedural dependencies\. Over this unified representation, SkillZip performsexecution\-aware procedural abstractionthrough contract\-preserving compression, i\.e\., recurring subgraphs are rewritten as reusable macros only when their procedural contracts remain explicit and recoverable\. The resulting graph provides a common basis for exposing reusable routines and hydrating task\-specific executable context\.

To address reuse\-granularity mismatch,SkillZip performs Sec2\-Graph, which opens each skill package into source\-grounded section nodes\. It represents functional sections with distinct execution roles \(e\.g\., intents, inputs, operations, verifiers, and output\) as reusable procedural units, making internal skill components visible without manually splitting the skill library\.

To preserve procedural contracts under compression,SkillZip introduces MotifZip, a contract\-preserving compressor that mines recurring section\-level motifs and promotes them into ported macro nodes only when their boundary signatures, dependency closure, verifier reachability, and source expansion are preserved\. Each macro is therefore a reversible rewrite instead of a lossy summary\.

To make compressed routines executable and expandable,SkillZip employs PathHydrate, which routes over the compressed graph at query time\. It constructs a compact dependency\-closed procedural subgraph, repairs missing execution roles when necessary, and renders each macro at the lowest sufficient level, including name, contract, outline, or full source\.

To maintain compression as the library evolves,SkillZip introduces ReZip, which incrementally updates the compressed graph as new skills and execution traces arrive\. It reuses existing macros for compatible regions, promotes recurring contract\-valid residuals into new macros, and uses execution evidence to increase hydration detail, split, or retire risky macros\. In summary, the advantages of SkillZip can be abbreviated as follows:

- •Section\-level procedural memory\.SkillZip organizes source\-grounded, contract\-bearing sections as reusable units of procedural memory and represents each skill as an executable graph over them\. This representation exposes internal reuse while retaining execution roles, dependencies, verifiers, and provenance\.
- •Contract\-preserving macro compression\.SkillZip replaces recurring procedural motifs with ported macro nodes while preserving boundary contracts, dependency closure, verifier reachability, and reversible source expansion\.
- •Budgeted executable context hydration\.SkillZip retrieves compact, dependency\-closed procedural subgraphs from the compressed library and progressively expands macros only when execution requires more detail\.
- •Execution\-aware incremental maintenance\.SkillZip incrementally updates its macro dictionary through new\-skill matching, residual motif promotion, and risky macro revision, keeping compressed procedures aligned with execution evidence\.
- •Effectiveness, efficiency, and scalability\.\(a\)SkillZip operates as a plug\-and\-play procedural\-memory layer across six LLM backbones on both technical and embodied benchmarks without backbone\-specific fine\-tuning\.\(b\)SkillZip achieves a 3\.46×\\timescompression ratio and a 71\.0% reduction in active storage while retaining 99\.2% dependency preservation and 98\.7% verifier reachability\. Its retrieval advantage remains as the library scales from 200 to 100K skills\.\(c\)SkillZip achieves the best end\-task performance in every directly comparable setting, outperforming the strongest baselineSkillDAGby up to 12\.2 points on ALFWorld\.

## 2\.Related Work

Agent skills and procedural memory\. Tool\-augmented agents combine LLM reasoning with external actions through prompting, learned tool invocation, and large API collections\(Yaoet al\.,[2022](https://arxiv.org/html/2608.05604#bib.bib34); Schicket al\.,[2023](https://arxiv.org/html/2608.05604#bib.bib35); Liet al\.,[2023](https://arxiv.org/html/2608.05604#bib.bib36); Qinet al\.,[2024](https://arxiv.org/html/2608.05604#bib.bib37)\)\. Beyond individual calls, reusable procedural knowledge allows agents to accumulate executable programs, distill feedback into experience, or retrieve workflows from prior trajectories\(Wanget al\.,[2023](https://arxiv.org/html/2608.05604#bib.bib39); Shinnet al\.,[2023](https://arxiv.org/html/2608.05604#bib.bib40); Zhaoet al\.,[2024](https://arxiv.org/html/2608.05604#bib.bib41); Wanget al\.,[2024](https://arxiv.org/html/2608.05604#bib.bib42)\)\. Agent Skills\(Xu and Yan,[2026](https://arxiv.org/html/2608.05604#bib.bib4)\)formalizes this idea as deployable packages containing instructions, scripts, references, and resources\. Recent studies organize the broader skill lifecycle through a unified taxonomy\(Zhou,[2026](https://arxiv.org/html/2608.05604#bib.bib59)\), characterize redundancy and safety properties in real\-world skill ecosystems\(Linget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib60)\), and acquire reusable skills from web interaction or heterogeneous scientific resources\(Zhenget al\.,[2025](https://arxiv.org/html/2608.05604#bib.bib58); Shenet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib56)\)\. Systems and benchmarks further study skill creation, management, retrieval, generation, and compatibility at scale\(Liet al\.,[2026a](https://arxiv.org/html/2608.05604#bib.bib43); Lianget al\.,[2026b](https://arxiv.org/html/2608.05604#bib.bib44); Liet al\.,[2026b](https://arxiv.org/html/2608.05604#bib.bib3); Choet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib5); Suet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib6); Zhou and others,[2026a](https://arxiv.org/html/2608.05604#bib.bib7); Hanet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib45)\)\. Together, these studies establish skills as durable procedural memory, but they typically reuse whole skill packages and leave recurring internal procedures across skills under\-modeled\.

Skill retrieval and execution\. A major challenge in large skill libraries is retrieving useful skills while keeping the execution context coherent\. Prior work addresses this problem by progressively loading skill metadata before full bodies\(Xu and Yan,[2026](https://arxiv.org/html/2608.05604#bib.bib4)\), organizing skills through dependencies, groups, conflicts, or specializations\(Liuet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib8); Zeng and others,[2026](https://arxiv.org/html/2608.05604#bib.bib10); Baiet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib11)\), and adapting retrieval across different levels of skill granularity\(Menget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib16); Miaoet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib17)\)\. Other systems construct execution graphs after skill selection\(Xiaet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib9); Liet al\.,[2026a](https://arxiv.org/html/2608.05604#bib.bib43)\)\. SkillGraph\(Liet al\.,[2026c](https://arxiv.org/html/2608.05604#bib.bib57)\)retrieves ordered subgraphs from an evolving skill\-level dependency graph, while SkillOps\(Puet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib55)\)combines typed skill contracts with an ecosystem graph for library diagnosis and maintenance\. Related graph\-based retrieval and routing methods use topology to preserve multi\-step context\(Xiang and others,[2026](https://arxiv.org/html/2608.05604#bib.bib23); Fenget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib22); Wuet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib24)\)\. These methods improve which skills are selected and how selected skills are coordinated\. However, their main focus remains skill\-level retrieval or task\-time orchestration\.

Skill and graph compression\. Prompt and skill compression methods shorten contexts through token selection, rewriting, or compact representations\(Jianget al\.,[2023](https://arxiv.org/html/2608.05604#bib.bib25),[2024](https://arxiv.org/html/2608.05604#bib.bib26); Pan and others,[2024](https://arxiv.org/html/2608.05604#bib.bib27); Gaoet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib14); Xinget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib15); Wanget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib13)\)\. Procedural\-memory methods further abstract successful experience into reusable skills, rules, or memories\(Zhanget al\.,[2026b](https://arxiv.org/html/2608.05604#bib.bib21); Mi and others,[2026](https://arxiv.org/html/2608.05604#bib.bib12); Ouyang and others,[2026](https://arxiv.org/html/2608.05604#bib.bib20); Zhou and others,[2026b](https://arxiv.org/html/2608.05604#bib.bib18); Zhanget al\.,[2026a](https://arxiv.org/html/2608.05604#bib.bib19); Belikovaet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib46)\)\. In parallel, graph mining and summarization provide tools for discovering and compressing repeated structure, including frequent\-subgraph mining, MDL\-based summaries, grammar\-based replacement, and incremental maintenance\(Cook and Holder,[1994](https://arxiv.org/html/2608.05604#bib.bib49); Yan and Han,[2002](https://arxiv.org/html/2608.05604#bib.bib29); Nijssen and Kok,[2004](https://arxiv.org/html/2608.05604#bib.bib50); Tianet al\.,[2008](https://arxiv.org/html/2608.05604#bib.bib51); LeFevre and Terzi,[2010](https://arxiv.org/html/2608.05604#bib.bib32); Koutraet al\.,[2014](https://arxiv.org/html/2608.05604#bib.bib28); Shinet al\.,[2019](https://arxiv.org/html/2608.05604#bib.bib52); Leeet al\.,[2020](https://arxiv.org/html/2608.05604#bib.bib53),[2022](https://arxiv.org/html/2608.05604#bib.bib54); Maneth and Peternek,[2018](https://arxiv.org/html/2608.05604#bib.bib30); Koet al\.,[2020](https://arxiv.org/html/2608.05604#bib.bib31)\)\. These techniques provide useful foundations, but agent skill libraries require compression that preserves execution interfaces, dependency closure, verifier reachability, and source provenance\.

More detailed related work is discussed in Appendix[E](https://arxiv.org/html/2608.05604#A5)\.

## 3\.Preliminaries

Consider an agent skill library𝒮=\{s1,…,sn\}\\mathcal\{S\}=\\\{s\_\{1\},\\ldots,s\_\{n\}\\\}\. Each packages∈𝒮s\\in\\mathcal\{S\}contains procedural artifacts such as instructions, scripts, tests, and resources\. A conventional retriever maps a queryqqto packagesR​\(q\)⊆𝒮R\(q\)\\subseteq\\mathcal\{S\}\. We retain these packages as source provenance but model the library at a finer procedural granularity\.

![Refer to caption](https://arxiv.org/html/2608.05604v1/x2.png)Figure 2\.Overview of the SkillZip framework\. Sec2Graph retains occurrence\-specific sections and links compatible ones through canonical prototypes; MotifZip rewrites recurring contract\-valid subgraphs as reversible macros; PathHydrate compiles a budgeted executable context; and ReZip updates the compressed library from new skills and execution feedback\.###### Definition 0 \(Section node\)\.

A section node is a typed procedural unitv=⟨τv,cv,Xv,Yv,Rv,Gv,srcv⟩v=\\langle\\tau\_\{v\},c\_\{v\},X\_\{v\},Y\_\{v\},R\_\{v\},G\_\{v\},\\mathrm\{src\}\_\{v\}\\rangle, whereτv\\tau\_\{v\}is the execution role,cvc\_\{v\}is the section content,XvX\_\{v\}andYvY\_\{v\}are input and output signatures,RvR\_\{v\}records resources or tools,GvG\_\{v\}records guard or verifier conditions, andsrcv\\mathrm\{src\}\_\{v\}points to the original skill source\.

We use nine operational roles:Intent,Trigger,Input,Precondition,Operation,Resource,Failure,Verifier, andOutput\. These roles describe a section’s procedural function rather than its position in a source file\. Each source occurrence remains a distinct section node\. Contract\-compatible occurrences may additionally link to a shared canonical prototype, which exposes reuse without erasing skill membership, multiplicity, or occurrence\-specific source pointers\. A prototype is an auxiliary node that stores a normalized role and contract signature plus links to its source occurrences; it is not itself a source occurrence\.

###### Definition 0 \(Procedural skill graph\)\.

Given𝒮\\mathcal\{S\}, a procedural skill graph is𝒢=\(𝒱,ℰd​e​p,ℰs​k​i​l​l,ℰr​e​s,ℰe​q\),\\mathcal\{G\}=\(\\mathcal\{V\},\\mathcal\{E\}\_\{dep\},\\mathcal\{E\}\_\{skill\},\\mathcal\{E\}\_\{res\},\\mathcal\{E\}\_\{eq\}\),where𝒱=𝒱o​c​c∪𝒱p​r​o​t​o\\mathcal\{V\}=\\mathcal\{V\}\_\{occ\}\\cup\\mathcal\{V\}\_\{proto\}contains occurrence\-specific section nodes and auxiliary prototypes,ℰd​e​p\\mathcal\{E\}\_\{dep\}stores typed procedural dependencies,ℰs​k​i​l​l\\mathcal\{E\}\_\{skill\}stores skill membership edges,ℰr​e​s\\mathcal\{E\}\_\{res\}links sections to external resources, andℰe​q\\mathcal\{E\}\_\{eq\}links source occurrences to compatible canonical prototypes\. We useℰ=ℰd​e​p∪ℰs​k​i​l​l∪ℰr​e​s∪ℰe​q\\mathcal\{E\}=\\mathcal\{E\}\_\{dep\}\\cup\\mathcal\{E\}\_\{skill\}\\cup\\mathcal\{E\}\_\{res\}\\cup\\mathcal\{E\}\_\{eq\}to denote the full edge set\.

A dependency edge ise=\(u,v,ρe\)e=\(u,v,\\rho\_\{e\}\), whereu,v∈𝒱u,v\\in\\mathcal\{V\}andρe\\rho\_\{e\}is a typed relation such asRequires,Binds,UsesResource,Verifies, orRepairs\. Multiple typed edges express multi\-input and multi\-output procedures, while subgraph ports expose their external contract\.

The fields\(Xv,Yv,Rv,Gv\)\(X\_\{v\},Y\_\{v\},R\_\{v\},G\_\{v\}\), typed edges, and ports together form a procedural contract with three aspects:*interface*covers typed I/O and resource bindings;*execution*covers preconditions, dependencies, guards, effects, and failure handling; and*verification*covers success conditions and verifier hooks\. The aspects are validated separately, whilesrcv\\mathrm\{src\}\_\{v\}retains provenance for reversible expansion\.

###### Definition 0 \(Skill procedural subgraph\)\.

A skillssis represented as an executable procedural subgraphhs=\(Vs,Es,rs,ts\)h\_\{s\}=\(V\_\{s\},E\_\{s\},r\_\{s\},t\_\{s\}\)inside𝒢\\mathcal\{G\}, whereVs⊆𝒱o​c​cV\_\{s\}\\subseteq\\mathcal\{V\}\_\{occ\},Es⊆ℰE\_\{s\}\\subseteq\\mathcal\{E\},rsr\_\{s\}is an intent or trigger root, andtst\_\{s\}is a verified output section\. The subgraph connects all procedural roles required from the root to the verified output\.

###### Definition 0 \(Macro node\)\.

A ported macro nodeMg:Ig⇒OgM\_\{g\}:I\_\{g\}\\Rightarrow O\_\{g\}compresses a connected section subgraphg=\(Vg,Eg\)g=\(V\_\{g\},E\_\{g\}\)with boundary inputsIgI\_\{g\}, boundary outputsOgO\_\{g\}, and expansion ruleMg⇒\(Vg,Eg,χg\),M\_\{g\}\\Rightarrow\(V\_\{g\},E\_\{g\},\\chi\_\{g\}\),whereχg\\chi\_\{g\}is the procedural contract of the macro, retaining the interface, execution, and verification aspects ofgg\. Source pointers attached to the stored subgraph support reversible expansion\.

For an operation or macro nodeuuand verifier nodezzin a procedural subgraphP=\(VP,EP\)P=\(V\_\{P\},E\_\{P\}\),zzis reachable fromuuif a directed pathu↝zu\\leadsto zexists in\(VP,EP∩ℰd​e​p\)\(V\_\{P\},E\_\{P\}\\cap\\mathcal\{E\}\_\{dep\}\)\. Verifier reachability holds when every state\-changing operation or macro node inPPhas at least one such verifier\. A valid macro preserves this condition and all three contract aspects across compatible occurrences\.

Problem statement\. Given a skill library𝒮\\mathcal\{S\}, SkillZip builds a raw section graph𝒢\\mathcal\{G\}and a macro dictionaryℳ\\mathcal\{M\}, producing a compressed graph𝒢z​i​p=𝒢/ℳ\\mathcal\{G\}\_\{zip\}=\\mathcal\{G\}/\\mathcal\{M\}\. Given a task queryqq, executor profilepp, and context budgetBB, SkillZip as the skill provider returns a rendered contextCqC\_\{q\}to the executor by hydratingPq⊆𝒢z​i​pP\_\{q\}\\subseteq\\mathcal\{G\}\_\{zip\}\. A validPqP\_\{q\}must cover query anchors, close required dependencies, keep verifiers reachable, and remain expandable to source sections when needed\.

## 4\.Method

SkillZip is built around one central requirement: a compressed skill library must remain executable\. A shorter context is not enough if it drops an input contract, hides a guard, or separates an operation from its verifier\. We therefore keep the procedural contract explicit throughout the pipeline\. As shown in Figure[2](https://arxiv.org/html/2608.05604#S3.F2), SkillZip first opens each package into source\-grounded typed procedural sections, then compresses repeated section subgraphs into reversible macros, and finally hydrates only the parts needed by the current task\. When the library evolves, ReZip uses execution evidence to promote newly reusable routines and revise macros that become unsafe\.

### 4\.1\.Sec2Graph: Building Procedural Subgraphs

Sec2Graph addresses the first obstacle in skill compression: a whole skill package is too coarse to reveal reusable or execution\-critical parts\. Since a package may mix instructions, scripts, schemas, tests, examples, and warnings, Sec2Graph converts it into a source\-grounded procedural subgraph that MotifZip can compress and PathHydrate can query\. The pseudocode is shown in Appendix[A\.2](https://arxiv.org/html/2608.05604#A1.SS2)\.

Section node construction\. We first convert package content into typed section nodes with explicit sources and procedural contracts\.

Section grounding\.Sec2Graph grounds a skill package by splitting it into source\-traceable sections and assigning each section an execution role\. Given a skill packagess, it first segments candidate sectionsℬs=SegmentSkill​\(s\)\\mathcal\{B\}\_\{s\}=\\textsf\{SegmentSkill\}\(s\)using headings, lists, code blocks, warnings, argument descriptions, tool references, and tests as boundary cues\. When these cues are incomplete, a model\-assisted parser refines the boundaries while preserving source pointers\. It then assigns each candidateb∈ℬsb\\in\\mathcal\{B\}\_\{s\}an execution roleτb=InferRole​\(b\)\\tau\_\{b\}=\\textsf\{InferRole\}\(b\), producing role\-labeled units for later contract extraction\. For example, in a tabular skill, “infer the delimiter” is anOperation, while “verify that row counts are unchanged” is aVerifier\.

Contract extraction\.Typing alone is insufficient because similar operation sections may require different inputs or checks\. Sec2Graph extracts a compact local contract for each section nodevv, including typed I/O\(Xv,Yv\)\(X\_\{v\},Y\_\{v\}\)and resourcesRvR\_\{v\}for the interface, while guards and verifier conditions are recorded inGvG\_\{v\}\. Dependency, repair, and verifier edges make execution and validation relationships explicit, and the source pointersrcv\\mathrm\{src\}\_\{v\}keeps the original package traceable\.

Procedural subgraph construction\. After section nodes are grounded, Sec2Graph connects them into an executable procedural subgraph\. Weak\-order edges preserve local order inside a skill; dependency edges bind operations to inputs, preconditions, and resources; verifier edges connect operations to reachable checks; and repair edges connect failure handlers to the guards that trigger them\. A skill membership edge records which nodes belong to the same source package\. For each skill, Sec2Graph marks an intent or trigger node as the root and a verified output node as the terminal node\. This turns the package from a text bundle into a structured procedure with explicit start, requirements, actions, and validation\.

Cross\-skill reuse\. Finally, Sec2Graph exposes reuse across the library\. Compatible sections remain occurrence\-specific nodes and are linked to a shared canonical prototype only when their roles, boundary signatures, resources, and verifier behavior agree\. The prototype makes common routines visible, such as tabular ingestion shared by cleaning, pivoting, and plotting skills, while each occurrence keeps its skill membership, local edges, and source pointer\. Motif support is counted over source occurrences rather than prototypes\. The output is the persistent section graph𝒢\\mathcal\{G\}, which supports structural compression without losing occurrence identity\.

### 4\.2\.MotifZip: Contract\-Preserving Compression

Once Sec2Graph exposes the library as procedural subgraphs, repeated routines become visible\. The difficulty is deciding which repetitions are safe to compress\. Surface similarity alone is unsafe, i\.e\., two spans may both describe “load data” while requiring different outputs or verifiers\. MotifZip therefore uses a lightweight typed graph grammar to mine recurring typed subgraphs and replace only contract\-valid ones with reversible macros\. Each macro records typed ports, executable contracts, verifier hooks, and source expansion pointers\. The pseudocode is shown in Appendix[A\.3](https://arxiv.org/html/2608.05604#A1.SS3)\.

Interface\-aware motif mining\. MotifZip avoids unrestricted frequent subgraph mining over the whole library\. It first proposes candidates from compatible execution interfaces, and then counts only occurrences whose boundary behavior is consistent\.

Typed candidate generation\.Because skill procedures contain typed roles, directed dependencies, and weak\-order edges, candidate search starts from execution interfaces\. Sections are grouped by role signature, resource family, and I/O shape, and candidates are grown along dependency and weak\-order edges:

\(1\)𝒞=GrowMotifs​\(BucketBySignature​\(𝒢\),𝒢\)\.\\mathcal\{C\}=\\textsf\{GrowMotifs\}\(\\textsf\{BucketBySignature\}\(\\mathcal\{G\}\),\\mathcal\{G\}\)\.Prototype links provide the grouping index, but motif growth and occurrence matching are performed on the occurrence\-specific procedural graph\. Semantic similarity is used only after this structural compatibility check\. Each candidate motif is represented as a typed attributed subgraphg=\(Vg,Eg,ℓg\)g=\(V\_\{g\},E\_\{g\},\\ell\_\{g\}\), whereℓg\\ell\_\{g\}records role labels, I/O signatures, resource families, and verifier tags\. This typed bucketing restricts motif growth to interface\-compatible neighborhoods instead of comparing arbitrary subgraphs across the full library\.

Occurrence support\.A candidate motif is useful only if it reappears with compatible external behavior\. MotifZip therefore matches eachggback to the raw graph and records its occurrences\. An occurrenceω=\(ψω,ϕω\)\\omega=\(\\psi\_\{\\omega\},\\phi\_\{\\omega\}\)maps motif nodes to section nodes throughψω\\psi\_\{\\omega\}and motif ports to boundary\-crossing edges throughϕω\\phi\_\{\\omega\}\. Support is counted over non\-conflicting occurrences: two occurrences conflict if they share an internal source section node or require incompatible port reconnections\. Thus, support measures reusable procedural structure rather than repeated text spans\. Canonical prototypes guide candidate matching but are not counted as occurrences\.

Contract\-preserving grammar construction\. After motif support is established, MotifZip checks whether a supported subgraph can be replaced without changing how the surrounding graph calls, executes, or verifies it\. This stage validates the macro contract and records a reversible grammar rule\.

Contract validation\.For each supported motif, MotifZip builds a macro boundary and contract\(Ig,Og,χg\)=BuildContract​\(g,Ωg\)\(I\_\{g\},O\_\{g\},\\chi\_\{g\}\)=\\textsf\{BuildContract\}\(g,\\Omega\_\{g\}\), whereΩg\\Omega\_\{g\}is the set of compatible occurrences\. The motif is accepted only if three conditions hold\. First, its interface is stable: input/output ports, role signatures, and resource requirements agree across occurrences\. Second, its execution is closed: dependencies are either internal to the motif or explicitly exposed through macro ports\. Third, its verification remains reachable: every state\-changing operation keeps its verifier inside macro contract or reachable from macro output\. These checks prevent compression from hiding cross\-boundary dependencies or detaching operations from their required checks, so each macro preserves its recorded executable contract\.

Graph grammar rule\.An accepted motif becomes a production rule in a typed attributed graph grammar:

\(2\)Mg​\[Ig,Og\]⇒\(Vg,Eg,πg,χg\),M\_\{g\}\[I\_\{g\},O\_\{g\}\]\\Rightarrow\(V\_\{g\},E\_\{g\},\\pi\_\{g\},\\chi\_\{g\}\),whereMgM\_\{g\}is a nonterminal macro node,IgI\_\{g\}andOgO\_\{g\}are typed ports,πg\\pi\_\{g\}records occurrence\-specific node and port mappings, andχg\\chi\_\{g\}is the executable contract\. Rewriting an occurrence removes only the internal nodes of the matched motif, insertsMgM\_\{g\}, and reconnects external edges through the port mapϕω\\phi\_\{\\omega\}\. Expansion performs the inverse operation and restores the source\-grounded section graph\.

Macro selection and representation\. The last step decides which contract\-valid motifs should actually enter the macro dictionary\. MotifZip first scores the candidate by compression benefit and execution risk, then performs conflict\-aware rewriting\.

Compression gain\.Not every valid motif is worth compressing\. MotifZip scores each motif by a local description\-length gain:

\(3\)Δ​\(g\)=\\displaystyle\\Delta\(g\)=freq​\(g\)​L​\(g\)−L​\(Mg\)−L​\(ruleg\)\\displaystyle\\mathrm\{freq\}\(g\)L\(g\)\-L\(M\_\{g\}\)\-L\(\\mathrm\{rule\}\_\{g\}\)\+α​Reuse​\(g\)−λ​Cut​\(g\)−μ​Risk​\(g\)\.\\displaystyle\+\\alpha\\,\\mathrm\{Reuse\}\(g\)\-\\lambda\\,\\mathrm\{Cut\}\(g\)\-\\mu\\,\\mathrm\{Risk\}\(g\)\.Herefreq​\(g\)\\mathrm\{freq\}\(g\)is the number of non\-conflicting occurrences selected for rewriting\. The first term rewards replacing repeated instances ofggwith one macro and one expansion rule\.Reuse​\(g\)\\mathrm\{Reuse\}\(g\)favors reuse across distinct skills or task families;Cut​\(g\)\\mathrm\{Cut\}\(g\)penalizes boundary loss; andRisk​\(g\)\\mathrm\{Risk\}\(g\)penalizes weak verifier support or ambiguous contracts\. The nonnegative weightsα\\alpha,λ\\lambda, andμ\\mucontrol these MotifZip\-specific terms\. Thus, the score selects a macro only when its description\-length saving justifies the execution risk\.

Macro rewriting\.Candidates are processed greedily in descendingΔ​\(g\)\\Delta\(g\)\. MotifZip skips overlapping rewrites, creates a ported macro for each accepted motif, and stores the production rule, occurrence mappings, boundary ports, verifier hooks, source pointers, and rendering levels\. A macro can be rendered as a name, contract, outline, or full source\. It is therefore a reversible procedural rewrite rule, not an opaque summary\. The conflict\-aware greedy policy keeps rewriting tractable over large libraries and does not claim global optimality over all overlapping motifs\.

###### Proposition 0 \(Compositional structural lifting\)\.

LetΩ\\Omegabe a set of pairwise non\-conflicting motif occurrences accepted by MotifZip\. DenoteκΩ\\kappa\_\{\\Omega\},ξΩ\\xi\_\{\\Omega\}as their simultaneous macro rewriting and source expansion\. If a raw procedural subgraphPPcontains, for each occurrence inΩ\\Omega, either all or none of its internal nodes, thenξΩ​\(κΩ​\(P\)\)≅P\\xi\_\{\\Omega\}\(\\kappa\_\{\\Omega\}\(P\)\)\\cong Pup to auxiliary prototype links, and isomorphism preserves typed external dependencies and operation\-to\-verifier reachability\.

###### Proof sketch\.

Consider first a single occurrenceω\\omega\.*\(i\) Identification\.*The occurrence mapπg\\pi\_\{g\}identifies its source nodes, andϕω\\phi\_\{\\omega\}maps every boundary\-crossing edge to a typed macro port; dependency closure guarantees that no crossing edge is left unrecorded\.*\(ii\) Expansion\.*ξ\\xitherefore restores exactly original internal nodes and edges and reconnects every external edge through its recorded port, so each required verifier path is either untouched or recovered from the stored occurrence\.*\(iii\) Composition\.*Because MotifZip rejects conflicting occurrences, rewriting one occurrence alters neither the internal nodes nor the port map of any other; the single\-occurrence argument thus applies independently to each element ofΩ\\Omega, and induction over\|Ω\|\|\\Omega\|yields the stated isomorphism\. ∎

This lifting property links compression to execution: MotifZip rewrites only regions whose recorded source structure can be recovered compositionally, and PathHydrate relies on this guarantee when retrieving from the compressed graph\. The guarantee is structural rather than semantic\. It recovers the recorded interfaces, dependencies, verifier paths, and source provenance, but does not establish the equivalence of unrecorded behavior or the correctness of a verifier itself\. Section[5](https://arxiv.org/html/2608.05604#S5)and Appendix[B\.1](https://arxiv.org/html/2608.05604#A2.SS1)then evaluate how reliably these recorded contracts are preserved in practice\.

### 4\.3\.PathHydrate: Budgeted Executable Context

MotifZip produces a compact library, but a task still needs an execution context that is both small and complete\. PathHydrate solves this online problem\. It maps the query to procedural anchors, concentrates section seeds without losing skill\-level coherence, searches for a compact connected subgraph, and then renders macros only to the detail level required by the task\. The pseudocode is shown in Appendix[A\.4](https://arxiv.org/html/2608.05604#A1.SS4)\.

Query\-guided seed construction\. This stage translates a natural\-language task into graph anchors and then uses both section\-level and skill\-level evidence to build a coherent seed set\.

Task anchoring\.PathHydrate first converts the raw query into a structured task object:

\(4\)zq=\(gq,Oq,Γq,Iq,Dq,\{di\}\),z\_\{q\}=\(g\_\{q\},O\_\{q\},\\Gamma\_\{q\},I\_\{q\},D\_\{q\},\\\{d\_\{i\}\\\}\),compactly written aszq=AnalyzeTask​\(q,p\)z\_\{q\}=\\textsf\{AnalyzeTask\}\(q,p\)\. Heregqg\_\{q\}is the goal,OqO\_\{q\}are expected outputs,Γq\\Gamma\_\{q\}are required capabilities,IqI\_\{q\}are visible inputs,DqD\_\{q\}is a domain or executor profile, and\{di\}\\\{d\_\{i\}\\\}is an ordered list of subgoals\. These anchors translate task language into the same execution\-role space used by Sec2Graph\.

Dual\-level seed fusion\.The anchors are then mapped to section seeds through two complementary views\. Let𝐞​\(⋅\)\\mathbf\{e\}\(\\cdot\)denote the embedding function used for dense matching\. Each section nodevvis scored by the better match under the subgoal and raw\-query views:

\(5\)s​\(v,di,q\)=max⁡\{cos⁡\(𝐞​\(di\),𝐞​\(v\)\),cos⁡\(𝐞​\(q\),𝐞​\(v\)\)\}\.s\(v,d\_\{i\},q\)=\\max\\\{\\cos\(\\mathbf\{e\}\(d\_\{i\}\),\\mathbf\{e\}\(v\)\),\\cos\(\\mathbf\{e\}\(q\),\\mathbf\{e\}\(v\)\)\\\}\.The subgoal view emphasizes capability and output\-signature matching, while the raw\-query view preserves names, resources, and entities that may be omitted by the abstraction\. Because section\-level retrieval can scatter seeds across unrelated skills, PathHydrate also builds two skill\-level rankings: one from skill descriptions and one from the best section match inside each skill\. For a candidate skillσ\\sigma, the rankings are fused by reciprocal\-rank fusion:

\(6\)RRF​\(σ\)=∑r∈ℛr​a​n​k1k\+rankr​\(σ\),\\mathrm\{RRF\}\(\\sigma\)=\\sum\_\{r\\in\\mathcal\{R\}\_\{rank\}\}\\frac\{1\}\{k\+\\mathrm\{rank\}\_\{r\}\(\\sigma\)\},whereℛr​a​n​k=\{Rdoc,Rnode\}\\mathcal\{R\}\_\{rank\}=\\\{R\_\{\\mathrm\{doc\}\},R\_\{\\mathrm\{node\}\}\\\}contains skill\-description and node\-max rankings, respectively;rankr​\(σ\)\\mathrm\{rank\}\_\{r\}\(\\sigma\)is the one\-based position ofσ\\sigmain rankingrr, and is set to\+∞\+\\inftywhenσ\\sigmais absent; andkkis smoothing constant\. The fused skill set concentrates the seed pool while still allowing high\-confidence section\-level rescue\. This step connects fine\-grained section precision with package\-level coherence\.

Topology\-aware context compilation\. Once the seed pool is coherent, PathHydrate must turn it into executable context\. It first searches for a compact connected subgraph, then repairs the role scaffold that execution requires\.

Constrained subgraph search\.Given the fused seeds, PathHydrate searches for a compact graph object that can serve as executable context\. The ideal objective is:

\(7\)Pq⋆=arg​minP⊆𝒢z​i​pη​T​\(P\)\+β​\|P\|\+γ​E​\(P\)−δ​Match​\(P,q\),\\displaystyle P\_\{q\}^\{\\star\}=\\operatorname\*\{arg\\,min\}\_\{P\\subseteq\\mathcal\{G\}\_\{zip\}\}\\quad\\eta T\(P\)\+\\beta\|P\|\+\\gamma E\(P\)\-\\delta\\,\\mathrm\{Match\}\(P,q\),subject to anchor coverage, dependency closure, verifier reachability, and the budgetT​\(P\)≤BT\(P\)\\leq B\. HereT​\(P\)T\(P\)is the estimated token cost of the selected procedural payload at its current hydration levels before rendering\.\|P\|\|P\|is the number of hydrated sections or macros,E​\(P\)E\(P\)estimates future expansion cost, andMatch​\(P,q\)\\mathrm\{Match\}\(P,q\)measures coverage of task anchors and matched section seeds\. The nonnegative weightsη\\eta,β\\beta,γ\\gamma, andδ\\deltaare specific to the PathHydrate objective\. At runtime, PathHydrate adds low\-cost connectors until the required roles are closed or the next addition would exceed the procedural\-content budget\. Thus, search remains bounded by the task budget without materializing the growing raw library\.

Scaffold repair and context filling\.A connected subgraph can still be incomplete for execution, so PathHydrate then repairs the scaffold around selected operations: it walks backward to recoverInput,Precondition, andResourcesections, and walks forward to recoverFailure,Verifier, andOutputsections\. Closure repair produces\(P,ξq\)=RepairClosure​\(P,𝒢z​i​p,B\)\(P,\\xi\_\{q\}\)=\\textsf\{RepairClosure\}\(P,\\mathcal\{G\}\_\{zip\},B\), whereξq\\xi\_\{q\}records restored or infeasible roles\. If no verifier\-reachable context fits the budget, the system falls back to the smallest skill\-level bundle covering the anchors\. Context filling is sufficiency\-gated rather than budget\-seeking: it terminates once the task anchors are covered, required dependencies are closed, and a verifier remains reachable\. Thus, unused budget is not spent on additional procedural text\.

Progressive hydration and rendering\. The selected subgraph is still an internal graph object\. PathHydrate turns it into agent\-readable context by choosing macro detail levels and rendering the selected units as an executable context\.

Macro\-level hydration\.The selected subgraph may contain either source sections or macros\. For each selected macro, PathHydrate chooses the lowest sufficient hydration level: name, contract, outline, or full source\. If the macro contract does not expose a needed input, guard condition, verifier, or source pointer, the macro is expanded\. This upgrades progressive disclosure from package level to graph level: SkillZip reveals the smallest executable view of a section graph instead of loading an entire skill body\.

Table 1\.Main results onSkillsBenchand ALFWorld\. R is task reward \(%\) onSkillsBenchor episode success rate \(%\) on ALFWorld\. Arrows report point changes from Vector Skills\. The best comparable results are inbold\.BackboneMethodSkillsBench\(Liet al\.,[2026b](https://arxiv.org/html/2608.05604#bib.bib3)\)ALFWorld\(Shridharet al\.,[2021](https://arxiv.org/html/2608.05604#bib.bib33)\)R↑\\uparrowRet@1↑\\uparrowRet@5↑\\uparrowMRR↑\\uparrowR↑\\uparrowRet@1↑\\uparrowRet@5↑\\uparrowMRR↑\\uparrowMiniMax\-M2\.7Vanilla Skills17\.2↑6\.8\\uparrow 6\.8–––47\.1↓3\.6\\downarrow 3\.6–––Vector Skills10\.43\.610\.85\.850\.737\.968\.649\.2GoS\(Liuet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib8)\)18\.7↑8\.3\\uparrow 8\.350\.6↑47\.0\\uparrow 47\.065\.5↑54\.7\\uparrow 54\.757\.3↑51\.5\\uparrow 51\.554\.3↑3\.6\\uparrow 3\.656\.4↑18\.5\\uparrow 18\.586\.4↑17\.8\\uparrow 17\.867\.9↑18\.7\\uparrow 18\.7SkillDAG\(Baiet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib11)\)27\.3↑16\.9\\uparrow 16\.966\.7↑63\.1\\uparrow 63\.178\.2↑67\.4\\uparrow 67\.471\.3↑65\.5\\uparrow 65\.567\.1↑16\.4\\uparrow 16\.457\.9↑20\.0\\uparrow 20\.092\.1↑23\.5\\uparrow 23\.571\.1↑21\.9\\uparrow 21\.9SkillZip33\.3↑22\.9\\uparrow 22\.973\.6↑70\.0\\uparrow 70\.092\.0↑81\.2\\uparrow 81\.281\.3↑75\.5\\uparrow 75\.579\.3↑28\.6\\uparrow 28\.685\.7↑47\.8\\uparrow 47\.898\.6↑30\.0\\uparrow 30\.091\.2↑42\.0\\uparrow 42\.0gpt\-5\.2\-codexVanilla Skills27\.4↑5\.9\\uparrow 5\.9–––89\.3↓3\.6\\downarrow 3\.6–––Vector Skills21\.53\.610\.85\.892\.937\.968\.649\.2GoS\(Liuet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib8)\)34\.4↑12\.9\\uparrow 12\.950\.6↑47\.0\\uparrow 47\.065\.5↑54\.7\\uparrow 54\.757\.3↑51\.5\\uparrow 51\.593\.6↑0\.7\\uparrow 0\.756\.4↑18\.5\\uparrow 18\.586\.4↑17\.8\\uparrow 17\.867\.9↑18\.7\\uparrow 18\.7SkillDAG\(Baiet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib11)\)36\.8↑15\.3\\uparrow 15\.370\.1↑66\.5\\uparrow 66\.575\.9↑65\.1\\uparrow 65\.173\.0↑67\.2\\uparrow 67\.293\.6↑0\.7\\uparrow 0\.760\.4↑22\.5\\uparrow 22\.585\.1↑16\.5\\uparrow 16\.569\.6↑20\.4\\uparrow 20\.4SkillZip43\.0↑21\.5\\uparrow 21\.574\.7↑71\.1\\uparrow 71\.188\.5↑77\.7\\uparrow 77\.781\.0↑75\.2\\uparrow 75\.296\.4↑3\.5\\uparrow 3\.590\.7↑52\.8\\uparrow 52\.899\.3↑30\.7\\uparrow 30\.795\.0↑45\.8\\uparrow 45\.8

Execution\-context rendering\.The final context is rendered as a compact executable context rather than a concatenation of snippets, denoted asCq=RenderContract​\(U,p,B\)C\_\{q\}=\\textsf\{RenderContract\}\(U,p,B\), whereUUdenotes the selected source sections and hydrated macro views\. The rendered context includes intent, bound inputs, required preconditions, hydrated operations, resources, guards, failure handlers, verifiers, and source expansion pointers\. For a spreadsheet task, PathHydrate may load a shared tabular\-ingest contract plus a pivot\-total verifier while leaving chart\-rendering sections out of context\. The hydration logℒq\\mathcal\{L\}\_\{q\}records selected sections, macro levels, token cost, late expansions, verifier coverage, and source pointers\. These logs connect runtime behavior back to the structural constraints enforced by MotifZip and provide the feedback used by ReZip\.

Closed\-loop invariants\. The runtime postconditions mirror the compression constraints\. Sec2Graph exposes section roles and source pointers; MotifZip accepts a macro only after boundary, signature, dependency\-closure, and verifier\-reachability checks; and PathHydrate records anchor coverage, restored dependencies, verifier status, macro levels, and source expansions inℒq\\mathcal\{L\}\_\{q\}\. The same quantities are used by the structure\-aware evaluation protocol, so the empirical metrics test whether compression remains executable rather than merely shorter\.

### 4\.4\.ReZip: Incremental Library Maintenance

ReZip closes the compression\-execution loop as the library evolves\. We model each update as a transition over the compressed library:

\(8\)𝒵t=\(𝒢z​i​pt,ℳt,ℬr​e​st,Σt\),𝒵t\+1=ReZip⁡\(𝒵t,ut\),\\mathcal\{Z\}\_\{t\}=\(\\mathcal\{G\}\_\{zip\}^\{t\},\\mathcal\{M\}\_\{t\},\\mathcal\{B\}\_\{res\}^\{t\},\\Sigma\_\{t\}\),\\qquad\\mathcal\{Z\}\_\{t\+1\}=\\operatorname\{ReZip\}\(\\mathcal\{Z\}\_\{t\},u\_\{t\}\),whereℬr​e​st\\mathcal\{B\}\_\{res\}^\{t\}stores unmatched residual subgraphs,Σt\\Sigma\_\{t\}stores macro\-level execution evidence, andutu\_\{t\}is either a new skill or an execution trace\. New skills provide evidence for reusable structure, while traces reveal abstractions that require revision\. The pseudocode is shown in Appendix[A\.5](https://arxiv.org/html/2608.05604#A1.SS5)\.

New\-skill assimilation\. Sec2Graph first converts an arriving skill into a procedural subgraph\. ReZip matches each connected region against existing macros using typed ports and the interface, execution, and verification aspects of their contracts\. A compatible region reuses the macro while retaining an occurrence\-specific source map; unmatched regions remain explicit and enterℬr​e​st\\mathcal\{B\}\_\{res\}^\{t\}\. ReZip promotes a residual motifrronly when:

\(9\)suppt⁡\(r\)≥m,Δ​\(r\)\>0,Validχ​\(r\)=1,\\operatorname\{supp\}\_\{t\}\(r\)\\geq m,\\qquad\\Delta\(r\)\>0,\\qquad\\mathrm\{Valid\}\_\{\\chi\}\(r\)=1,wheresuppt⁡\(r\)\\operatorname\{supp\}\_\{t\}\(r\)is the number of distinct source skills supportingrrup to update steptt,mmis the minimum cross\-skill support required for promotion,Δ​\(r\)\\Delta\(r\)is the MotifZip compression gain, andValidχ\\mathrm\{Valid\}\_\{\\chi\}applies the same port, dependency\-closure, and verifier checks as offline compression\. Thus, library growth reuses established macros immediately but introduces a new abstraction only after repeated contract\-compatible evidence\. The promoted occurrences are then removed from the residual buffer\.

Execution\-aware macro revision\. For each observed macroMM,Σt​\(M\)\\Sigma\_\{t\}\(M\)records its uses, source expansions, verifier failures, and downstream repair cost\. ReZip summarizes these signals as

\(10\)ρt​\(M\)=λe​nexp​\(M\)nuse​\(M\)\+λv​nfail​\(M\)nuse​\(M\)\+λd​crepair​\(M\)nuse​\(M\)\.\\rho\_\{t\}\(M\)=\\lambda\_\{e\}\\frac\{n\_\{\\mathrm\{exp\}\}\(M\)\}\{n\_\{\\mathrm\{use\}\}\(M\)\}\+\\lambda\_\{v\}\\frac\{n\_\{\\mathrm\{fail\}\}\(M\)\}\{n\_\{\\mathrm\{use\}\}\(M\)\}\+\\lambda\_\{d\}\\frac\{c\_\{\\mathrm\{repair\}\}\(M\)\}\{n\_\{\\mathrm\{use\}\}\(M\)\}\.The weightsλe\\lambda\_\{e\},λv\\lambda\_\{v\}, andλd\\lambda\_\{d\}balance insufficient macro detail, failed verification, and downstream recovery effort\. Whenρt​\(M\)\\rho\_\{t\}\(M\)exceeds a risk threshold, ReZip performs controlled demotion: it first raises the hydration level for the affected task profile; persistent risk causes the macro to be split into narrower contract\-compatible rules or retired in favor of its source sections\. Every promoted macro therefore satisfies MotifZip contract checks, while every revision retains a source\-grounded expansion\. Consequently,𝒢z​i​pt\+1\\mathcal\{G\}\_\{zip\}^\{t\+1\}preserves the executable\-subgraph lifting invariant used by PathHydrate\.

## 5\.Experiments

In this section, we evaluate SkillZip onSkillsBenchand ALFWorld\. The detailed experimental settings, including baselines, evaluation metrics, and implementations, are provided in Appendix[D](https://arxiv.org/html/2608.05604#A4)\.

### 5\.1\.Main Results

\(RQ1\) Does SkillZip improve end\-to\-end task performance?To evaluate the overall effectiveness of SkillZip, we compare SkillZip with Vanilla Skills, Vector Skills, GoS, andSkillDAG, covering full\-skill loading, embedding\-based retrieval, and graph\-based retrieval under the same benchmark and backbone settings\. As shown in Table[1](https://arxiv.org/html/2608.05604#S4.T1), SkillZip consistently achieves the best end\-to\-end performance across both benchmarks and both backbone LLMs\. With MiniMax\-M2\.7, SkillZip obtains a task reward of 33\.3 onSkillsBenchand an episode success rate of 79\.3 on ALFWorld, improving by 6\.0 points and 12\.2 points overSkillDAG\. When using gpt\-5\.2\-codex, SkillZip further reaches 43\.0 onSkillsBenchand 96\.4 on ALFWorld, improving by 6\.2 points and 2\.8 points overSkillDAG\. Notably, both GoS andSkillDAGalready achieve 93\.6% success on ALFWorld with gpt\-5\.2\-codex, leaving limited room for further improvement, yet SkillZip still raises the success rate to 96\.4%\. One possible explanation for the weaker Vector Skills results is that whole\-skill embeddings are affected by shared boilerplate and formatting content, making closely related packages difficult to distinguish\. This interpretation is consistent with the higher similar\-skill confusion observed for skill\-level retrieval in Appendix[B\.2](https://arxiv.org/html/2608.05604#A2.SS2)\. Overall, these consistent gains across different backbones and task formats demonstrate retrieving execution\-complete sections provides more useful procedural context than loading or retrieving skills as indivisible packages\. On the matched MiniMax\-M2\.7SkillsBenchruns, SkillZip also reduces cumulative prompt processing by 47\.0% and average tool calls by 21\.7% relative toSkillDAG, while reducing uncached prompt input by 18\.7% and end\-to\-end task time by 21\.1%\. Appendix[10](https://arxiv.org/html/2608.05604#A2.T10)provides the full breakdown and distinguishes these trajectory\-level counters from the one\-time hydrated skill context\.

\(RQ2\) Does section\-level retrieval improve retrieval quality?To assess whether the end\-task gains come from more precise procedural exposure, we evaluate retrieval on gold\-annotated queries and map each retrieved section back to its source skill\. As shown in Table[1](https://arxiv.org/html/2608.05604#S4.T1), SkillZip consistently improves retrieval quality overSkillDAGacross both benchmarks and backbone LLMs\. OnSkillsBench, SkillZip increases Ret@1 from 66\.7 to 73\.6 and Ret@5 from 78\.2 to 92\.0 with MiniMax\-M2\.7, while also raising MRR by 10\.0\. The same trend holds with gpt\-5\.2\-codex, where SkillZip improves Ret@5 by 12\.6 overSkillDAG\. The gain is more pronounced on ALFWorld: Ret@1 increases by 27\.8 with MiniMax\-M2\.7 and by 30\.3 with gpt\-5\.2\-codex\. Since Ret@5 is already high for strong graph\-based baselines, the MRR gains indicate that SkillZip moves the correct source closer to the top rather than simply recovering it somewhere in the candidate set\. Overall, these results suggest that execution\-complete sections reduce skill\-level retrieval ambiguity by separating shared routines from the operations that distinguish each skill\. This benefit becomes stronger as the library grows: Appendix[B\.2](https://arxiv.org/html/2608.05604#A2.SS2)shows that the Ret@1 advantage overSkillDAGwidens from 6\.2 at 200 skills to 23\.3 at 100K\. At the largest scale, SkillZip retains 65\.1 Ret@1 with 248\.3 ms online retrieval and hydration latency\. After section contracts are available, local graph construction and MotifZip complete in 178 seconds for the corresponding 100K\-skill library with 4\.77M section nodes \(Appendix[B\.5](https://arxiv.org/html/2608.05604#A2.SS5)\)\.

### 5\.2\.Compression and Structural Fidelity

Table 2\.Compression and structural\-fidelity results onSkillsBench\. The complete SkillZip configuration is shaded\.RepresentationCR↑\\uparrowTok↓\\downarrowDPR↑\\uparrowVR↑\\uparrowRecover\.↓\\downarrowR↑\\uparrowRaw section graph1\.00×\\times6,716100\.0100\.00\.031\.0Exact\-text dedup\.1\.43×\\times4,69798\.698\.15\.231\.2Text compression\(Pan and others,[2024](https://arxiv.org/html/2608.05604#bib.bib27)\)3\.46×\\times1,94165\.060\.045\.025\.5Generic graph grammar2\.91×\\times2,30893\.490\.822\.729\.4SkillZip w/o checks3\.78×\\times1,77788\.984\.631\.527\.8SkillZip3\.46×\\times1,94199\.298\.714\.833\.3

\(RQ3\) Does compression preserve executable structure?We evaluate whether compression can reduce the rendered skill context while preserving the dependencies and verification conditions needed for execution\. As shown in Table[2](https://arxiv.org/html/2608.05604#S5.T2), exact\-text deduplication keeps most structural information, but only provides a limited compression ratio of 1\.43×\\times, since it can merge only surface\-identical sections\. Text compression reaches the same rounded compression ratio and average rendered context as SkillZip, but it sharply reduces structural fidelity: DPR drops to 65\.0, VR drops to 60\.0, and 45\.0% of queries require recovery from the original sections\. Its reward also falls to 25\.5, showing that shorter context alone does not guarantee executable context\. Generic graph grammar preserves more graph structure than text compression, but still loses dependency and verifier information, leading to lower reward than the raw section graph\. Similarly, removing contract checks makes SkillZip more compact, but the loss in DPR, VR, and reward shows that unsafe merges can damage execution\. In contrast, SkillZip achieves a 3\.46×\\timescompression ratio while keeping DPR and VR close to the raw graph, at 99\.2 and 98\.7, respectively\. It reduces recovery from 45\.0% to 14\.8% relative to text compression\. Relative to the raw section graph, SkillZip improves reward from 31\.0 to 33\.3 while retaining near\-complete structural fidelity\. Compared with text compression, SkillZip improves reward by 7\.8\. These results suggest that the main benefit of SkillZip is not only compressing repeated procedures, but compressing them in a way that keeps their interface, execution dependencies, and verifier contracts recoverable\. Because this preservation depends on the extracted contracts, we additionally evaluate contract extraction against human annotations and under controlled field corruption in Appendix[B\.1](https://arxiv.org/html/2608.05604#A2.SS1), obtaining 91\.6 macro\-F1 and 84\.6 exact match and maintaining high DPR and VR under 10% contract corruption\.

### 5\.3\.Ablation Study

Table 3\.Component ablation of SkillZip onSkillsBench\.ComponentVariantR↑\\uparrowRet@1↑\\uparrowTok↓\\downarrowDPR↑\\uparrowVR↑\\uparrowFullSkillZip33\.373\.61,94199\.298\.7Unitw/o section\-level nodes27\.966\.73,103––Compressionw/o MotifZip31\.071\.82,967100\.0100\.0w/o dependency closure28\.672\.11,65382\.392\.6w/o verifier constraint29\.172\.81,66894\.976\.4Hydrationw/o global section rescue30\.468\.21,81296\.596\.8w/o adaptive hydration31\.573\.22,58799\.298\.7

\(RQ4\) Which components contribute to the final performance?To identify the contribution of each component, we conduct ablation studies\. As shown in Table[3](https://arxiv.org/html/2608.05604#S5.T3), replacing section\-level nodes with skill\-level nodes causes the largest drop: Ret@1 decreases by 6\.9 points, task reward drops by 5\.4 points, and rendered context increases by 59\.9%\. This drop occurs because section\-level procedures are the input to later stages\. Without them, MotifZip can only compress coarser patterns and PathHydrate must retrieve from less precise context, limiting both retrieval precision and context efficiency\. The compression ablations reveal a different division of labor\. Without MotifZip, DPR and VR remain perfect, but context increases by 52\.9% and reward falls to 31\.0, showing that motif abstraction primarily removes contract\-compatible repeated structure\. This variant still uses PathHydrate and therefore renders 2,967 tokens rather than the 6,716 tokens of full, unpruned raw\-graph retrieval in Table[2](https://arxiv.org/html/2608.05604#S5.T2)\. Removing dependency closure or verifier constraints leaves Ret@1 near the full model, but damages executable structure: DPR falls to 82\.3 without closure, while VR falls to 76\.4 without verifier constraints\. Thus, correct retrieval alone is insufficient without execution\-preserving compression\. The hydration ablations further show how PathHydrate controls the final context\. Removing global section rescue reduces Ret@1 to 68\.2 and reward to 30\.4, showing that local expansion from the initial skill neighborhood can miss useful sections\. Disabling adaptive hydration preserves DPR and VR, but uses 33\.3% more tokens\. This context\-saving effect is further supported by the budget analysis in Appendix[B\.4](https://arxiv.org/html/2608.05604#A2.SS4), where PathHydrate renders 1,941 tokens per task, 72\.1% fewer than top\-5 whole\-skill loading\.

To further evaluate SkillZip, we report additional studies on compression and contract robustness, retrieval scalability, and procedural overlap across domains \(Appendix[B\.1](https://arxiv.org/html/2608.05604#A2.SS1)–[B\.3](https://arxiv.org/html/2608.05604#A2.SS3)\); hydration quality, context compactness, and system cost \(Appendix[B\.4](https://arxiv.org/html/2608.05604#A2.SS4)–[B\.5](https://arxiv.org/html/2608.05604#A2.SS5)\); streaming maintenance, repeated\-run reliability, backbone generalization, and failure attribution \(Appendix[B\.6](https://arxiv.org/html/2608.05604#A2.SS6)–[B\.8](https://arxiv.org/html/2608.05604#A2.SS8)\); and case studies \(Appendix[C](https://arxiv.org/html/2608.05604#A3)\)\. A detailed outline is shown in the[Appendix Outline](https://arxiv.org/html/2608.05604#Ax1)\.

## 6\.Conclusion

In this paper, we present SkillZip, a contract\-preserving graph compression framework for scalable agent skill libraries\. SkillZip organizes skills into section\-level procedural graphs, compresses repeated execution patterns, and builds compact task\-specific contexts while preserving dependency and verifier contracts\. Experiments onSkillsBenchand ALFWorld show that SkillZip outperforms strong retrieval and graph\-based baselines in both end\-task performance and source\-skill retrieval\. Overall, SkillZip improves skill\-library scalability while maintaining executable structure, enabling efficient and reliable skill reuse in long\-horizon agent tasks\.

## References

- T\. Bai, Z\. Wan, P\. Zhou, X\. Yu, Y\. You, and I\. W\. Tsang \(2026\)SkillDAG: self\-evolving typed skill graphs for llm skill selection at scale\.arXiv preprint arXiv:2606\.03056\.External Links:[Link](https://arxiv.org/abs/2606.03056)Cited by:[Appendix D](https://arxiv.org/html/2608.05604#A4.p2.1),[Appendix D](https://arxiv.org/html/2608.05604#A4.p3.1),[Appendix D](https://arxiv.org/html/2608.05604#A4.p9.1),[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§1](https://arxiv.org/html/2608.05604#S1.p6.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1),[Table 1](https://arxiv.org/html/2608.05604#S4.T1.26.26.26.9),[Table 1](https://arxiv.org/html/2608.05604#S4.T1.52.52.52.9)\.
- J\. Belikova, R\. Parchiev, E\. Egorov, G\. Davydenko, G\. Gusev, A\. Savchenko, and M\. Makarenko \(2026\)Managing procedural memory in llm agents: control, adaptation, and evaluation\.arXiv preprint arXiv:2606\.23127\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- Z\. Blumenfeld and J\. Webber \(2026\)AIP: a graph representation for learning and governing agent skills\.arXiv preprint arXiv:2606\.04781\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1)\.
- H\. Cho, R\. Kang, and Y\. Kim \(2026\)SkillRet: a large\-scale benchmark for skill retrieval in llm agents\.arXiv preprint arXiv:2605\.05726\.External Links:[Link](https://arxiv.org/abs/2605.05726)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- D\. J\. Cook and L\. B\. Holder \(1994\)Substructure discovery using minimum description length and background knowledge\.Journal of Artificial Intelligence Research1,pp\. 231–255\.External Links:[Document](https://dx.doi.org/10.1613/jair.43)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- M\. Côté, Á\. Kádár, X\. Yuan, B\. Kybartas, T\. Barnes, E\. Fine, J\. Moore, M\. Hausknecht, L\. El Asri, M\. Adada,et al\.\(2018\)TextWorld: a learning environment for text\-based games\.arXiv preprint arXiv:1806\.11532\.External Links:[Link](https://arxiv.org/abs/1806.11532)Cited by:[Appendix D](https://arxiv.org/html/2608.05604#A4.p3.1)\.
- T\. Feng, H\. Zhang, Z\. Lei, P\. Han, and J\. You \(2026\)GraphPlanner: graph memory\-augmented agentic routing for multi\-agent llms\.International Conference on Learning Representations\.External Links:[Link](https://openreview.net/forum?id=ZdGB7MNQDT)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- Y\. Gao, Z\. Li, Y\. Yuan, Z\. Ji, P\. Ma, and S\. Wang \(2026\)SkillReducer: optimizing llm agent skills for token efficiency\.arXiv preprint arXiv:2603\.29919\.External Links:[Link](https://arxiv.org/abs/2603.29919)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§1](https://arxiv.org/html/2608.05604#S1.p5.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- T\. Han, Y\. Zhang, W\. Song, C\. Fang, Z\. Chen, Y\. Sun, and L\. Hu \(2026\)SWE\-skills\-bench: do agent skills actually help in real\-world software engineering?\.arXiv preprint arXiv:2603\.15401\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- H\. Jiang, Q\. Wu, C\. Lin, Y\. Yang, and L\. Qiu \(2023\)Llmlingua: compressing prompts for accelerated inference of large language models\.InProceedings of the 2023 conference on empirical methods in natural language processing,pp\. 13358–13376\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- H\. Jiang, Q\. Wu, X\. Luo, D\. Li, C\. Lin, Y\. Yang, and L\. Qiu \(2024\)Longllmlingua: accelerating and enhancing llms in long context scenarios via prompt compression\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 1658–1677\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- J\. Ko, Y\. Kook, and K\. Shin \(2020\)Incremental lossless graph summarization\.InProceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining,pp\. 317–327\.External Links:[Document](https://dx.doi.org/10.1145/3394486.3403074)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- D\. Koutra, U\. Kang, J\. Vreeken, and C\. Faloutsos \(2014\)VoG: summarizing and understanding large graphs\.InProceedings of the 2014 SIAM International Conference on Data Mining,pp\. 91–99\.External Links:[Document](https://dx.doi.org/10.1137/1.9781611973440.11)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- K\. Lee, H\. Jo, J\. Ko, S\. Lim, and K\. Shin \(2020\)SSumM: sparse summarization of massive graphs\.InProceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining,pp\. 144–154\.External Links:[Document](https://dx.doi.org/10.1145/3394486.3403057)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- K\. Lee, J\. Ko, and K\. Shin \(2022\)SLUGGER: lossless hierarchical summarization of massive graphs\.In2022 IEEE 38th International Conference on Data Engineering,pp\. 2878–2890\.External Links:[Link](https://arxiv.org/abs/2112.05374)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- K\. LeFevre and E\. Terzi \(2010\)GraSS: graph structure summarization\.InProceedings of the 2010 SIAM International Conference on Data Mining,pp\. 454–465\.External Links:[Document](https://dx.doi.org/10.1137/1.9781611972801.40)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- H\. Li, C\. Mu, J\. Chen, S\. Ren, Z\. Cui, Y\. Zhang, L\. Bai, and S\. Hu \(2026a\)Organizing, orchestrating, and benchmarking agent skills at ecosystem scale\.arXiv preprint arXiv:2603\.02176\.External Links:[Link](https://arxiv.org/abs/2603.02176)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§1](https://arxiv.org/html/2608.05604#S1.p6.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- M\. Li, Y\. Zhao, B\. Yu, F\. Song, H\. Li, H\. Yu, Z\. Li, F\. Huang, and Y\. Li \(2023\)Api\-bank: a comprehensive benchmark for tool\-augmented llms\.InProceedings of the 2023 conference on empirical methods in natural language processing,pp\. 3102–3116\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- X\. Li, Y\. Liu, W\. Chen, B\. You, Z\. Di, Y\. He, S\. Zheng,et al\.\(2026b\)SkillsBench: benchmarking how well agent skills work across diverse tasks\.arXiv preprint arXiv:2602\.12670\.External Links:[Link](https://arxiv.org/abs/2602.12670)Cited by:[Appendix D](https://arxiv.org/html/2608.05604#A4.p2.1),[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§1](https://arxiv.org/html/2608.05604#S1.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1),[Table 1](https://arxiv.org/html/2608.05604#S4.T1.60.60.61.3.1.1)\.
- X\. Li, M\. Li, K\. Bao, Y\. Ma, W\. Wang, D\. Liu, and F\. Feng \(2026c\)SkillGraph: skill\-augmented reinforcement learning for agents via evolving skill graphs\.arXiv preprint arXiv:2605\.12039\.External Links:[Link](https://arxiv.org/abs/2605.12039)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- Q\. Liang, H\. Wang, Z\. Liang, and Y\. Liu \(2026a\)From skill text to skill structure: the scheduling\-structural\-logical representation for agent skills\.arXiv preprint arXiv:2604\.24026\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1)\.
- Y\. Liang, R\. Zhong, H\. Xu, C\. Jiang, Y\. Zhong, R\. Fang, J\. Gu, S\. Deng,et al\.\(2026b\)SkillNet: create, evaluate, and connect AI skills\.arXiv preprint arXiv:2603\.04448\.External Links:[Link](https://arxiv.org/abs/2603.04448)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- G\. Ling, S\. Zhong, and R\. Huang \(2026\)Agent skills: a data\-driven analysis of claude skills for extending large language model functionality\.arXiv preprint arXiv:2602\.08004\.External Links:[Link](https://arxiv.org/abs/2602.08004)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- D\. Liu, Z\. Li, H\. Du, X\. Wu, S\. Gui, Y\. Kuang, and L\. Sun \(2026\)Graph\-of\-skills: dependency\-aware structural retrieval for massive agent skills\.arXiv preprint arXiv:2604\.05333\.External Links:[Link](https://arxiv.org/abs/2604.05333)Cited by:[Appendix D](https://arxiv.org/html/2608.05604#A4.p2.1),[Appendix D](https://arxiv.org/html/2608.05604#A4.p3.1),[Appendix D](https://arxiv.org/html/2608.05604#A4.p9.1),[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§1](https://arxiv.org/html/2608.05604#S1.p4.1),[§1](https://arxiv.org/html/2608.05604#S1.p6.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1),[Table 1](https://arxiv.org/html/2608.05604#S4.T1.18.18.18.9),[Table 1](https://arxiv.org/html/2608.05604#S4.T1.44.44.44.9)\.
- X\. Liu, H\. Yu, H\. Zhang, Y\. Xu, X\. Lei, H\. Lai, Y\. Gu, H\. Ding, K\. Men, K\. Yang,et al\.\(2024\)Agentbench: evaluating llms as agents\.InInternational Conference on Learning Representations,Vol\.2024,pp\. 52989–53046\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1)\.
- S\. Maneth and F\. Peternek \(2018\)Grammar\-based graph compression\.Information Systems76,pp\. 19–45\.External Links:[Document](https://dx.doi.org/10.1016/j.is.2018.03.002)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- X\. Meng, S\. Wang, and Y\. Fang \(2026\)SkillRAE: agent skill\-based context compilation for retrieval\-augmented execution\.arXiv preprint arXiv:2605\.10114\.External Links:[Link](https://arxiv.org/abs/2605.10114)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- Q\. Miet al\.\(2026\)Skill\-pro: learning reusable skills from experience via non\-parametric ppo for llm agents\.arXiv preprint arXiv:2602\.01869\.Note:Accepted at ICML 2026External Links:[Link](https://arxiv.org/abs/2602.01869)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§1](https://arxiv.org/html/2608.05604#S1.p7.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- Y\. Miao, Z\. Yu, L\. Zhao, B\. Zhu, and H\. Haque \(2026\)SkillLens: adaptive multi\-granularity skill reuse for cost\-efficient llm agents\.arXiv preprint arXiv:2605\.08386\.External Links:[Link](https://arxiv.org/abs/2605.08386)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- S\. Nijssen and J\. N\. Kok \(2004\)A quickstart in frequent structure mining can make a difference\.InProceedings of the Tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining,pp\. 647–652\.External Links:[Document](https://dx.doi.org/10.1145/1014052.1014134)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- S\. Ouyanget al\.\(2026\)ReasoningBank: scaling agent self\-evolving with reasoning memory\.International Conference on Learning Representations\.External Links:[Link](https://openreview.net/forum?id=jL7fwchScm)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§1](https://arxiv.org/html/2608.05604#S1.p7.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- Z\. Panet al\.\(2024\)LLMLingua\-2: data distillation for efficient and faithful task\-agnostic prompt compression\.arXiv preprint arXiv:2403\.12968\.External Links:[Link](https://arxiv.org/abs/2403.12968)Cited by:[Appendix D](https://arxiv.org/html/2608.05604#A4.p11.1),[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1),[Table 2](https://arxiv.org/html/2608.05604#S5.T2.9.9.9.9.9.9.9.9.2)\.
- H\. Pu, X\. Song, and L\. Zhao \(2026\)SkillOps: managing LLM agent skill libraries as self\-maintaining software ecosystems\.arXiv preprint arXiv:2605\.13716\.External Links:[Link](https://arxiv.org/abs/2605.13716)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- Y\. Qin, S\. Liang, Y\. Ye, K\. Zhu, L\. Yan, Y\. Lu, Y\. Lin, X\. Cong, X\. Tang, B\. Qian, S\. Zhao, L\. Hong, R\. Tian, R\. Xie, J\. Zhou, M\. Gerstein, D\. Li, Z\. Liu, and M\. Sun \(2024\)ToolLLM: facilitating large language models to master 16000\+ real\-world apis\.InInternational Conference on Learning Representations,Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§1](https://arxiv.org/html/2608.05604#S1.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- T\. Schick, J\. Dwivedi\-Yu, R\. Dessì, R\. Raileanu, M\. Lomeli, L\. Zettlemoyer, N\. Cancedda, and T\. Scialom \(2023\)Toolformer: language models can teach themselves to use tools\.InAdvances in Neural Information Processing Systems,External Links:[Link](https://arxiv.org/abs/2302.04761)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- S\. Shen, W\. Cheng, M\. Ma, A\. Turcan, M\. J\. Zhang, and J\. Ma \(2026\)SKILLFOUNDRY: building self\-evolving agent skill libraries from heterogeneous scientific resources\.arXiv preprint arXiv:2604\.03964\.External Links:[Link](https://arxiv.org/abs/2604.03964)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- K\. Shin, A\. Ghoting, M\. Kim, and H\. Raghavan \(2019\)SWeG: lossless and lossy summarization of web\-scale graphs\.InProceedings of The Web Conference,pp\. 1679–1690\.External Links:[Document](https://dx.doi.org/10.1145/3308558.3313402)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- N\. Shinn, F\. Cassano, A\. Gopinath, K\. Narasimhan, and S\. Yao \(2023\)Reflexion: language agents with verbal reinforcement learning\.InAdvances in Neural Information Processing Systems,External Links:[Link](https://arxiv.org/abs/2303.11366)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- M\. Shridhar, J\. Thomason, D\. Gordon, Y\. Bisk, W\. Han, R\. Mottaghi, L\. Zettlemoyer, and D\. Fox \(2020\)ALFRED: a benchmark for interpreting grounded instructions for everyday tasks\.InProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition,pp\. 10740–10749\.Cited by:[Appendix D](https://arxiv.org/html/2608.05604#A4.p3.1)\.
- M\. Shridhar, X\. Yuan, M\. Cote, Y\. Bisk, A\. Trischler, and M\. Hausknecht \(2021\)ALFWorld: aligning text and embodied environments for interactive learning\.InInternational Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=0IOX0YcCdTn)Cited by:[Appendix D](https://arxiv.org/html/2608.05604#A4.p3.1),[Table 1](https://arxiv.org/html/2608.05604#S4.T1.60.60.61.4)\.
- W\. Su, J\. Long, Q\. Ai, Y\. Tang, C\. Wang, Y\. Tu, and Y\. Liu \(2026\)Skill retrieval augmentation for agentic ai\.arXiv preprint arXiv:2604\.24594\.External Links:[Link](https://arxiv.org/abs/2604.24594)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- X\. Tan, X\. Wang, Q\. Liu, X\. Xu, X\. Yuan, and W\. Zhang \(2025\)Paths\-over\-graph: knowledge graph empowered large language model reasoning\.InProceedings of the ACM on Web Conference 2025,pp\. 3505–3522\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1)\.
- Y\. Tian, R\. A\. Hankins, and J\. M\. Patel \(2008\)Efficient aggregation for graph summarization\.InProceedings of the 2008 ACM SIGMOD International Conference on Management of Data,pp\. 567–580\.External Links:[Document](https://dx.doi.org/10.1145/1376616.1376675)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- C\. Wang, W\. Su, Q\. Ai, Y\. Tang, R\. Qiao, X\. Li, M\. Zhang, and Y\. Liu \(2026\)Adaptive multi\-resolution procedural knowledge compression for large language models\.arXiv preprint arXiv:2606\.12203\.External Links:[Link](https://arxiv.org/abs/2606.12203)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§1](https://arxiv.org/html/2608.05604#S1.p5.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- G\. Wang, Y\. Xie, Y\. Jiang, A\. Mandlekar, C\. Xiao, Y\. Zhu, L\. Fan, and A\. Anandkumar \(2023\)Voyager: an open\-ended embodied agent with large language models\.arXiv preprint arXiv:2305\.16291\.External Links:[Link](https://arxiv.org/abs/2305.16291)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- Z\. Z\. Wang, J\. Mao, D\. Fried, and G\. Neubig \(2024\)Agent workflow memory\.arXiv preprint arXiv:2409\.07429\.External Links:[Link](https://arxiv.org/abs/2409.07429)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- P\. Wu, M\. Zhang, K\. Wan, W\. Zhao, K\. He, X\. Du, and Z\. Chen \(2026\)HiPRAG: hierarchical process rewards for efficient agentic retrieval augmented generation\.International Conference on Learning Representations\.External Links:[Link](https://openreview.net/forum?id=Gt4v9WBPzm)Cited by:[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- T\. Xia, L\. Hu, Y\. Sun, M\. Xu, L\. Xu, S\. Wang, W\. Xu, and J\. Jiang \(2026\)GraSP: graph\-structured skill compositions for llm agents\.arXiv preprint arXiv:2604\.17870\.External Links:[Link](https://arxiv.org/abs/2604.17870)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- Z\. Xianget al\.\(2026\)When to use graphs in rag: a comprehensive analysis for graph retrieval\-augmented generation\.International Conference on Learning Representations\.External Links:[Link](https://openreview.net/forum?id=i9q9xDMjG7)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- Q\. Xing, Y\. Chen, Y\. Jin, Z\. Wu, B\. Lin, H\. Zhou, X\. Chen, H\. Chen, and Z\. Xiong \(2026\)What should a skill remember? quality–cost trade\-offs in cost\-aware skill rewriting for language model agents\.arXiv preprint arXiv:2606\.09421\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§1](https://arxiv.org/html/2608.05604#S1.p5.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- R\. Xu and Y\. Yan \(2026\)Agent skills for large language models: architecture, acquisition, security, and the path forward\.arXiv preprint arXiv:2602\.12430\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§1](https://arxiv.org/html/2608.05604#S1.p1.1),[§1](https://arxiv.org/html/2608.05604#S1.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- X\. Yan and J\. Han \(2002\)gSpan: graph\-based substructure pattern mining\.InProceedings of the 2002 IEEE International Conference on Data Mining,pp\. 721–724\.External Links:[Document](https://dx.doi.org/10.1109/ICDM.2002.1184038)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- S\. Yao, J\. Zhao, D\. Yu, I\. Shafran, K\. R\. Narasimhan, and Y\. Cao \(2022\)React: synergizing reasoning and acting in language models\.InNeurIPS 2022 Foundation Models for Decision Making Workshop,Cited by:[Appendix D](https://arxiv.org/html/2608.05604#A4.p9.1),[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§1](https://arxiv.org/html/2608.05604#S1.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- K\. Zenget al\.\(2026\)Group of skills: group\-structured skill retrieval for agent skill libraries\.arXiv preprint arXiv:2605\.06978\.External Links:[Link](https://arxiv.org/abs/2605.06978)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p2.1),[§1](https://arxiv.org/html/2608.05604#S1.p4.1),[§2](https://arxiv.org/html/2608.05604#S2.p2.1)\.
- G\. Zhang, M\. Fu, and S\. Yan \(2026a\)MemGen: weaving generative latent memory for self\-evolving agents\.International Conference on Learning Representations\.External Links:[Link](https://openreview.net/forum?id=vI56m4Iu4e)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- X\. Zhang, G\. Wang, Y\. Cui, W\. Qiu, Z\. Li, B\. Zhu, and P\. He \(2026b\)Experience compression spectrum: unifying memory, skills, and rules in llm agents\.arXiv preprint arXiv:2604\.15877\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.
- A\. Zhao, D\. Huang, Q\. Xu, M\. Lin, Y\. Liu, and G\. Huang \(2024\)ExpeL: LLM agents are experiential learners\.InProceedings of the AAAI Conference on Artificial Intelligence,External Links:[Link](https://arxiv.org/abs/2308.10144)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- B\. Zheng, M\. Y\. Fatemi, X\. Jin, Z\. Z\. Wang, A\. Gandhi, Y\. Song, Y\. Gu, J\. Srinivasa, G\. Liu, G\. Neubig, and Y\. Su \(2025\)SkillWeaver: web agents can self\-improve by discovering and honing skills\.arXiv preprint arXiv:2504\.07079\.External Links:[Link](https://arxiv.org/abs/2504.07079)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- Y\. Zhouet al\.\(2026a\)Benchmarking skill generation pipelines for llm agents\.arXiv preprint arXiv:2605\.18693\.External Links:[Link](https://arxiv.org/abs/2605.18693)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- Y\. Zhou \(2026\)A comprehensive survey on agent skills: taxonomy, techniques, and applications\.Techniques, and Applications \(April 27, 2026\)\.Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p1.1),[§2](https://arxiv.org/html/2608.05604#S2.p1.1)\.
- Z\. Zhouet al\.\(2026b\)MEM1: learning to synergize memory and reasoning for efficient long\-horizon agents\.International Conference on Learning Representations\.External Links:[Link](https://openreview.net/forum?id=XY8AaxDSLb)Cited by:[Appendix E](https://arxiv.org/html/2608.05604#A5.p3.1),[§2](https://arxiv.org/html/2608.05604#S2.p3.1)\.

## Appendix Outline

## Appendix AAlgorithm

### A\.1\.SkillZip Workflow

We summarize the full SkillZip pipeline in Algorithm[1](https://arxiv.org/html/2608.05604#algorithm1)\. The workflow first builds a raw section graph, then compresses repeated procedural motifs, hydrates a task\-specific execution context, and updates the compressed library when new skills or execution traces arrive\. Colored badges indicate operation types:Blue\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries Blue\}\}\}\}\\nolimitsdenotes section parsing and section\-graph construction,Orange\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries Orange\}\}\}\}\\nolimitsdenotes motif mining and macro\-compression,Purple\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries Purple\}\}\}\}\\nolimitsdenotes task\-time hydration and context rendering,Red\\mathop\{\\text\{\\fcolorbox\{warnred\}\{white\}\{\\textcolor\{warnred\}\{\\scriptsize\\sffamily\\bfseries Red\}\}\}\}\\nolimitsdenotes incremental update and risk maintenance,Green\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries Green\}\}\}\}\\nolimitsdenotes contract checking and verifier\-related validation, andGray\\mathop\{\\text\{\\fcolorbox\{darkgray\}\{white\}\{\\textcolor\{darkgray\}\{\\scriptsize\\sffamily\\bfseries Gray\}\}\}\}\\nolimitsdenotes evaluation or logging operations\.

Input:Skill library𝒮\\mathcal\{S\}, update stream𝒰\\mathcal\{U\}, queryqq, profilepp, budgetBB

Output:Hydrated context

CqC\_\{q\}, hydration log

ℒq\\mathcal\{L\}\_\{q\}, compressed graph

𝒢z​i​p\\mathcal\{G\}\_\{zip\}
/\*Stage 1: Sec2Graph: Building Procedural Subgraphs\*/

𝒢←∅,ℳ←∅,ℬr​e​s←∅,Σ←∅\\mathcal\{G\}\\leftarrow\\emptyset,\\ \\mathcal\{M\}\\leftarrow\\emptyset,\\ \\mathcal\{B\}\_\{res\}\\leftarrow\\emptyset,\\ \\Sigma\\leftarrow\\emptyset;

for each*skill packages∈𝒮s\\in\\mathcal\{S\}*dohs←Sec2Graph\(s\)h\_\{s\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries Sec2Graph\}\}\}\}\\nolimits\(s\);

𝒢←MergeSkillGraph\(𝒢,hs\)\\mathcal\{G\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries MergeSkillGraph\}\}\}\}\\nolimits\(\\mathcal\{G\},h\_\{s\}\);

1mm/\*Phase: Cross\-skill reuse\*/

𝒢←LinkCanonicalPrototypes\(𝒢\)\\mathcal\{G\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries LinkCanonicalPrototypes\}\}\}\}\\nolimits\(\\mathcal\{G\}\);

1mm/\*Stage 2: MotifZip: Contract\-Preserving Compression\*/

\(𝒢z​i​p,ℳ\)←MotifZip\(𝒢\)\(\\mathcal\{G\}\_\{zip\},\\mathcal\{M\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries MotifZip\}\}\}\}\\nolimits\(\\mathcal\{G\}\);

1mm/\*Stage 3: PathHydrate: Budgeted Executable Context\*/

\(Cq,ℒq\)←PathHydrate\(q,p,B,𝒢z​i​p,ℳ\)\(C\_\{q\},\\mathcal\{L\}\_\{q\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries PathHydrate\}\}\}\}\\nolimits\(q,p,B,\\mathcal\{G\}\_\{zip\},\\mathcal\{M\}\);

1mm/\*Stage 4: ReZip: Incremental Library Maintenance\*/

𝒰r​u​n←𝒰\\mathcal\{U\}\_\{run\}\\leftarrow\\mathcal\{U\};

𝒵←\(𝒢z​i​p,ℳ,ℬr​e​s,Σ\)\\mathcal\{Z\}\\leftarrow\(\\mathcal\{G\}\_\{zip\},\\mathcal\{M\},\\mathcal\{B\}\_\{res\},\\Sigma\);

for each*new skill or execution traceu∈𝒰r​u​nu\\in\\mathcal\{U\}\_\{run\}*do𝒵←ReZip\(𝒵,u\)\\mathcal\{Z\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{warnred\}\{white\}\{\\textcolor\{warnred\}\{\\scriptsize\\sffamily\\bfseries ReZip\}\}\}\}\\nolimits\(\\mathcal\{Z\},u\);

\(𝒢z​i​p,ℳ,ℬr​e​s,Σ\)←𝒵\(\\mathcal\{G\}\_\{zip\},\\mathcal\{M\},\\mathcal\{B\}\_\{res\},\\Sigma\)\\leftarrow\\mathcal\{Z\};

return

Cq,ℒq,𝒢z​i​pC\_\{q\},\\mathcal\{L\}\_\{q\},\\mathcal\{G\}\_\{zip\};

Algorithm 1SkillZip Workflow
### A\.2\.Sec2Graph

Algorithm[2](https://arxiv.org/html/2608.05604#algorithm2)details howSec2Graph\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries Sec2Graph\}\}\}\}\\nolimitsconverts one skill package into a typed procedural graph\. The key idea is to keep all execution roles explicit: each section carries a role, input/output signature, resource reference, guard or verifier condition, and source pointer\.

Input:Skill packagesswith markdown, scripts, schemas, tests, and resources

Output:Skill procedural subgraph

hs=\(Vs,Es,rs,ts\)h\_\{s\}=\(V\_\{s\},E\_\{s\},r\_\{s\},t\_\{s\}\)
/\*Phase: Section grounding\*/

ℬ←SegmentSkill\(s\)\\mathcal\{B\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries SegmentSkill\}\}\}\}\\nolimits\(s\);

Vs←∅,Es←∅V\_\{s\}\\leftarrow\\emptyset,\\ E\_\{s\}\\leftarrow\\emptyset;

for each*candidate spanb∈ℬb\\in\\mathcal\{B\}*doτb←InferRole\(b\)\\tau\_\{b\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries InferRole\}\}\}\}\\nolimits\(b\);

1mm/\*Phase: Contract extraction\*/

\(Xb,Yb\)←ExtractSignature\(b\)\(X\_\{b\},Y\_\{b\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries ExtractSignature\}\}\}\}\\nolimits\(b\);

Rb←ExtractResources\(b,s\)R\_\{b\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries ExtractResources\}\}\}\}\\nolimits\(b,s\);

Gb←ExtractGuardsVerifiers\(b\)G\_\{b\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries ExtractGuardsVerifiers\}\}\}\}\\nolimits\(b\);

vb←⟨τb,b,Xb,Yb,Rb,Gb,srcb⟩v\_\{b\}\\leftarrow\\langle\\tau\_\{b\},b,X\_\{b\},Y\_\{b\},R\_\{b\},G\_\{b\},\\mathrm\{src\}\_\{b\}\\rangle;

Vs←Vs∪\{vb\}V\_\{s\}\\leftarrow V\_\{s\}\\cup\\\{v\_\{b\}\\\};

1mm/\*Phase: Procedural subgraph construction\*/

Es←Es∪WeakOrderEdges\(Vs\)E\_\{s\}\\leftarrow E\_\{s\}\\cup\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries WeakOrderEdges\}\}\}\}\\nolimits\(V\_\{s\}\);

for each*operation nodev∈Vsv\\in V\_\{s\}*doEs←Es∪BindInputs\(v,Vs\)E\_\{s\}\\leftarrow E\_\{s\}\\cup\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries BindInputs\}\}\}\}\\nolimits\(v,V\_\{s\}\);

Es←Es∪AttachRequirements\(v,Vs\)E\_\{s\}\\leftarrow E\_\{s\}\\cup\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries AttachRequirements\}\}\}\}\\nolimits\(v,V\_\{s\}\);

Es←Es∪AttachVerifiers\(v,Vs\)E\_\{s\}\\leftarrow E\_\{s\}\\cup\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries AttachVerifiers\}\}\}\}\\nolimits\(v,V\_\{s\}\);

Es←Es∪AttachRepairs\(v,Vs\)E\_\{s\}\\leftarrow E\_\{s\}\\cup\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries AttachRepairs\}\}\}\}\\nolimits\(v,V\_\{s\}\);

Es←Es∪SkillMembership\(s,Vs\)E\_\{s\}\\leftarrow E\_\{s\}\\cup\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries SkillMembership\}\}\}\}\\nolimits\(s,V\_\{s\}\);

\(rs,ts\)←SelectEndpoints\(Vs,Es\)\(r\_\{s\},t\_\{s\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries SelectEndpoints\}\}\}\}\\nolimits\(V\_\{s\},E\_\{s\}\);

return

\(Vs,Es,rs,ts\)\(V\_\{s\},E\_\{s\},r\_\{s\},t\_\{s\}\);

Algorithm 2Sec2GraphSegmentSkill\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries SegmentSkill\}\}\}\}\\nolimitsuses headings, lists, code blocks, tool references, test files, and warning phrases to create high\-recall section candidates\.AttachVerifiers\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries AttachVerifiers\}\}\}\}\\nolimitsis deliberately conservative: an operation is linked only to verifiers that can be reached through the skill order, explicit tests, or matching output signatures\.

### A\.3\.MotifZip

Algorithm[3](https://arxiv.org/html/2608.05604#algorithm3)gives the contract\-preserving compression procedure used byMotifZip\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries MotifZip\}\}\}\}\\nolimits\. The algorithm does not cluster text spans directly\. It first searches within compatible typed signatures, then accepts a motif only if its boundary, contract, and verifier paths remain valid after replacement\.

Input:Raw section graph𝒢\\mathcal\{G\}, minimum supportmm, candidate budgetKK

Output:Compressed graph

𝒢z​i​p\\mathcal\{G\}\_\{zip\}, macro dictionary

ℳ\\mathcal\{M\}
/\*Phase: Interface\-aware motif mining\*/

𝒞←∅,𝒜z​i​p←∅,ℳ←∅\\mathcal\{C\}\\leftarrow\\emptyset,\\ \\mathcal\{A\}\_\{zip\}\\leftarrow\\emptyset,\\ \\mathcal\{M\}\\leftarrow\\emptyset;

ℬ←BucketBySignature\(𝒢\)\\mathcal\{B\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries BucketBySignature\}\}\}\}\\nolimits\(\\mathcal\{G\}\);

for each*bucketBi∈ℬB\_\{i\}\\in\\mathcal\{B\}*do𝒞←𝒞∪GrowMotifs\(Bi,𝒢\)\\mathcal\{C\}\\leftarrow\\mathcal\{C\}\\cup\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries GrowMotifs\}\}\}\}\\nolimits\(B\_\{i\},\\mathcal\{G\}\);

𝒞←\\mathcal\{C\}\\leftarrowtop\-

KKcandidates ranked by support and preliminary gain;

1mm/\*Phase: Contract\-preserving grammar construction\*/

𝒜z​i​p←∅\\mathcal\{A\}\_\{zip\}\\leftarrow\\emptyset;

for each*candidate motifg∈𝒞g\\in\\mathcal\{C\}*doΩg←FindOccurrences\(g,𝒢\)\\Omega\_\{g\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries FindOccurrences\}\}\}\}\\nolimits\(g,\\mathcal\{G\}\);

if

\|Ωg\|<m\|\\Omega\_\{g\}\|<mthen continue;

\(Ig,Og,χg\)←BuildContract\(g,Ωg\)\(I\_\{g\},O\_\{g\},\\chi\_\{g\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries BuildContract\}\}\}\}\\nolimits\(g,\\Omega\_\{g\}\);

if

BoundaryClear\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries BoundaryClear\}\}\}\}\\nolimits\(Ig,Og\)=false\(I\_\{g\},O\_\{g\}\)=\\mathrm\{false\}then continue;

if

SignatureStable\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries SignatureStable\}\}\}\}\\nolimits\(χg,Ωg\)=false\(\\chi\_\{g\},\\Omega\_\{g\}\)=\\mathrm\{false\}then continue;

if

DependencyClosed\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries DependencyClosed\}\}\}\}\\nolimits\(g,χg,𝒢\)=false\(g,\\chi\_\{g\},\\mathcal\{G\}\)=\\mathrm\{false\}then continue;

if

VerifierReachable\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries VerifierReachable\}\}\}\}\\nolimits\(g,χg,𝒢\)=false\(g,\\chi\_\{g\},\\mathcal\{G\}\)=\\mathrm\{false\}then continue;

Δ​\(g\)←CompressionGain\(g,Ωg,χg\)\\Delta\(g\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries CompressionGain\}\}\}\}\\nolimits\(g,\\Omega\_\{g\},\\chi\_\{g\}\);

if

Δ​\(g\)≤0\\Delta\(g\)\\leq 0then continue;

𝒜z​i​p←𝒜z​i​p∪\{\(g,Ωg,Ig,Og,χg,Δ​\(g\)\)\}\\mathcal\{A\}\_\{zip\}\\leftarrow\\mathcal\{A\}\_\{zip\}\\cup\\\{\(g,\\Omega\_\{g\},I\_\{g\},O\_\{g\},\\chi\_\{g\},\\Delta\(g\)\)\\\};

1mm/\*Phase: Macro selection and representation\*/

𝒜z​i​p←\\mathcal\{A\}\_\{zip\}\\leftarrowmotifs in descending

Δ​\(g\)\\Delta\(g\);

1mm/\*Phase: Graph grammar rule\*/

𝒢z​i​p←𝒢\\mathcal\{G\}\_\{zip\}\\leftarrow\\mathcal\{G\};

for each*\(g,Ωg,Ig,Og,χg,Δ​\(g\)\)∈𝒜z​i​p\(g,\\Omega\_\{g\},I\_\{g\},O\_\{g\},\\chi\_\{g\},\\Delta\(g\)\)\\in\\mathcal\{A\}\_\{zip\}*doif**NoConflict*\(g,ℳ\)\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries NoConflict\}\}\}\}\\nolimits\(g,\\mathcal\{M\}\)*thenMg←CreateMacro\(g,Ωg,Ig,Og,χg\)M\_\{g\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries CreateMacro\}\}\}\}\\nolimits\(g,\\Omega\_\{g\},I\_\{g\},O\_\{g\},\\chi\_\{g\}\);

𝒢z​i​p←ReplaceOccurrences\(𝒢z​i​p,Ωg,Mg\)\\mathcal\{G\}\_\{zip\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries ReplaceOccurrences\}\}\}\}\\nolimits\(\\mathcal\{G\}\_\{zip\},\\Omega\_\{g\},M\_\{g\}\);

ℳ←ℳ∪\{Mg\}\\mathcal\{M\}\\leftarrow\\mathcal\{M\}\\cup\\\{M\_\{g\}\\\};

return

𝒢z​i​p,ℳ\\mathcal\{G\}\_\{zip\},\\mathcal\{M\};

Algorithm 3MotifZipBoundaryClear\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries BoundaryClear\}\}\}\}\\nolimitsensures that the macro exposes the same external inputs and outputs as the source motif\.DependencyClosed\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries DependencyClosed\}\}\}\}\\nolimitschecks that every cut dependency is represented by a macro port or remains internal to the macro\.VerifierReachable\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries VerifierReachable\}\}\}\}\\nolimitsensures that state\-changing operations still have an internal or downstream verifier after compression\. These checks are what make the macro a reversible procedural rewrite rather than a lossy summary\. Operationally, anOperationsection is treated as state\-changing when its extracted contract declares an output write, a mutation of an external resource or environment, or a persistent tool\-side effect\. If the effect metadata are missing or ambiguous, MotifZip conservatively treats the operation as state\-changing and requires a reachable verifier before compression\. TheRisk​\(g\)\\mathrm\{Risk\}\(g\)term inCompressionGain\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries CompressionGain\}\}\}\}\\nolimitsis evaluated only after these validity checks\. It increases for otherwise compatible occurrences with missing or underspecified guards and resources, incomplete I/O bindings, or weak verifier support\. Contradictory signatures or verifier bindings are not traded against compression gain:SignatureStable\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries SignatureStable\}\}\}\}\\nolimitsrejects them before scoring, so the corresponding source occurrences remain explicit and available for source\-level hydration\.

### A\.4\.PathHydrate

Algorithm[4](https://arxiv.org/html/2608.05604#algorithm4)shows howPathHydrate\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries PathHydrate\}\}\}\}\\nolimitsturns the compressed graph into a task\-specific context\. The runtime implementation first constructs task\-aware anchors, maps them to section seeds, concentrates the seeds with fused skill evidence, and then compiles a connected executable context with scaffolds, pruning, filling, closure repair, and macro\-level rendering decisions\.

Input:Queryqq, profilepp, budgetBB, compressed graph𝒢z​i​p\\mathcal\{G\}\_\{zip\}, macro dictionaryℳ\\mathcal\{M\}

Output:Rendered execution context

CqC\_\{q\}and hydration log

ℒq\\mathcal\{L\}\_\{q\}
/\*Phase: Task anchoring\*/

zq←AnalyzeTask\(q,p\)z\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries AnalyzeTask\}\}\}\}\\nolimits\(q,p\);

𝒬q←BuildSeedQueries\(zq,q\)\\mathcal\{Q\}\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries BuildSeedQueries\}\}\}\}\\nolimits\(z\_\{q\},q\);

1mm/\*Phase: Dual\-level seed fusion\*/

𝒜q←∅\\mathcal\{A\}\_\{q\}\\leftarrow\\emptyset;

for each*retrieval queryr∈𝒬qr\\in\\mathcal\{Q\}\_\{q\}*doSr​\(v\)←DenseSectionScore\(r,q,v\)S\_\{r\}\(v\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries DenseSectionScore\}\}\}\}\\nolimits\(r,q,v\)forv∈𝒢z​i​pv\\in\\mathcal\{G\}\_\{zip\};

𝒜q←𝒜q∪AdaptiveTopSeeds\(Sr\)\\mathcal\{A\}\_\{q\}\\leftarrow\\mathcal\{A\}\_\{q\}\\cup\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries AdaptiveTopSeeds\}\}\}\}\\nolimits\(S\_\{r\}\);

Rd​o​c←RankSkillDocs\(zq,q,𝒢z​i​p\)R\_\{doc\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries RankSkillDocs\}\}\}\}\\nolimits\(z\_\{q\},q,\\mathcal\{G\}\_\{zip\}\);

Rn​o​d​e←RankSkillsByNodeMax\(𝒜q,𝒢z​i​p\)R\_\{node\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries RankSkillsByNodeMax\}\}\}\}\\nolimits\(\\mathcal\{A\}\_\{q\},\\mathcal\{G\}\_\{zip\}\);

𝒦q←RRFConcentrate\(Rd​o​c,Rn​o​d​e\)\\mathcal\{K\}\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries RRFConcentrate\}\}\}\}\\nolimits\(R\_\{doc\},R\_\{node\}\);

𝒜q←ConcentrateSeeds\(𝒜q,𝒦q\)\\mathcal\{A\}\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries ConcentrateSeeds\}\}\}\}\\nolimits\(\\mathcal\{A\}\_\{q\},\\mathcal\{K\}\_\{q\}\);

1mm/\*Phase: Constrained subgraph search\*/

P←ConnectSeeds\(𝒜q,𝒢z​i​p,q\)P\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries ConnectSeeds\}\}\}\}\\nolimits\(\\mathcal\{A\}\_\{q\},\\mathcal\{G\}\_\{zip\},q\);

1mm/\*Phase: Scaffold repair and context filling\*/

P←AttachScaffold\(P,𝒢z​i​p\)P\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries AttachScaffold\}\}\}\}\\nolimits\(P,\\mathcal\{G\}\_\{zip\}\);

P←AttachReachableVerifiers\(P,𝒢z​i​p\)P\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries AttachReachableVerifiers\}\}\}\}\\nolimits\(P,\\mathcal\{G\}\_\{zip\}\);

P←RescorePrune\(P,zq,q,B\)P\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries RescorePrune\}\}\}\}\\nolimits\(P,z\_\{q\},q,B\);

P←RoleBudgetPrune\(P\)P\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries RoleBudgetPrune\}\}\}\}\\nolimits\(P\);

P←BreadthFill\(P,𝒦q,𝒢z​i​p,q,B\)P\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries BreadthFill\}\}\}\}\\nolimits\(P,\\mathcal\{K\}\_\{q\},\\mathcal\{G\}\_\{zip\},q,B\);

P←DepthFill\(P,𝒢z​i​p,q,B\)P\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries DepthFill\}\}\}\}\\nolimits\(P,\\mathcal\{G\}\_\{zip\},q,B\);

\(P,ξq\)←RepairClosure\(P,𝒢z​i​p,B\)\(P,\\xi\_\{q\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries RepairClosure\}\}\}\}\\nolimits\(P,\\mathcal\{G\}\_\{zip\},B\);

P←EnforceBudget\(P,ξq,B\)P\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries EnforceBudget\}\}\}\}\\nolimits\(P,\\xi\_\{q\},B\);

1mm/\*Phase: Macro\-level hydration\*/

U←ChooseMacroRenderLevels\(P,ℳ,ξq\)U\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries ChooseMacroRenderLevels\}\}\}\}\\nolimits\(P,\\mathcal\{M\},\\xi\_\{q\}\);

1mm/\*Phase: Execution\-context rendering\*/

Cq←RenderContract\(U,p,B\)C\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries RenderContract\}\}\}\}\\nolimits\(U,p,B\);

ℒq←RecordHydration\(q,zq,P,U,Cq,ℳ,ξq\)\\mathcal\{L\}\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries RecordHydration\}\}\}\}\\nolimits\(q,z\_\{q\},P,U,C\_\{q\},\\mathcal\{M\},\\xi\_\{q\}\);

return

Cq,ℒqC\_\{q\},\\mathcal\{L\}\_\{q\};

Algorithm 4PathHydrateAttachScaffold\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries AttachScaffold\}\}\}\}\\nolimitsadds the same\-skill input, precondition, resource, failure, verifier, and output companions around selected operations\.BreadthFill\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries BreadthFill\}\}\}\}\\nolimitsuses fused skill\-level evidence to cover multi\-skill tasks, whileDepthFill\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries DepthFill\}\}\}\}\\nolimitsuses remaining budget to add useful sections from the dominant skill\. Both filling procedures return early once the selected context covers the task anchors, closes required dependencies, and keeps a verifier reachable; they do not exhaust the remaining budget by default\.RepairClosure\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries RepairClosure\}\}\}\}\\nolimitsrestores pruned dependencies or verifier hooks when possible and records any infeasible role inξq\\xi\_\{q\}\.ChooseMacroRenderLevels\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries ChooseMacroRenderLevels\}\}\}\}\\nolimitskeeps the original progressive\-hydration interface: a macro can be rendered as name, contract, outline, or full source when its contract is sufficient\.

### A\.5\.ReZip

Algorithm[5](https://arxiv.org/html/2608.05604#algorithm5)maintains the compressed library under two update signals\. New skills are assimilated through existing macros before residual motifs are considered for promotion; execution traces revise macros that repeatedly require expansion or cause downstream failures\.

Input:Library state𝒵t=\(𝒢z​i​pt,ℳt,ℬr​e​st,Σt\)\\mathcal\{Z\}\_\{t\}=\(\\mathcal\{G\}\_\{zip\}^\{t\},\\mathcal\{M\}\_\{t\},\\mathcal\{B\}\_\{res\}^\{t\},\\Sigma\_\{t\}\), update eventutu\_\{t\}

Output:Updated library state

𝒵t\+1\\mathcal\{Z\}\_\{t\+1\}
if*utu\_\{t\}is a new skill package*then/\*Phase: New\-skill assimilation\*/

hut←Sec2Graph\(ut\)h\_\{u\_\{t\}\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{kgblue\}\{white\}\{\\textcolor\{kgblue\}\{\\scriptsize\\sffamily\\bfseries Sec2Graph\}\}\}\}\\nolimits\(u\_\{t\}\);

Ω←MatchMacros\(hut,ℳt\)\\Omega\\leftarrow\\mathop\{\\text\{\\fcolorbox\{warnred\}\{white\}\{\\textcolor\{warnred\}\{\\scriptsize\\sffamily\\bfseries MatchMacros\}\}\}\}\\nolimits\(h\_\{u\_\{t\}\},\\mathcal\{M\}\_\{t\}\);

\(hut′,ℛut\)←AssimilateSkill\(hut,Ω\)\(h^\{\\prime\}\_\{u\_\{t\}\},\\mathcal\{R\}\_\{u\_\{t\}\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{warnred\}\{white\}\{\\textcolor\{warnred\}\{\\scriptsize\\sffamily\\bfseries AssimilateSkill\}\}\}\}\\nolimits\(h\_\{u\_\{t\}\},\\Omega\);

𝒢z​i​pt←InsertSkill\(𝒢z​i​pt,hut′\)\\mathcal\{G\}\_\{zip\}^\{t\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{warnred\}\{white\}\{\\textcolor\{warnred\}\{\\scriptsize\\sffamily\\bfseries InsertSkill\}\}\}\}\\nolimits\(\\mathcal\{G\}\_\{zip\}^\{t\},h^\{\\prime\}\_\{u\_\{t\}\}\);

ℬr​e​st←ℬr​e​st∪ℛut\\mathcal\{B\}\_\{res\}^\{t\}\\leftarrow\\mathcal\{B\}\_\{res\}^\{t\}\\cup\\mathcal\{R\}\_\{u\_\{t\}\};

for each*residual motifr∈ℬr​e​str\\in\\mathcal\{B\}\_\{res\}^\{t\}*doif*suppt⁡\(r\)≥m\\operatorname\{supp\}\_\{t\}\(r\)\\geq mandΔ​\(r\)\>0\\Delta\(r\)\>0andValidχ​\(r\)\\mathrm\{Valid\}\_\{\\chi\}\(r\)*thenMr←CreateMacro\(r,ℬr​e​st\)M\_\{r\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries CreateMacro\}\}\}\}\\nolimits\(r,\\mathcal\{B\}\_\{res\}^\{t\}\);

ℳt←ℳt∪\{Mr\}\\mathcal\{M\}\_\{t\}\\leftarrow\\mathcal\{M\}\_\{t\}\\cup\\\{M\_\{r\}\\\};

𝒢z​i​pt←ReplaceOccurrences\(𝒢z​i​pt,r,Mr\)\\mathcal\{G\}\_\{zip\}^\{t\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries ReplaceOccurrences\}\}\}\}\\nolimits\(\\mathcal\{G\}\_\{zip\}^\{t\},r,M\_\{r\}\);

ℬr​e​st←ℬr​e​st∖Occt⁡\(r\)\\mathcal\{B\}\_\{res\}^\{t\}\\leftarrow\\mathcal\{B\}\_\{res\}^\{t\}\\setminus\\operatorname\{Occ\}\_\{t\}\(r\);

if*utu\_\{t\}is an execution trace*then/\*Phase: Execution\-aware macro revision\*/

Σt←UpdateMacroStats\(Σt,ℳt,ut\)\\Sigma\_\{t\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{warnred\}\{white\}\{\\textcolor\{warnred\}\{\\scriptsize\\sffamily\\bfseries UpdateMacroStats\}\}\}\}\\nolimits\(\\Sigma\_\{t\},\\mathcal\{M\}\_\{t\},u\_\{t\}\);

for each*macroM∈ℳtM\\in\\mathcal\{M\}\_\{t\}*doρt​\(M\)←MacroRisk\(Σt​\(M\)\)\\rho\_\{t\}\(M\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{warnred\}\{white\}\{\\textcolor\{warnred\}\{\\scriptsize\\sffamily\\bfseries MacroRisk\}\}\}\}\\nolimits\(\\Sigma\_\{t\}\(M\)\);

if*ρt​\(M\)≥η\\rho\_\{t\}\(M\)\\geq\\eta*then\(𝒢z​i​pt,ℳt,Σt\)←ReviseMacro\(M,𝒢z​i​pt,ℳt,Σt\)\(\\mathcal\{G\}\_\{zip\}^\{t\},\\mathcal\{M\}\_\{t\},\\Sigma\_\{t\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{warnred\}\{white\}\{\\textcolor\{warnred\}\{\\scriptsize\\sffamily\\bfseries ReviseMacro\}\}\}\}\\nolimits\(M,\\mathcal\{G\}\_\{zip\}^\{t\},\\mathcal\{M\}\_\{t\},\\Sigma\_\{t\}\);

𝒵t\+1←\(𝒢z​i​pt,ℳt,ℬr​e​st,Σt\)\\mathcal\{Z\}\_\{t\+1\}\\leftarrow\(\\mathcal\{G\}\_\{zip\}^\{t\},\\mathcal\{M\}\_\{t\},\\mathcal\{B\}\_\{res\}^\{t\},\\Sigma\_\{t\}\);

return

𝒵t\+1\\mathcal\{Z\}\_\{t\+1\};

Algorithm 5ReZipValidContract\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries ValidContract\}\}\}\}\\nolimitsapplies the same port, dependency\-closure, and verifier tests asMotifZip\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries MotifZip\}\}\}\}\\nolimits\.ReviseMacro\\mathop\{\\text\{\\fcolorbox\{warnred\}\{white\}\{\\textcolor\{warnred\}\{\\scriptsize\\sffamily\\bfseries ReviseMacro\}\}\}\}\\nolimitsincreases hydration detail before splitting or retiring a macro, retains its source expansion rule, and resets the evidence associated with the revised rule\. The incremental update therefore preserves the same lifting invariant as offline compression\.

### A\.6\.Evaluation\-facing Metrics

Algorithm[6](https://arxiv.org/html/2608.05604#algorithm6)describes how the framework\-level logs are converted into the empirical quantities used in evaluation\. The algorithm is intentionally placed after the three main modules and ReZip: it does not add a new retrieval mechanism, but checks whether the compressed representation preserves the structural conditions claimed by SkillZip\.

Input:Evaluation queries𝒬\\mathcal\{Q\}, raw graph𝒢\\mathcal\{G\}, compressed graph𝒢z​i​p\\mathcal\{G\}\_\{zip\}, macro dictionaryℳ\\mathcal\{M\}, executor𝖤𝗑𝖾𝖼\\mathsf\{Exec\}, profilepp, budgetBB

Output:Per\-query evaluation log

ℒe​v​a​l\\mathcal\{L\}\_\{eval\}and aggregate report

ℛ\\mathcal\{R\}
/\*Phase: Initialize per\-query evaluation log\*/

ℒe​v​a​l←∅\\mathcal\{L\}\_\{eval\}\\leftarrow\\emptyset;

for each*queryq∈𝒬q\\in\\mathcal\{Q\}*do/\*Phase: Execute paired contexts\*/

\(Cq,ℒq\)←PathHydrate\(q,p,B,𝒢z​i​p,ℳ\)\(C\_\{q\},\\mathcal\{L\}\_\{q\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries PathHydrate\}\}\}\}\\nolimits\(q,p,B,\\mathcal\{G\}\_\{zip\},\\mathcal\{M\}\);

Cqf​u​l​l←RenderUncompressedContext\(q,𝒢\)C\_\{q\}^\{full\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{darkgray\}\{white\}\{\\textcolor\{darkgray\}\{\\scriptsize\\sffamily\\bfseries RenderUncompressedContext\}\}\}\}\\nolimits\(q,\\mathcal\{G\}\);

\(yq,τq\)←Execute\(𝖤𝗑𝖾𝖼,q,Cq\)\(y\_\{q\},\\tau\_\{q\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{darkgray\}\{white\}\{\\textcolor\{darkgray\}\{\\scriptsize\\sffamily\\bfseries Execute\}\}\}\}\\nolimits\(\\mathsf\{Exec\},q,C\_\{q\}\);

\(yqf​u​l​l,τqf​u​l​l\)←Execute\(𝖤𝗑𝖾𝖼,q,Cqf​u​l​l\)\(y\_\{q\}^\{full\},\\tau\_\{q\}^\{full\}\)\\leftarrow\\mathop\{\\text\{\\fcolorbox\{darkgray\}\{white\}\{\\textcolor\{darkgray\}\{\\scriptsize\\sffamily\\bfseries Execute\}\}\}\}\\nolimits\(\\mathsf\{Exec\},q,C\_\{q\}^\{full\}\);

1mm/\*Phase: Check structural preservation\*/

dq←EvalDepPreserve\(ℒq,𝒢\)d\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries EvalDepPreserve\}\}\}\}\\nolimits\(\\mathcal\{L\}\_\{q\},\\mathcal\{G\}\);

vq←EvalVerifierReach\(ℒq,𝒢z​i​p\)v\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{skillgreen\}\{white\}\{\\textcolor\{skillgreen\}\{\\scriptsize\\sffamily\\bfseries EvalVerifierReach\}\}\}\}\\nolimits\(\\mathcal\{L\}\_\{q\},\\mathcal\{G\}\_\{zip\}\);

mq←MacroExpansionRequired\(ℒq\)m\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{darkgray\}\{white\}\{\\textcolor\{darkgray\}\{\\scriptsize\\sffamily\\bfseries MacroExpansionRequired\}\}\}\}\\nolimits\(\\mathcal\{L\}\_\{q\}\);

fq←FullSourceFallback\(ℒq\)f\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{darkgray\}\{white\}\{\\textcolor\{darkgray\}\{\\scriptsize\\sffamily\\bfseries FullSourceFallback\}\}\}\}\\nolimits\(\\mathcal\{L\}\_\{q\}\);

iq←DownstreamInflation\(τq,τqf​u​l​l\)i\_\{q\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{darkgray\}\{white\}\{\\textcolor\{darkgray\}\{\\scriptsize\\sffamily\\bfseries DownstreamInflation\}\}\}\}\\nolimits\(\\tau\_\{q\},\\tau\_\{q\}^\{full\}\);

tq←1−TokenCost\(Cq\)/TokenCost\(Cqf​u​l​l\)t\_\{q\}\\leftarrow 1\-\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries TokenCost\}\}\}\}\\nolimits\(C\_\{q\}\)/\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries TokenCost\}\}\}\}\\nolimits\(C\_\{q\}^\{full\}\);

ℒe​v​a​l←ℒe​v​a​l∪\{\(q,yq,tq,dq,vq,mq,fq,iq\)\}\\mathcal\{L\}\_\{eval\}\\leftarrow\\mathcal\{L\}\_\{eval\}\\cup\\\{\(q,y\_\{q\},t\_\{q\},d\_\{q\},v\_\{q\},m\_\{q\},f\_\{q\},i\_\{q\}\)\\\};

1mm/\*Phase: Aggregate task and structural metrics\*/

ℛ←AggregateMetrics\(ℒe​v​a​l\)\\mathcal\{R\}\\leftarrow\\mathop\{\\text\{\\fcolorbox\{darkgray\}\{white\}\{\\textcolor\{darkgray\}\{\\scriptsize\\sffamily\\bfseries AggregateMetrics\}\}\}\}\\nolimits\(\\mathcal\{L\}\_\{eval\}\);

return

ℒe​v​a​l,ℛ\\mathcal\{L\}\_\{eval\},\\mathcal\{R\};

Algorithm 6EvaluateSkillZipAggregateMetrics\\mathop\{\\text\{\\fcolorbox\{darkgray\}\{white\}\{\\textcolor\{darkgray\}\{\\scriptsize\\sffamily\\bfseries AggregateMetrics\}\}\}\}\\nolimitsreports task success, token reduction, dependency preservation, verifier reachability, macro expansion, full\-source fallback, and downstream execution inflation\. The last five metrics are structural counterparts of the constraints enforced duringMotifZip\\mathop\{\\text\{\\fcolorbox\{evidenceorange\}\{white\}\{\\textcolor\{evidenceorange\}\{\\scriptsize\\sffamily\\bfseries MotifZip\}\}\}\}\\nolimitsandPathHydrate\\mathop\{\\text\{\\fcolorbox\{purplemem\}\{white\}\{\\textcolor\{purplemem\}\{\\scriptsize\\sffamily\\bfseries PathHydrate\}\}\}\}\\nolimits; they make it possible to test whether a compact context remains executable rather than merely shorter\. Downstream inflation compares paired compressed and uncompressed executions of the same task under the same executor seed\. We useJ​\(τ\)=nrepair​\(τ\)\+ntool​\(τ\)\+2​nvfail​\(τ\)J\(\\tau\)=n\_\{\\mathrm\{repair\}\}\(\\tau\)\+n\_\{\\mathrm\{tool\}\}\(\\tau\)\+2n\_\{\\mathrm\{vfail\}\}\(\\tau\)and report100​max⁡\{0,J​\(τq\)−J​\(τqf​u​l​l\)\}/max⁡\{1,J​\(τqf​u​l​l\)\}100\\max\\\{0,J\(\\tau\_\{q\}\)\-J\(\\tau\_\{q\}^\{full\}\)\\\}/\\max\\\{1,J\(\\tau\_\{q\}^\{full\}\)\\\}\. Macro expansion and full\-source fallback are aggregated as query\-level indicators, with fallback treated as a strict subset of expansion\.

## Appendix BAdditional Experiments

### B\.1\.Compression Fidelity and Contract Robustness

\(RQ5\) Does compression reduce active storage while limiting downstream recovery?We further audit the storage and execution cost of graph compression on the same 1K\-skill library\. The goal is to distinguish useful compression from compression that only makes the stored graph smaller by pushing missing information to downstream recovery\. Therefore, we jointly measure active storage, retained source packages, fallback expansion, and downstream inflation \(DI\)\. Active storage counts the graph representation and macro dictionary used during retrieval and hydration, while the original source packages remain available only for reversible expansion\. All representations reuse the same cached section contracts, so the comparison isolates representation and compression rather than LLM extraction\. As shown in Table[4](https://arxiv.org/html/2608.05604#A2.T4), SkillZip reduces active storage from 18\.6 MB to 5\.4 MB, corresponding to a 71\.0% reduction, while the 112\.4 MB source library remains unchanged for reversible expansion\. The gain therefore comes from a smaller active procedural representation rather than discarding source knowledge\. Exact\-text deduplication only reduces active storage to 13\.0 MB, whereas generic graph grammar reaches 6\.4 MB but raises fallback and DI to 14\.8% and 14\.6%, respectively\.

Contract validation prevents this storage gain from being repaid during execution\. Removing the checks saves only another 0\.5 MB, yet increases fallback from 7\.2% to 24\.7% and DI from 2\.7% to 23\.4%\. Thus, SkillZip achieves most of the available storage reduction while keeping downstream recovery low\. Appendix[B\.5](https://arxiv.org/html/2608.05604#A2.SS5)separately measures the local construction cost of obtaining this representation\.

Table 4\.Active\-storage compression and downstream recovery on the 1K\-skillSkillsBenchlibrary\. Source MB is retained for reversible expansion; DI is measured against raw\-graph execution\.RepresentationActive MB↓\\downarrowSource MBFallback \(%\)↓\\downarrowDI \(%\)↓\\downarrowRaw section graph18\.6112\.40\.00\.0Exact\-text dedup\.13\.0112\.42\.11\.8Generic graph grammar6\.4112\.414\.814\.6SkillZip w/o checks4\.9112\.424\.723\.4SkillZip5\.4112\.47\.22\.7

\(RQ6\) How robust is contract extraction?To evaluate whether contract extraction supports reliable procedural abstraction, we measure both field\-level extraction quality and downstream robustness under synthetic contract corruption\. We first compare the extracted interface, execution, verification, and provenance fields against human annotations\. We then remove or replace contract fields at increasing rates to trace how extraction errors propagate to structural fidelity, source recovery, and task reward\. Figure[3](https://arxiv.org/html/2608.05604#A2.F3)shows a macro\-average F1 of 91\.6 and exact match of 84\.6\. Source pointers are easiest to recover, reaching 96\.2 F1 and 93\.5 exact match, while preconditions and guards are most difficult at 88\.7/79\.6 because they are often implicit rather than stated as explicit constraints\. Table[5](https://arxiv.org/html/2608.05604#A2.T5)connects these extraction errors to execution\. With 10% corruption, reward decreases only from 33\.3 to 31\.6 and DPR/VR remain 96\.8/95\.1\. As corruption increases, PathHydrate conservatively expands more macros and restores more source sections\. At 40%, expansion and fallback reach 41\.3% and 34\.7%, while reward falls to 24\.1 and VR to 77\.2\. The gradual increase in source recovery limits mild errors, but the eventual degradation confirms that contract quality remains a central requirement for reliable procedural abstraction\.

![Refer to caption](https://arxiv.org/html/2608.05604v1/x3.png)Figure 3\.Contract\-extraction quality on the annotated subset\. Bars show field\-level F1 and exact match; dashed lines denote macro averages\.Table 5\.Robustness under synthetic contract corruption\. Noise is the percentage of contract fields removed or replaced\. Expansion and fallback are query\-level rates, with fallback requiring original\-source restoration\.NoiseR↑\\uparrowDPR↑\\uparrowVR↑\\uparrowExpansion \(%\)↓\\downarrowFallback \(%\)↓\\downarrow0%33\.399\.298\.714\.87\.210%31\.696\.895\.119\.711\.820%29\.292\.189\.427\.618\.940%24\.181\.577\.241\.334\.7

### B\.2\.Retrieval Scalability and Ambiguity

\(RQ7\) How does retrieval scale as the skill library grows?To evaluate whether SkillZip remains reliable as the skill library grows, we keep the evaluation queries fixed and expand the candidate library from 200 to 100K skills\. This setting separates the effect of library scale from query difficulty: the tasks to be solved remain the same, while the retriever must rank the correct procedural context among an increasingly large set of similar or partially overlapping skills\. We report Ret@1, similar\-skill confusion, compression ratio, and online retrieval–hydration latency\.

As shown in Table[6](https://arxiv.org/html/2608.05604#A2.T6), SkillZip degrades much more slowly thanSkillDAG\. When the library grows from 200 to 100K skills,SkillDAGRet@1 drops from 72\.1 to 41\.8, a decrease of 30\.3 points\. In contrast, SkillZip Ret@1 drops from 78\.3 to 65\.1, a decrease of 13\.2 points\. The performance gap therefore widens from 6\.2 points at 200 skills to 23\.3 points at 100K skills\. This indicates that the advantage of section\-level retrieval becomes larger when the library contains more distractor skills\.

The confusion results explain this trend\. As the library grows,SkillDAGincreasingly retrieves a topically related but incorrect skill: its similar\-skill confusion rate rises from 8\.5% to 48\.2%\. In comparison, SkillZip keeps confusion much lower, increasing only from 4\.2% to 12\.4%\. This suggests that whole\-skill graph retrieval is more sensitive to overlapping skill descriptions and shared high\-level routines, whereas section\-level matching can distinguish the concrete operation, dependency, and verifier needed by the query\.

The scalability results also show that compression helps keep the active retrieval structure compact\. As the library grows, the compression ratio of SkillZip increases from 2\.31×\\timesto 4\.29×\\times, reflecting more repeated procedural structure available for reuse\. At the same time, online retrieval and hydration latency grows smoothly from 18\.4 ms to 248\.3 ms per query and remains below 250 ms even at 100K skills\. Overall, these results show that SkillZip improves large\-library retrieval in two ways: it reduces ambiguity by ranking execution\-relevant sections rather than whole skill packages, and it keeps retrieval efficient by compressing repeated procedural structure into a compact active graph\.

Table 6\.Sensitivity to skill library size onSkillsBench\. We keep the evaluation queries fixed while expanding the candidate skill library from 200 to 100K skills\. Conf\. denotes the similar\-skill confusion rate \(%\) for each method\. Lat\. denotes SkillZip’s online retrieval and hydration latency per query\.SkillsRet@1↑\\uparrowConf\.↓\\downarrowCR↑\\uparrowLat\. \(ms\)↓\\downarrowSkillDAGSkillZipSkillDAGSkillZipSkillZipSkillZip20072\.178\.38\.54\.22\.31×\\times18\.450069\.476\.812\.34\.92\.87×\\times21\.71K66\.773\.615\.85\.83\.46×\\times27\.92K61\.972\.421\.47\.23\.82×\\times35\.810K52\.468\.934\.59\.84\.11×\\times71\.6100K41\.865\.148\.212\.44\.29×\\times248\.3

### B\.3\.Procedural Overlap and Domain Applicability

\(RQ8\) How does procedural overlap affect compression?To isolate the effect of procedural overlap, we keep the library size and query distribution fixed, and vary only how often contract\-compatible routines recur across skills\. This setting tests whether SkillZip compresses more when reusable structure is available, while avoiding unsafe compression when overlap is low\. Starting from the same 1K\-skill pool, we construct three controlled variants by injecting increasing numbers of recurring motifs into distractor\-only skills\. Each injected occurrence preserves the source motif’s role topology, typed I/O, resource family, guards, and verifier connection, but remains an occurrence\-specific node sequence with independently paraphrased surface text\. For every injected occurrence, we replace a non\-target routine with the same role profile, keeping the number of skills, section count, role distribution, evaluation queries, and target skills unchanged\. Thus, the low, medium, and high conditions differ in procedural recurrence rather than exact\-text duplication or task difficulty; Table[7](https://arxiv.org/html/2608.05604#A2.T7)reports the resulting mean cross\-skill support\.

As shown in Table[7](https://arxiv.org/html/2608.05604#A2.T7), higher overlap leads to stronger compression\. Mean macro support increases from 2\.3 to 9\.7 occurrences, and CR increases from 1\.18×\\timesto 4\.63×\\times\. At the same time, execution fidelity remains stable: DPR stays above 99\.1, VR stays above 98\.8, and reward changes by only 1\.1 points across the three overlap levels\. These results show that SkillZip adapts its compression level to the amount of reusable procedural structure in the library\. When few contract\-compatible repetitions exist, SkillZip leaves more sections explicit rather than forcing aggressive macros; when overlap is high, it can compress more while preserving dependency and verifier structure\.

Table 7\.Sensitivity to procedural overlap\. Macro support is the mean number of occurrence\-specific source subgraphs represented by each active macro; canonical prototypes are not counted\.OverlapCR↑\\uparrowSupport↑\\uparrowDPR↑\\uparrowVR↑\\uparrowR↑\\uparrowLow1\.18×\\times2\.399\.499\.132\.4Medium2\.37×\\times4\.899\.398\.933\.1High4\.63×\\times9\.799\.198\.833\.5

\(RQ9\) Does compression generalize across procedural domains?To test whether section\-level compression is tied to a single procedural domain, we partition the 1,000SkillsBenchskills into four named domains and a residual miscellaneous category\. We also evaluate ALFWorld as a separately structured embodied skill library\. As shown in Table[8](https://arxiv.org/html/2608.05604#A2.T8), SkillZip improves the reported task metric overSkillDAGin every domain where a matched baseline is available\. Reward gains range from 4\.8 to 6\.7 points across the fourSkillsBenchdomains, while the ALFWorld success rate improves by 12\.2 points\. The miscellaneous category also reaches 30\.5 reward, suggesting that SkillZip does not depend on one dominant skill type\. The compression ratios differ across domains, which is expected because different libraries contain different amounts of reusable structure\. Data wrangling obtains the highest CR at 4\.21×\\times, likely because loading, schema handling, normalization, and validation routines recur across many skills\. The smaller ALFWorld library has a lower CR of 1\.62×\\times, but still achieves a large reward gain, showing that compression ratio and task improvement are related but not identical: even modest compression can help when it exposes the right executable context\. Across all domains, VR remains high, ranging from 98\.5 to 99\.4\. Together with the controlled\-overlap results, these findings show that section abstraction transfers across procedural settings, while the attainable compression ratio is mainly governed by how much contract\-compatible reuse exists in each library\.

Table 8\.Results by procedural domain\. The first five rows partition all 1,000SkillsBenchskills; ALFWorld is an independently structured embodied skill library\. A dash indicates that a category\-level baseline was not available\.DomainSkillsCR↑\\uparrowR↑\\uparrowVR↑\\uparrowSkillDAGSkillZipSkillZipData wrangling1644\.21×\\times29\.736\.499\.1Scientific computing2383\.74×\\times25\.832\.198\.5Software/web3112\.96×\\times30\.235\.098\.9Finance/economics1473\.48×\\times28\.434\.798\.6Miscellaneous1402\.50×\\times–30\.598\.5ALFWorld371\.62×\\times67\.179\.399\.4

### B\.4\.Hydration Quality and Context Compactness

\(RQ10\) How does PathHydrate balance task quality and context budget?To evaluate the sensitivity of PathHydrate to its context budget, we vary the procedural\-content selection budget from 1,000 to 5,000 tokens while keeping the skill library, retriever, and executor fixed\. This experiment isolates whether additional context continues to improve execution, or whether PathHydrate can identify a compact sufficient subgraph before exhausting the available budget\.

As shown in Figure[4](https://arxiv.org/html/2608.05604#A2.F4), reward rises sharply from 22\.4 at 1,000 tokens to 31\.5 at 2,000 tokens, as the hydrated context recovers more execution\-critical dependencies and verifier conditions\. Increasing the budget to the default 3,000 tokens further raises reward to 33\.3, whereas expanding it to 5,000 tokens improves reward by only another 0\.8 points\. The flattening curve shows that performance does not depend on greedily filling the executor context: most of the useful procedural structure is already available at the default budget\. RQ11 next examines how much of this budget is actually rendered for individual tasks\.

![Refer to caption](https://arxiv.org/html/2608.05604v1/x4.png)Figure 4\.Task reward of SkillZip as the procedural\-content selection budget varies onSkillsBenchwith MiniMax\-M2\.7\. The dashed line marks the default 3,000\-token budget\.\(RQ11\) Is hydrated context compact under the default budget?To measure context compactness under the same default setting used in Tables[2](https://arxiv.org/html/2608.05604#S5.T2)and[3](https://arxiv.org/html/2608.05604#S5.T3), we give PathHydrate a 3,000\-token procedural\-content selection budget and measure how much context it actually renders\. We compare this delivered context with full rendering of the same queries’ top\-KKretrieved skill packages\. As shown in Figure[5](https://arxiv.org/html/2608.05604#A2.F5), PathHydrate delivers only 1,941 tokens per task on average, with a median of 1,947, even though the budget allows up to 3,000 tokens\. In contrast, rendering the top\-55retrieved whole skills requires 6,958 tokens per task, and rendering the top\-1212whole skills requires 17,384 tokens\. Thus, SkillZip reduces delivered context by 72\.1% compared with top\-55whole\-skill loading and by 88\.8% compared with top\-1212loading\. The full model in Tables[2](https://arxiv.org/html/2608.05604#S5.T2)and[3](https://arxiv.org/html/2608.05604#S5.T3)obtains 33\.3 reward with this same average rendered context\.

The task\-level distribution in Figure[6](https://arxiv.org/html/2608.05604#A2.F6)further shows that this saving is not an artifact of averaging\. The modal interval is 1,000–1,500 tokens, containing 26\.4% of tasks; 51\.7% of tasks use fewer than 2,000 tokens, and 74\.7% use fewer than 2,500\. These results rule out a greedy fill\-to\-budget behavior\. PathHydrate treats the budget as a selection allowance rather than a quota: it terminates hydration once task anchors are covered, dependencies are closed, and a verifier remains reachable, and expands further only when one of these execution obligations is unresolved\. Together with the corresponding 33\.3 reward, this result shows that compact context comes from task\-conditioned executable sufficiency rather than from indiscriminate accumulation of procedural content\.

![Refer to caption](https://arxiv.org/html/2608.05604v1/x5.png)Figure 5\.Mean rendered context on the 1K\-skillSkillsBenchlibrary\. Whole\-skill comparisons render each retrieved package in full, whereas SkillZip hydrates dependency\-closed sections\.![Refer to caption](https://arxiv.org/html/2608.05604v1/x6.png)Figure 6\.Task\-level distribution of the context rendered by SkillZip\. Overall, 51\.7% of tasks use fewer than 2,000 tokens, and 1,000–1,500 tokens is the modal interval\.
### B\.5\.System Cost across the Skill Lifecycle

\(RQ12\) How does offline structural construction scale?To understand the cost of maintaining SkillZip as a persistent skill\-library representation, we separate the offline construction process into two parts\. The first part is LLM\-assisted contract extraction, which reads skill packages and produces typed section records\. Its wall\-clock cost depends on the chosen model, provider, batching strategy, and request parallelism, and the extracted records are cached after construction\. Because this stage is provider\-dependent, we account for it separately and do not extrapolate its wall\-clock time across library scales\. The second part is deterministic local processing, including graph construction and MotifZip compression after the section records are available\. Table[9](https://arxiv.org/html/2608.05604#A2.T9)isolates this local stage so that the graph\-algorithm cost can be measured independently of LLM inference\. As shown in Table[9](https://arxiv.org/html/2608.05604#A2.T9), the local structural stage is lightweight for small and medium libraries: it takes 274 ms for 100 skills, 1\.44 s for 1K skills, and 16\.1 s for 10K skills\. Even when the library is expanded to 100K skills, corresponding to 4\.77M cached section nodes, graph construction and MotifZip finish in 178 s\. This experiment measures structural construction from cached records rather than fresh LLM extraction at 100K\. These wall\-clock measurements use the single\-server configuration reported in Appendix[D](https://arxiv.org/html/2608.05604#A4)\. All scales use the same cached\-record format and local pipeline; the reported wall\-clock time includes fixed initialization and typed\-bucket construction\. This scaling behavior is important because MotifZip does not perform unrestricted matching over all possible subgraphs\. Instead, typed\-signature bucketing in Algorithm[3](https://arxiv.org/html/2608.05604#algorithm3)groups sections by compatible roles, resource families, and I/O shapes before motif growth\. As a result, motif matching is mostly restricted to interface\-compatible candidates, and the local construction cost follows graph size rather than exploding with arbitrary cross\-library comparisons\. Together with the online latency results in Table[6](https://arxiv.org/html/2608.05604#A2.T6), these results show that SkillZip can be built and accessed as a persistent procedural memory layer as the library grows\.

Table 9\.Measured local structural construction cost after cached contract extraction\. Values report aggregate wall\-clock time for graph construction and MotifZip\. LLM inference is excluded\.SkillsSection nodesGraph \+ MotifZip↓\\downarrow1006,441274 ms20010,309436 ms50024,3331\.06 s1K48,8381\.44 s2K96,7392\.90 s5K240,0807\.78 s10K477,68116\.1 s100K4\.77 M178 s\(RQ13\) How costly are task\-time retrieval and rendering?We next examine the local cost paid at task time\. This microbenchmark starts after task anchors are available and excludes provider\-side task\-analysis inference\. It isolates one retrieval\-and\-rendering step under the same default setting used in our main results\. The reported online latency includes retrieval, graph closure, macro hydration, and rendering, while the rendered tokens measure the procedural context finally delivered to the executor\. As shown in Table[10](https://arxiv.org/html/2608.05604#A2.T10), SkillZip reduces online access latency from 41\.2 ms to 27\.9 ms compared withSkillDAG, while also reducing rendered context from 3,103 to 1,941 tokens\. This means that the section\-level compressed graph is not only more compact, but also cheaper to query and render than the skill\-level graph baseline\. The rendered context ofSkillDAGmatches that of the skill\-level unit substitution in Table[3](https://arxiv.org/html/2608.05604#S5.T3), confirming that both operate at the same granularity\. Vector Skills is faster locally, taking 12\.1 ms, because it performs dense retrieval only and does not run dependency closure or macro hydration\. However, it renders 2,834 tokens, 46\.0% more than SkillZip, because the retrieved unit is still a whole\-skill semantic match rather than a dependency\-closed procedural section\. GoS andSkillDAGalso render more context than SkillZip because their selected units remain closer to coarse skill structures\.

These results show the local trade\-off clearly\. SkillZip is not simply the fastest retriever in isolation, but its extra graph operations are modest and are offset by a much smaller executable context\. This matters for agent systems because the rendered context is not used once: it is often carried through multi\-turn reasoning, tool calls, verification, and repair\. Therefore, a small increase over pure vector\-retrieval latency can reduce the larger downstream cost caused by exposing broad or noisy procedural content\. Online latency is dominated by retrieval and graph traversal rather than rendering volume; the smaller compressed graph therefore keeps SkillZip faster thanSkillDAGeven after dependency closure and macro hydration\.

Table 10\.Local retrieval and rendering cost onSkillsBenchafter task anchors are available\. Online excludes provider inference; Rendered Tok includes fixed rendering metadata and any indivisible selected unit\.MethodOnline \(ms\)↓\\downarrowRendered Tok↓\\downarrowVector Skills12\.12,834GoS34\.62,517SkillDAG41\.23,103SkillZip27\.91,941\(RQ14\) How does SkillZip affect end\-to\-end agent cost?Finally, we measure the full multi\-turn agent trajectory, rather than only the procedural context injected at retrieval time\. For each task, we sum the provider\-reported prompt and completion tokens across all agent turns and then average across tasks\. This gives a system\-level view of cost: a cleaner procedural context may reduce not only the initial retrieval payload, but also the number of turns, repeated prompt context, generated tokens, and tool calls needed to complete the task\. We also record wall\-clock time from task launch to harness termination, including model inference, tool and container execution, and benchmark\-harness interaction\. This full\-task measure is distinct from the single\-step retrieval and rendering latency reported in RQ13\. As shown in Table[11](https://arxiv.org/html/2608.05604#A2.T11), SkillZip improves reward from 27\.3 to 33\.3 overSkillDAG, while substantially reducing the full trajectory cost\. Total prompt processing decreases from 2\.78M to 1\.47M tokens, a 47\.0% reduction\. Completion tokens decrease from 31,963 to 20,601, a 35\.5% reduction, and tool calls decrease from 36\.9 to 28\.9, a 21\.7% reduction\. Average task time likewise falls from 429\.7 to 339\.0 seconds, a 21\.1% reduction\. Under the same setting, Vector Skills and GoS require 361\.3 and 372\.2 seconds per task, respectively, so SkillZip remains the fastest of the five evaluated systems\. Compared with Vanilla Skills, SkillZip also uses fewer total prompt tokens, fewer completion tokens, and fewer tool calls while achieving a higher reward\. Thus, the cost reduction does not come from weakening the task or shortening the response at the expense of quality; it is accompanied by better task performance\. Because full\-task wall time includes provider and container variation, we use it as end\-to\-end systems evidence rather than as an isolated measure of retrieval speed\.

The prompt\-token results should be interpreted in two layers\. The first layer is direct context compactness: as shown in Table[10](https://arxiv.org/html/2608.05604#A2.T10), SkillZip delivers fewer procedural tokens at the retrieval step\. The second layer is trajectory shortening: cleaner section\-level context reduces irrelevant branches, missing dependencies, and unnecessary repair attempts, so the agent repeats less accumulated context across turns and makes fewer tool calls\. This explains why the reduction in total prompt processing is larger than the reduction in uncached prompt tokens alone\. Most prompt tokens in all systems are served from cache, so the uncached portion decreases more moderately, from 76,880 underSkillDAGto 62,526 under SkillZip, an 18\.7% reduction\. The larger drop in cached and total prompt tokens reflects that fewer turns and fewer repeated contexts are needed once the agent receives a more compact executable procedure\.

Overall, the three cost measurements support the same conclusion across the skill lifecycle\. Offline construction is a one\-time and cacheable cost; local task\-time retrieval remains lightweight; and end\-to\-end execution becomes both cheaper and more successful\. This suggests that the main system benefit of SkillZip is not only reducing the number of tokens shown to the executor, but also reducing the downstream interaction needed to use the skill library correctly\.

Table 11\.End\-to\-end trajectory cost on the default 1K\-skillSkillsBenchsetting with MiniMax\-M2\.7\. Values are task averages\. Prompt counters aggregate all agent turns; task time spans model inference, tool and container execution, and harness interaction\.MetricVanilla SkillsSkillDAGSkillZipTotal prompt↓\\downarrow2,429,2372,782,6961,473,532Uncached prompt↓\\downarrow78,08176,88062,526Cached prompt↓\\downarrow2,351,1562,705,8161,411,006Completion↓\\downarrow34,59231,96320,601Tool calls↓\\downarrow32\.936\.928\.9Task time \(s\)↓\\downarrow464\.7429\.7339\.0Reward↑\\uparrow17\.227\.333\.3
### B\.6\.Streaming ReZip Maintenance

\(RQ15\) Can ReZip maintain an evolving skill library?To evaluate whether ReZip can maintain compressed procedural memory as the library evolves, we split the 1K\-skill pool into an initial 50% library and ten equal, non\-overlapping arrival batches containing the remaining 50%\. The split and arrival order are fixed across all methods\. After the fifth batch, we introduce controlled contract drift by tightening the source\-grounded verifier condition of a fixed, domain\-stratified subset of active macros while leaving their interfaces and operations unchanged\. This isolates whether maintenance responds to changed execution obligations rather than to a different task\. After every batch, all methods are evaluated on the same frozen query set, which covers both initial and arriving\-skill procedures\.

At each update, ReZip uses only cached section records and execution traces observed up to that batch, so maintenance does not rely on future evidence and the reported update cost excludes the one\-time LLM extraction stage\. We compare it with three alternatives: keeping the original compressed graph fixed, appending new sections without recompression, and periodically recompressing the full library\. As shown in Table[12](https://arxiv.org/html/2608.05604#A2.T12), the static graph degrades to 28\.7 reward and 91\.2 VR because old macros are not revised after verifier contracts change\. Append\-only insertion partially improves reward to 30\.1 and VR to 94\.6, but its CR drops to 2\.41×\\timesbecause newly recurring routines remain as raw sections rather than being compressed\. Full recompression gives the strongest endpoint, reaching 3\.71×\\timesCR, 33\.6 reward, and 99\.1 VR, but it requires the full recomputation cost\. ReZip closely matches full recompression while using much lower update cost\. It achieves 3\.64×\\timesCR, 33\.2 reward, and 98\.6 VR, with only 0\.22×\\timesthe cost of periodic full recompression\. It also responds to injected contract drift within 1\.4 batches on average\. These results show that execution traces provide useful maintenance signals: recurring contract\-valid residuals can be promoted into new macros, while verifier failures can demote or revise macros whose contracts have become unsafe\.

Table 12\.Streaming results after ten arriving\-skill batches\. Cost is cumulative update cost normalized by periodic full recompression\. Delay is the mean number of batches required to recover from injected contract drift; it is undefined for methods that do not actively repair drift\.MaintenanceCR↑\\uparrowCost↓\\downarrowR↑\\uparrowVR↑\\uparrowDelay↓\\downarrowStatic graph3\.07×\\times0\.00×\\times28\.791\.2–Append\-only sections2\.41×\\times0\.08×\\times30\.194\.6–Full recompression3\.71×\\times1\.00×\\times33\.699\.11\.0ReZip3\.64×\\times0\.22×\\times33\.298\.61\.4

### B\.7\.Reliability across Runs and Backbones

\(RQ16\) Are gains stable across repeated agent runs?To evaluate whether the gains of SkillZip are stable under stochastic agent execution, we repeat each comparable method–backbone setting five times\. Since agent trajectories may vary across runs, we use a paired evaluation protocol: for each run, SkillZip andSkillDAGare paired by task or episode and by random seed\. We then compute confidence intervals by resampling paired outcome\-level differences rather than only resampling the five run\-level means\. This makes the test focus on whether SkillZip consistently improves the same tasks or episodes, rather than whether one run happens to be favorable\.

As shown in Table[13](https://arxiv.org/html/2608.05604#A2.T13), the ordering in the main results is preserved across all four settings\. The paired task\-performance gains range from 2\.8 to 12\.2 points, and every 95% confidence interval excludes zero\. OnSkillsBench, SkillZip improves reward overSkillDAGby 6\.0 points with MiniMax\-M2\.7 and by 6\.2 points with gpt\-5\.2\-codex, with relatively tight confidence intervals\. This indicates that the reward gains are not caused by a small number of unstable tasks\. On ALFWorld, the gain is larger with MiniMax\-M2\.7, where success rate improves by 12\.2 points, although the interval is wider because embodied action trajectories introduce more variation across episodes\.

The most conservative setting is ALFWorld with gpt\-5\.2\-codex, whereSkillDAGalready reaches 93\.6 success and the remaining headroom is small\. Even there, SkillZip still improves success to 96\.4, with a paired gain of 2\.8 points and a significant paired permutation test \(p=\.031p=\.031\)\. These results show that the benefit of executable section context persists across repeated agent runs\. The improvement is therefore not a single\-trajectory effect; it reflects a stable reduction in retrieval ambiguity and missing execution context\.

Table 13\.Repeated\-run results\. Values are mean±\\pmstandard deviation over five matched runs\.Δ\\Deltais the paired improvement of SkillZip overSkillDAGin the reported metric \(reward or success rate\), measured in points\. Confidence intervals use 1,000 paired bootstrap samples over task or episode outcomes, andpp\-values use paired permutation tests over the same outcome\-level differences\.BackboneBenchmarkSkillDAGSkillZipΔ\\Delta\[95% CI\]ppMiniMax\-M2\.7SkillsBench27\.3±\\pm1\.933\.3±\\pm1\.5\+6\.0 \[3\.8, 8\.1\]\.004MiniMax\-M2\.7ALFWorld67\.1±\\pm3\.179\.3±\\pm2\.2\+12\.2 \[7\.5, 16\.8\]<<\.001gpt\-5\.2\-codexSkillsBench36\.8±\\pm1\.443\.0±\\pm1\.2\+6\.2 \[4\.4, 8\.0\]\.002gpt\-5\.2\-codexALFWorld93\.6±\\pm1\.696\.4±\\pm1\.1\+2\.8 \[0\.4, 5\.2\]\.031

\(RQ17\) Does SkillZip generalize across LLM backbones?To evaluate whether the benefit of SkillZip depends on a particular executor, we compare it withVector Skillsacross six backbone LLMs and two benchmarks\.Vector Skillsretrieves whole skills using dense semantic similarity, while SkillZip retrieves and hydrates execution\-complete section context\. This comparison tests whether structural procedural retrieval remains useful when the executor changes, and whether stronger LLMs can fully compensate for the granularity mismatch of whole\-skill retrieval\.

As shown in Table[14](https://arxiv.org/html/2608.05604#A2.T14), SkillZip outperformsVector Skillsin all twelve benchmark–backbone settings\. The gains are especially large onSkillsBench, where tasks often require precise tool use, file operations, or verifier\-aware procedures\. Across the six backbones, SkillZip improves reward by 19\.9 to 26\.2 points and achieves 2\.0×\\times–3\.2×\\timesrelative gains over vector retrieval\. The largest relative gain appears with MiniMax\-M2\.7, where reward increases from 10\.4 to 33\.3\. This suggests that smaller or less procedure\-specialized executors benefit strongly from receiving a compact and dependency\-closed procedural context, rather than a broad retrieved skill package\.

The gains remain large for stronger backbones\. OnSkillsBench, Claude Sonnet 4\.5 improves from 26\.2 to 52\.4, Gemini 3 Pro improves from 19\.3 to 44\.4, and gpt\-5\.2\-codex improves from 21\.5 to 43\.0\. These results show that executor strength alone does not remove the need for the right retrieval unit: even capable models can be hurt when the retrieved context contains unrelated branches or lacks the exact verifier and dependency path required by the task\. By exposing the executable section context directly, SkillZip reduces this burden on the executor\.

On ALFWorld, the relative ratios are smaller because several vector baselines already have high success rates\. Nevertheless, SkillZip improves every backbone\. The gains are largest for weaker backbones, with MiniMax\-M2\.7 increasing from 50\.7 to 79\.3 and Qwen 3\.5 increasing from 72\.9 to 87\.4\. For stronger models, SkillZip further pushes performance toward saturation, reaching 97\.9 with Kimi K2\.5, 99\.0 with Claude Sonnet 4\.5, 99\.1 with Gemini 3 Pro, and 96\.4 with gpt\-5\.2\-codex\. The pattern is consistent with the main claim: section\-level procedural context helps weaker executors by reducing retrieval ambiguity, and still helps stronger executors by supplying compact, dependency\-closed procedures with the required verifier conditions\.

Overall, the repeated\-run and cross\-backbone results support two reliability claims\. First, the gains of SkillZip are statistically stable across repeated agent executions\. Second, the gains are not tied to one model family or one executor strength level\. SkillZip acts as a procedural memory layer whose main benefit comes from changing the retrieved unit from whole skills to executable sections, making the context both more compact and more directly aligned with the task\.

Table 14\.Cross\-backbone comparison withVector Skills\. Entries report reward \(%\) onSkillsBenchand success rate \(%\) on ALFWorld\.↑\\uparrowis the SkillZip/Vector ratio\. The largest ratio per benchmark is bolded, and the second largest is underlined\.BackboneSkillsBenchALFWorldVectorSkillZip↑\\uparrowVectorSkillZip↑\\uparrowMiniMax\-M2\.710\.433\.33\.2×\\times50\.779\.31\.6×\\timesQwen 3\.518\.138\.02\.1×\\times72\.987\.41\.2×\\timesKimi K2\.522\.447\.02\.1×\\times89\.097\.91\.1×\\timesClaude Sonnet 4\.526\.252\.42\.0×\\times94\.399\.01\.0×\\timesGemini 3 Pro19\.344\.42\.3×\\times93\.699\.11\.1×\\timesgpt\-5\.2\-codex21\.543\.02\.0×\\times92\.996\.41\.0×\\times

Table 15\.Case Study 1 – Retrieval trace for header normalization with row\-count verification\. Skill\-level retrieval exposes overlapping packages, whereas SkillZip selects the shared operation and its required verifier path\.Retrieval unitMatching evidenceSelected contextContext consequenceSkill levelPackage\-level similarity to both skill descriptionsFull*Clean CSV*and*Pivot Table*packagesIncludes the requested routine, but also exposes missing\-value repair, pivot aggregation, and competing output rules\.Section levelOperation anchor \(*normalize headers*\) and verifier anchor \(*row count unchanged*\)MingestM\_\{\\mathrm\{ingest\}\}with file/schema dependencies and the row\-count verifierCloses the required dependencies and verifier path without loading unrelated downstream branches\.Table 16\.Case Study 2 – Contract\-aware comparison of three textually similar routines\. MotifZip accepts the two CSV occurrences because their interfaces, execution requirements, and verifier boundaries agree, while keeping the workbook occurrence separate\.OccurrenceInterfaceExecutionVerificationMotifZip decision*Clean CSV*CSV\+ delimiter→\\rightarrownormalized tableInfer delimiter, parse rows, normalize headers, and preserve row identitySchema report and reachable row\-count hookAcceptintoMcsv​\-​ingestM\_\{\\mathrm\{csv\\mbox\{\-\}ingest\}\}*Pivot Table*CSV\+ delimiter→\\rightarrownormalized tableSame ingest routine; pivot aggregation starts after the macro output portSchema report; downstream total verifier remains occurrence\-specificAcceptintoMcsv​\-​ingestM\_\{\\mathrm\{csv\\mbox\{\-\}ingest\}\}*Formula\-Safe Workbook*XLSX→\\rightarrowformula\-preserving workbookUse a formula\-aware resource and preserve formulas during normalizationFormula\-integrity and row\-count verifiersRejectfrom the CSV macro; retain separatelyReversible rewriteMcsv​\-​ingestM\_\{\\mathrm\{csv\\mbox\{\-\}ingest\}\}keeps occurrence\-specific source/port maps and downstream verifiers\.![Refer to caption](https://arxiv.org/html/2608.05604v1/x7.png)Figure 7\.Failure attribution grouped by the earliest blocking stage\.
### B\.8\.Failure Analysis

\(RQ18\) Where do the remaining failures originate?Under the default 1K\-skillSkillsBenchsetting, we distinguish procedural\-context errors from downstream execution errors by assigning every failed or repaired trajectory to its earliest blocking stage\. This attribution avoids counting an upstream retrieval miss again as a later contract, hydration, or execution failure\.

Figure[7](https://arxiv.org/html/2608.05604#A2.F7)shows that stages controlled by SkillZip account for 58% of the remaining failures\. Retrieval is the largest source within this group, contributing 26%, mainly when closely related skills create ambiguous anchors or when the needed section is not included in the initial candidate set\. Contract extraction accounts for 18%, with errors concentrated in implicit preconditions, resource requirements, and underspecified verifier hooks\. Hydration contributes the remaining 14%, usually when a tight context budget omits a required branch or when source expansion is triggered too late\.

The other 42% of failures occur after the relevant context has been retrieved and hydrated\. Agent execution is the largest single category, accounting for 33% of cases: the executor may choose an invalid action order, misuse a tool, or fail to recover after a verifier rejects an intermediate result\. Infrastructure failures account for 9% and mainly include environment, timeout, and tool\-interface errors\. This decomposition suggests that retrieval ambiguity and implicit contracts are the main remaining targets for improving SkillZip itself, while executor and infrastructure failures require better action control and more reliable execution environments\. The smaller hydration share also suggests that reversible source expansion usually limits structural information loss, rather than merely shifting missing context to downstream execution\.

## Appendix CCase Studies

To demonstrate how SkillZip performs interpretable and execution\-faithful procedural retrieval, compression, and maintenance, we present three case studies in Tables[15](https://arxiv.org/html/2608.05604#A2.T15)–[17](https://arxiv.org/html/2608.05604#A3.T17)\. Each case study focuses on one key stage of the workflow: resolving retrieval ambiguity, preserving executable contracts during compression, and updating compressed procedures from execution evidence\. Through examples involving CSV header normalization, contract\-aware CSV\-ingest compression, and streaming macro maintenance, we show how SkillZip maps task requirements into section\-level anchors, contract\-compatible motifs, dependency\-closed hydrated context, and ReZip update actions\. These examples illustrate why SkillZip can reduce active context while keeping the procedural structure needed for verification, execution, and source\-grounded recovery\. The cases are illustrative constructions based on recurring benchmark patterns rather than additional quantitative samples\.

Case study 1: Resolving skill\-level ambiguity\. Consider the task “normalize the headers in a CSV file and verify that the row count is unchanged\.” Both*Clean CSV*and*Pivot Table*contain a file\-loading and header\-normalization routine, so a skill\-level retriever ranks both packages highly\. Table[15](https://arxiv.org/html/2608.05604#A2.T15)contrasts the resulting whole\-skill context with the section\-level context compiled by SkillZip\.

Whole\-skill retrieval exposes missing\-value repair, pivot aggregation, and competing output rules together with the requested routine\. PathHydrate instead maps the query to anOperationanchor \(*normalize headers*\) and aVerifieranchor \(*row count unchanged*\)\. Section matching recovers the shared tabular\-ingest routine, while dependency closure adds the required file input and schema requirements\. The hydrated context therefore keeps the reusable ingest macro and row\-count verifier but excludes unrelated continuations\. This case illustrates that section\-level retrieval reduces both context size and ambiguity between topically similar skills\.

Table 17\.Case Study 3 – Illustrative ReZip trace\. Repeated compatible occurrences promote a residual, while execution risk triggers controlled macro demotion\.StageIncoming signalContract evidenceReZip updateResulting library stateInsertA new*Merge Monthly Reports*skill arrivesIngest matchesMcsv​\-​ingestM\_\{\\mathrm\{csv\\mbox\{\-\}ingest\}\}; the align–merge–balance subgraph is unmatchedReuse the ingest macro and buffer the residualKnown structure is compressed; novel steps remain explicitPromoteThe merge residual recurs in later skillsPorts, dependencies, resource family, and balance verifier remain stablePromoteMperiod​\-​mergeM\_\{\\mathrm\{period\\mbox\{\-\}merge\}\}Later skills reuse one verified period\-merge routineReviseFormula\-bearing tasks repeatedly expand or fail the generic export macroFailures localize to theXLSXresource and formula\-integrity verifierSplit by resource family; require full source forXLSXCSV export remains compact; workbook safeguards are restoredReuseA future CSV or workbook query arrivesTask anchors identify the required resource and verification contractSelect the macro and hydration level by task contractCompact where stable; source\-expanded where evidence indicates riskCase study 2: Preserving contracts during compression\. Suppose three skills contain the near\-identical instruction “load the table, normalize its headers, and validate the result\.” The occurrences belong to*Clean CSV*,*Pivot Table*, and a*Formula\-Safe Workbook*skill\. Table[16](https://arxiv.org/html/2608.05604#A2.T16)compares their interface, execution, and verification contracts before compression\.

Text deduplication would merge all three routines because their surface forms are similar\. MotifZip rewrites them only after checking typed ports, dependencies, resources, and verifier paths\. It therefore compresses the two CSV occurrences intoMcsv​\-​ingestM\_\{\\mathrm\{csv\\mbox\{\-\}ingest\}\}while retaining occurrence\-specific source maps and downstream verifier links; pivot aggregation remains outside the macro and reconnects through its output port\. The workbook occurrence is rejected because formula preservation changes its interface, execution resource, and verification contract\. Thus, the graph grammar accepts reuse only across a shared executable boundary and keeps every accepted macro reversible to its source occurrences\.

Case study 3: Maintaining compression under library evolution\. This case follows how ReZip maintains compressed procedural memory as new skills arrive and old abstractions become unsafe\. A newly added*Merge Monthly Reports*skill reuses the existing CSV\-ingest macro, but also introduces an explicit*align periods–merge–balance check*residual\. Separately, execution traces show that a generic export macro repeatedly fails verifier checks on formula\-bearing workbooks\. Table[17](https://arxiv.org/html/2608.05604#A3.T17)traces the resulting insert, promote, revise, and reuse decisions\.

ReZip first reuses the stable ingest macro and leaves the novel residual explicit\. Repeated contract\-compatible occurrences then promote the residual without full recompression\. In the opposite direction, repeated expansion, repair, or verifier failure localizes risk to the formula\-bearing task family, causing ReZip to split the export macro or raise its default hydration level\. Execution evidence therefore updates the abstraction itself: the library stays compact where reuse is stable and source\-expanded where verification indicates risk\. Across the three cases, Sec2Graph exposes sub\-skill reuse, MotifZip compresses contract\-compatible occurrences, PathHydrate closes the required execution context, and ReZip revises unsafe abstractions\.

## Appendix DExperimental Details

Default setting and benchmarks\. We evaluate SkillZip on two complementary agent benchmarks:SkillsBenchand ALFWorld\.SkillsBenchtests whether retrieved procedural knowledge helps an agent construct verifiable artifacts, while ALFWorld tests whether the same procedural\-memory design supports long\-horizon interactive execution\. Unless stated otherwise, the default setting usesSkillsBenchwith the 1,000\-skill library, MiniMax\-M2\.7, and a 3,000\-token procedural\-content selection budget\. The corresponding default budget on ALFWorld is 1,200 tokens\. Experiments that vary the library size, backbone, benchmark, context budget, procedural overlap, or update stream state the changed factor explicitly and keep the remaining settings fixed\.

SkillsBench\.SkillsBench\(Liet al\.,[2026b](https://arxiv.org/html/2608.05604#bib.bib3)\)evaluates agent skills on containerized artifact\-construction tasks, including data processing, document manipulation, software development, and related procedural domains\. Each task is paired with an executable verifier, so the final artifact is scored by deterministic tests rather than by an LLM judge\. The verifier source, excerpts, assertions, and intermediate outcomes are withheld from task anchoring, retrieval, hydration, and every evaluated agent; the verifier is invoked only after execution to compute reward\. Following Graph\-of\-Skills\(Liuet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib8)\)andSkillDAG\(Baiet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib11)\), we evaluate all 87 tasks under the 1,000\-skill setting\. Task reward \(R\) is the percentage of verifier tests passed\. Target source skills are used only for intrinsic retrieval evaluation\.

ALFWorld\.ALFWorld\(Shridharet al\.,[2021](https://arxiv.org/html/2608.05604#bib.bib33)\)aligns text\-based interaction with embodied household tasks derived from ALFRED\(Shridharet al\.,[2020](https://arxiv.org/html/2608.05604#bib.bib48)\)through the TextWorld interface\(Côtéet al\.,[2018](https://arxiv.org/html/2608.05604#bib.bib47)\)\. An agent must interpret a natural\-language goal, navigate rooms, manipulate objects, and complete the goal through admissible actions\. Following Graph\-of\-Skills\(Liuet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib8)\)andSkillDAG\(Baiet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib11)\), we use thevalid\_seensplit and evaluate all 140 episodes\. Task reward is the percentage of episodes that reach the goal within the common step and attempt budgets\.

Evaluation metrics\. We report end\-task reward, intrinsic retrieval quality, structural fidelity, recovery behavior, and system cost\.

Task and retrieval quality\.ForSkillsBench, reward \(R\) is the percentage of verifier tests passed\. For ALFWorld, reward is the episode success rate\. For intrinsic retrieval, Ret@kkis the percentage of queries whose retrieved context maps to a target source skill within the topkk, and MRR is the mean reciprocal rank of the first target source skill\. Since SkillZip retrieves sections and macros rather than whole skills, we project each retrieved section to its owning source skill and each macro occurrence to the source skill recorded in its expansion map\. We preserve the original retrieval order and remove repeated source IDs by stable first occurrence, without additional reranking or score aggregation\. This gives whole\-skill retrieval, section retrieval, and macro retrieval the same Ret@kk/MRR unit\.

Compression and structural fidelity\.For compression analysis, CR is the ratio between the raw active representation and the compressed active representation, where the compressed representation includes the macro dictionary\. Tok is the average number of final rendered context tokens per query\. The procedural\-content selection budget applies to selected procedural payloads before fixed task headers, execution metadata, and source pointers are rendered\. Whole\-skill methods may exceed the target budget when the smallest selected package is indivisible, so we report measured final Tok rather than treating the target budget as the observed context size\. DPR measures the fraction of required dependency relations retained in the first compact view, and VR measures the fraction of required operation\-to\-verifier paths that remain reachable\. Expansion is the percentage of queries for which at least one selected macro must be raised from a compact name/contract view to an outline or full\-source view\. Fallback is the percentage of queries that ultimately require an original source section\. For SkillZip, fallback occurs after insufficient macro expansion and is therefore a subset of expansion\. Recover\. is the broader query\-level rate used in Table[2](https://arxiv.org/html/2608.05604#S5.T2): it records whether the first compact view requires graph\-local closure repair, macro expansion, or source restoration before execution\.

Downstream inflation\.We measure downstream execution inflation \(DI\) against a paired execution using the corresponding raw section context\. For traceτ\\tau, letJ​\(τ\)=nrepair​\(τ\)\+ntool​\(τ\)\+2​nvfail​\(τ\),J\(\\tau\)=n\_\{\\mathrm\{repair\}\}\(\\tau\)\+n\_\{\\mathrm\{tool\}\}\(\\tau\)\+2n\_\{\\mathrm\{vfail\}\}\(\\tau\),where the terms count repair steps, downstream tool calls, and verifier failures\. For queryqq,

DI​\(q\)=100​max⁡\{0,J​\(τq\)−J​\(τqfull\)\}max⁡\{1,J​\(τqfull\)\}\.\\mathrm\{DI\}\(q\)=100\\,\\frac\{\\max\\\{0,J\(\\tau\_\{q\}\)\-J\(\\tau\_\{q\}^\{\\mathrm\{full\}\}\)\\\}\}\{\\max\\\{1,J\(\\tau\_\{q\}^\{\\mathrm\{full\}\}\)\\\}\}\.We report the mean query\-level percentage\. DI separates compact contexts that genuinely reduce work from contexts that only move missing information into later repair\.

Baselines and budget alignment\. We compare SkillZip with whole\-skill disclosure, semantic retrieval, skill\-graph retrieval, and representation\-level compression baselines\.

Skill retrieval baselines\.Vanilla Skillsexposes the available skill packages directly to a ReAct\-style agent\(Yaoet al\.,[2022](https://arxiv.org/html/2608.05604#bib.bib34)\), providing a non\-retrieval reference for task quality and context cost\.Vector Skillsembeds each whole skill and retrieves the top\-ranked packages by dense semantic similarity\. It tests whether semantic retrieval alone can distinguish closely related skills\.Graph\-of\-Skills \(GoS\)\(Liuet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib8)\)obtains semantic and lexical seeds, diffuses relevance over a directed skill\-dependency graph, and hydrates a bounded bundle\. It is the closest dependency\-aware structural retrieval baseline while still using skills as graph nodes\.SkillDAG\(Baiet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib11)\)represents inter\-skill dependencies, conflicts, specializations, and equivalences as typed edges, and uses an agent\-callable interface for vector matches, typed neighbors, and conflict signals\. We use it as the strongest task\-time skill\-graph baseline\.

Disclosure and budget alignment\.We preserve each baseline’s main disclosure policy rather than forcing all methods to expose the same number of sections or packages\. GoS uses five initial seeds, returns at most eight skills, truncates each skill to 2,400 characters, and caps the rendered bundle at 12,000 characters\.SkillDAGuses top\-55retrieval with graph depth22and allows the agent to issue additional search or source\-display calls on demand\. Since these policies do not map cleanly to a single token cap, we keep their published retrieval settings and report measured rendered tokens and end\-to\-end agent tokens\. All methods receive the same agent\-visible task brief and benchmark metadata\. SkillZip’s structured task object is derived only from this shared input; no method receives benchmark verifier code or an excerpt of its assertions\.

Compression baselines\.For representation\-level analysis, we compare SkillZip with four compression variants\.Exact\-text section deduplicationmerges normalized, text\-identical sections without checking occurrence\-specific contracts\.Text compressionapplies LLMLingua\-2\-style task\-agnostic token compression\(Pan and others,[2024](https://arxiv.org/html/2608.05604#bib.bib27)\)after retrieving the same raw section context\.Generic graph grammarruns on the same raw section graph with the same support threshold, candidate\-window bound, macro cap, and greedy non\-overlap rewrite schedule as MotifZip\. It identifies and accepts motifs using topology and description\-length gain without consulting role, resource, I/O, guard, or verifier fields\.SkillZip without contract checksis a closer controlled ablation: it retains MotifZip’s signature\-bucketed candidates, scoring, and rewrite machinery, but removes the boundary, signature, dependency, and verifier acceptance checks before admitting each positive\-gain motif\. For the text\-compression baseline, we retrieve and render the same source sections as the raw\-graph representation, then apply LLMLingua\-2\-style compression without MotifZip\. We tune its compression threshold on development queries to match SkillZip’s active\-representation ratio and apply the same default procedural\-content selection budget at query time\. The same dependency and verifier validators are then applied to the first compressed view\. When either check fails, the corresponding original section is restored before execution\. DPR and VR are measured before restoration, while Recover\. reports the fraction of queries requiring restoration or repair\. CR is measured on the stored active representation before query\-time restoration, whereas Tok and reward are measured from the final context and execution after restoration\. Thus, CR and Tok describe different stages of the pipeline\.

Models and implementation\. We evaluate all methods under matched backbone, executor, and retrieval settings within each comparison block\.

Backbones and execution\.The main results use MiniMax\-M2\.7 \(MiniMax\-M2\.7\) and gpt\-5\.2\-codex \(gpt\-5\.2\-codex\)\. The cross\-backbone analysis additionally uses Qwen 3\.5 \(qwen3\.5\-plus\), Kimi K2\.5 \(kimi\-k2\.5\), Claude Sonnet 4\.5 \(claude\-sonnet\-4\-5\-20250929\), and Gemini 3 Pro \(gemini\-3\-pro\-preview\)\. OnSkillsBench, all backbones are executed with the OpenHands agent through the benchmark’s BenchFlow Docker harness\. Every method within a backbone block receives the same task image, tools, system instructions, two\-attempt policy, and skill\-library snapshot\. On ALFWorld, all backbones use the same text\-action runner\. At each turn, the runner exposes the current observation and admissible actions, and the model returns either one environment action or a source\-expansion request\. Episodes are capped at 30 environment steps, 60 model turns, and two source expansions\. The evaluated backbone is also used for task anchoring; no auxiliary model is substituted for decomposition or execution\.

Retrieval, compression, and hydration settings\.All task\-analysis, retrieval\-control, and action\-generation calls use temperature0and deterministic decoding whenever supported\. Other sampling controls remain at provider defaults\. Structured task anchoring is capped at 8,000 output tokens, and each ALFWorld action call at 4,096 output tokens\.SkillsBenchotherwise follows the generation limits of its agent harness\. We use BGE\-M3 \(BAAI/bge\-m3\) for dense retrieval, cap initial skill recall at 12, and retain a lower\-ranked skill only when its cosine similarity is at least0\.450\.45and at least0\.900\.90of the highest score\. The same encoder, cached embeddings, and cutoff are used by all retrieval methods that require dense similarity\. For MotifZip, we scale the description\-length saving and the auxiliaryReuse\\mathrm\{Reuse\},Cut\\mathrm\{Cut\}, andRisk\\mathrm\{Risk\}terms to comparable ranges before scoring\. We setα=0\.5\\alpha=0\.5,λ=0\.3\\lambda=0\.3, andμ=0\.2\\mu=0\.2; because contract\-invalid candidates are rejected by hard acceptance checks, these coefficients rank only contract\-valid motifs and prioritize cross\-skill reuse among them\. For PathHydrate, we normalize token cost by the selection budget and scale the remaining objective terms to comparable ranges\. We useη=0\.4\\eta=0\.4andβ=γ=δ=0\.2\\beta=\\gamma=\\delta=0\.2, emphasizing compactness among subgraphs that already satisfy anchor coverage, dependency closure, and verifier reachability\.

Reproducibility, scaling, and cost accounting\. We separate offline preprocessing, local graph construction, online retrieval, and downstream execution cost\.

Runtime and cost accounting\.SkillsBenchis executed with BenchFlow 0\.6\.2 in isolated Docker containers\. Provider inference is remote and excluded from local graph\-search latency\. Reported online graph latency measures retrieval, dependency closure, and hydration after task anchors are available\. All local structural\-construction timings are measured on a single server equipped with an Intel Xeon Gold 6248R CPU and 512 GB of memory\. We report elapsed wall\-clock time under the same local implementation at every scale\. The timed graph\-construction and MotifZip stage runs as a single process and is not parallelized across skills or motif buckets\. Model\-side request parallelism does not enter these measurements because they start from cached section records and exclude LLM inference\.

Offline construction has two stages\. The first stage is LLM\-assisted role and contract extraction, which is cached after construction and depends on the provider, batching strategy, and request parallelism\. We therefore report it separately from graph\-algorithm scaling and do not extrapolate fresh extraction time to the 100K setting\. The second stage is local structural construction, which starts from cached extracted records and includes procedural graph construction and MotifZip\. The corresponding 1K\-skill local stage takes 1\.44 seconds, while the 100K result reports the same cached\-record starting point\. Each input document in this timing study is one skill package, so document and skill counts are identical\.

For end\-to\-end token accounting,*total prompt*is the sum of provider\-reported prompt tokens over all model turns in a task\.*Uncached prompt*is the subset not served from the provider cache, and*cached prompt*is the difference between total and uncached prompt tokens\.*Completion*is the total number of generated tokens over the same turns\. These trajectory\-level counters repeatedly include the growing interaction history and are distinct from Tok, which measures the procedural context rendered once for a query\. We also report average tool calls from the saved task traces and pair every method with the corresponding task reward\.

Retrieval and library scaling\.For library\-scaling experiments, we keep the evaluation queries and target\-source annotations fixed while enlarging only the candidate skill library\. Each larger library is a strict superset of the smaller one\. Additional skill packages are drawn without replacement from the same SkillsBench\-compatible source collection, deduplicated by stable package identifier, and added in deterministic identifier order\. We use the released Graph\-of\-Skills pools at 200, 500, 1K, and 2K skills, and extend the same nested\-pool construction to 10K and 100K skills\. The added packages are not paired with evaluation queries and serve only as retrieval distractors\. Across all scales, the embedding backbone, retrieval budget, and evaluation protocol remain unchanged, so Ret@1 and confusion changes reflect library growth rather than query difficulty\.

Repeated runs and statistical tests\.Statistical experiments use five matched runs, pairing methods by task or episode and random seed\. Confidence intervals and significance tests are computed over paired outcome\-level differences as described in Appendix[B\.7](https://arxiv.org/html/2608.05604#A2.SS7)\.

## Appendix EDetailed Related Work

Tool use, skill acquisition, and evaluation\. Tool\-augmented agents interleave reasoning with environment actions through prompting\(Yaoet al\.,[2022](https://arxiv.org/html/2608.05604#bib.bib34)\), self\-supervised tool invocation\(Schicket al\.,[2023](https://arxiv.org/html/2608.05604#bib.bib35)\), or large API corpora and benchmarks\(Liet al\.,[2023](https://arxiv.org/html/2608.05604#bib.bib36); Qinet al\.,[2024](https://arxiv.org/html/2608.05604#bib.bib37); Liuet al\.,[2024](https://arxiv.org/html/2608.05604#bib.bib38)\)\. Beyond individual calls, agents increasingly preserve successful behavior as reusable procedural knowledge\. Voyager\(Wanget al\.,[2023](https://arxiv.org/html/2608.05604#bib.bib39)\)accumulates executable programs, Reflexion\(Shinnet al\.,[2023](https://arxiv.org/html/2608.05604#bib.bib40)\)and ExpeL\(Zhaoet al\.,[2024](https://arxiv.org/html/2608.05604#bib.bib41)\)distill feedback into reusable experience, and Agent Workflow Memory\(Wanget al\.,[2024](https://arxiv.org/html/2608.05604#bib.bib42)\)retrieves workflows from prior trajectories\. SkillWeaver\(Zhenget al\.,[2025](https://arxiv.org/html/2608.05604#bib.bib58)\)discovers and hones reusable web APIs through environment exploration, while SkillFoundry\(Shenet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib56)\)extracts operational contracts from heterogeneous scientific resources and iteratively validates, repairs, merges, or prunes the resulting skills\. Agent Skills\(Xu and Yan,[2026](https://arxiv.org/html/2608.05604#bib.bib4)\)formalizes a deployable package containing instructions, scripts, references, and resources\. A recent survey organizes this area around skill representation, acquisition, retrieval, and evolution\(Zhou,[2026](https://arxiv.org/html/2608.05604#bib.bib59)\); complementary ecosystem analysis reports heavy\-tailed lengths and substantial intent\-level redundancy across more than 40,000 public skills\(Linget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib60)\)\. Recent infrastructures further support large\-scale creation and orchestration\(Liet al\.,[2026a](https://arxiv.org/html/2608.05604#bib.bib43); Lianget al\.,[2026b](https://arxiv.org/html/2608.05604#bib.bib44)\), whileSkillsBench\(Liet al\.,[2026b](https://arxiv.org/html/2608.05604#bib.bib3)\), SkillRet\(Choet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib5)\), SRA\(Suet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib6)\), SkillGenBench\(Zhou and others,[2026a](https://arxiv.org/html/2608.05604#bib.bib7)\), and SWE\-Skills\-Bench\(Hanet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib45)\)evaluate skill utility, retrieval, generation, and compatibility\. Together, these studies establish skills as durable procedural memory, although the complete skill package usually remains the unit exposed to retrieval and evaluation\.

Skill organization, retrieval, and execution\. Structured skill representations provide a complementary foundation\. AIP models a skill as a schema\-validated directed execution graph with typed I/O edges\(Blumenfeld and Webber,[2026](https://arxiv.org/html/2608.05604#bib.bib61)\), while the Scheduling–Structural–Logical representation separates skill\-level scheduling, scene\-level execution structure, and action/resource evidence extracted from textual skills\(Lianget al\.,[2026a](https://arxiv.org/html/2608.05604#bib.bib62)\)\. These approaches make individual skill artifacts more machine\-readable for execution, discovery, or governance\. SkillZip instead uses source\-grounded contract\-bearing sections as cross\-skill compression units and couples them to reversible macro rewriting and task\-time hydration\. Progressive disclosure reduces initial context by loading skill metadata before full bodies\(Xu and Yan,[2026](https://arxiv.org/html/2608.05604#bib.bib4)\)\. Graph\-of\-Skills\(Liuet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib8)\)and Group\-of\-Skills\(Zeng and others,[2026](https://arxiv.org/html/2608.05604#bib.bib10)\)then model dependencies, groups, conflicts, or specializations to retrieve structurally coherent skill bundles\. SkillRAE\(Menget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib16)\)compiles reusable subunits, and SkillLens\(Miaoet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib17)\)adapts retrieval across policy, strategy, procedure, and primitive levels\. Post\-retrieval execution\-graph systems construct task\-time DAGs after multiple whole skills have been selected \(e\.g\.,SkillDAG\(Baiet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib11)\)and GRASP\(Xiaet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib9)\)\), whereas SkillNet\(Lianget al\.,[2026b](https://arxiv.org/html/2608.05604#bib.bib44)\)connects skills through an ecosystem\-level ontology\. SkillGraph\(Liet al\.,[2026c](https://arxiv.org/html/2608.05604#bib.bib57)\)represents skills as nodes in an evolving directed graph, retrieves ordered skill subgraphs, and updates prerequisite, enhancement, and co\-occurrence relations from trajectory feedback\. SkillOps\(Puet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib55)\)instead associates each skill with a typed contract and maintains a hierarchical ecosystem graph using utility, compatibility, risk, and validation signals\. Related graph\-based systems use topology for multi\-step evidence retrieval, memory, and routing\(Tanet al\.,[2025](https://arxiv.org/html/2608.05604#bib.bib2); Xiang and others,[2026](https://arxiv.org/html/2608.05604#bib.bib23); Fenget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib22)\)\. These methods improve which skills an agent selects and how selected skills are orchestrated\. Their graph units nevertheless remain whole skills or task\-time invocations rather than recurring section subgraphs compressed into reversible executable macros\.

Skill compression and procedural memory\. LLMLingua and its extensions\(Jianget al\.,[2023](https://arxiv.org/html/2608.05604#bib.bib25),[2024](https://arxiv.org/html/2608.05604#bib.bib26); Pan and others,[2024](https://arxiv.org/html/2608.05604#bib.bib27)\)compress prompt sequences, while SkillReducer\(Gaoet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib14)\), SkillEE\(Xinget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib15)\), and SKIM\(Wanget al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib13)\)reduce skill context through token reduction, cost\-aware rewriting, or compact multi\-resolution representations\. Experience Compression Spectrum\(Zhanget al\.,[2026b](https://arxiv.org/html/2608.05604#bib.bib21)\)instead relates memories, skills, and rules as levels of experience abstraction\. Skill\-Pro\(Mi and others,[2026](https://arxiv.org/html/2608.05604#bib.bib12)\), ReasoningBank\(Ouyang and others,[2026](https://arxiv.org/html/2608.05604#bib.bib20)\), MEM1\(Zhou and others,[2026b](https://arxiv.org/html/2608.05604#bib.bib18)\), and MemGen\(Zhanget al\.,[2026a](https://arxiv.org/html/2608.05604#bib.bib19)\)learn or organize reusable memory from agent trajectories; recent procedural\-memory management further studies how such knowledge should be controlled, adapted, and evaluated over time\(Belikovaet al\.,[2026](https://arxiv.org/html/2608.05604#bib.bib46)\)\. These approaches shorten prompts, rewrite individual skills, or abstract successful experience\. Cross\-skill compression additionally requires repeated procedures to remain distinguishable by their execution interfaces, dependencies, and verification conditions\.

Graph summarization and grammar\-based compression\. Frequent\-subgraph methods discover recurring structure through description\-length search or canonical enumeration\(Cook and Holder,[1994](https://arxiv.org/html/2608.05604#bib.bib49); Yan and Han,[2002](https://arxiv.org/html/2608.05604#bib.bib29); Nijssen and Kok,[2004](https://arxiv.org/html/2608.05604#bib.bib50)\)\. Graph summarization represents large graphs through attribute\-aware grouping\(Tianet al\.,[2008](https://arxiv.org/html/2608.05604#bib.bib51)\), structure\-preserving summaries\(LeFevre and Terzi,[2010](https://arxiv.org/html/2608.05604#bib.bib32)\), or MDL\-selected vocabularies\(Koutraet al\.,[2014](https://arxiv.org/html/2608.05604#bib.bib28)\)\. Scalable and lossless methods further optimize summary construction, query preservation, and storage\(Shinet al\.,[2019](https://arxiv.org/html/2608.05604#bib.bib52); Leeet al\.,[2020](https://arxiv.org/html/2608.05604#bib.bib53),[2022](https://arxiv.org/html/2608.05604#bib.bib54)\)\. Grammar\-based graph compression\(Maneth and Peternek,[2018](https://arxiv.org/html/2608.05604#bib.bib30)\)provides reversible replacement rules and supports reachability or regular\-path queries over compressed representations, while MoSSo\(Koet al\.,[2020](https://arxiv.org/html/2608.05604#bib.bib31)\)studies incremental lossless maintenance\. Accordingly, motif discovery, MDL selection, reversible grammars, compressed querying, and incremental summaries are established graph techniques\. SkillZip adapts them to procedural skill libraries by validating every occurrence against typed boundary ports, dependency closure, verifier reachability, and source provenance before replacement, then hydrating the compressed graph under a task budget\.

## Appendix FPrompts

This section summarizes the model\-assisted prompts used by SkillZip\. They correspond to two operations in the main pipeline\. Sec2Graph first analyzes source\-grounded sections and then normalizes their cross\-section data flow; PathHydrate converts each task into the structured anchors used for seed retrieval\. The former is performed offline and cached with the library, while the latter is cached per task\. All calls use temperature zero\. This generation limit is separate from the procedural\-context budget: section\-level extraction uses a 512\-token output limit, per\-skill normalization uses 2,048 tokens, and task anchoring uses the configured structured\-output limit\. The remaining modules do not introduce hidden prompt steps\. MotifZip, procedural graph construction, constrained subgraph search, closure repair, macro rendering, and ReZip are deterministic graph operations\. Dense retrieval uses embeddings over the task anchors and section contents\. For reproducibility, we separately report the thin benchmark interfaces that deliverCqC\_\{q\}to the task executor and allow targeted source expansion\. These interfaces do not change the procedural graph or its contracts\.

Notation\.ssdenotes a source skill,bba source\-grounded section,qqa task query,ppa benchmark profile, andCqC\_\{q\}the hydrated executable context\. Variables enclosed by braces are instantiated at runtime\.

Section role and contract extraction\. This prompt implements the model\-assisted analysis described in Section[4\.1](https://arxiv.org/html/2608.05604#S4.SS1)\. It receives one candidate section after source\-preserving segmentation and returns the role and local contract fields of its section node\. The SkillsBench profile describes technical software\-agent skills; the ALFWorld profile describes navigation and household manipulation\. Profile\-specific demonstrations using the same schema are prepended as user–assistant turns\.

Section Role and Contract Extraction Prompt TemplateSystem role\.You analyze one section of a procedural skill document for an AI agent\. The domain is\{DomainProfile\}\. Extract the section’s structured execution semantics and return one JSON object without prose or markdown\.Execution roles\.Choose one or more roles from the following set and list the most specific role first:intent: the overall goal of the skill;trigger: when the skill should be invoked;input: values or parameters consumed by the procedure;precondition: world or environment conditions required before execution;operation: an executable action, function call, algorithm step, or code block;resource: a required tool, API, library, file, credential, or device;failure: an error case or recovery condition;verifier: an observable check of successful completion;output: the resulting artifact or post\-condition\.Extraction rules\.Use concise noun phrases for input and output signatures\. Preconditions must block execution when false; effects describe state changes rather than the action itself; verifier hooks must be observable strings, return values, or conditions\. Do not infer unsupported fields\. Use an empty list when a field is absent\.Return format \(strict JSON\):\{ "roles": \["\.\.\."\], "input\_signature": \["\.\.\."\], "output\_signature": \["\.\.\."\], "preconditions": \["\.\.\."\], "effects": \["\.\.\."\], "verifier\_hooks": \["\.\.\."\] \}Final user turn\. Skill: \{SkillName\} Section: \{SectionText\}

ForSkillsBench,\{DomainProfile\}specifies programming, scientific computing, data analysis, security, machine learning, visualization, or another engineering domain\. For ALFWorld, it specifies the text\-based household environment and its navigation, pickup, placement, cleaning, heating, cooling, toggling, and slicing actions\. For example, a cleaning instruction that executes an action and checks the resulting observation is labeled with bothoperationandverifier\.

Cross\-section signature canonicalization\. Local extraction can assign different names to the same artifact\. Sec2Graph therefore performs a second offline pass over all signature\-bearing sections of one skill\. The prompt normalizes producer and consumer signatures without changing section boundaries, roles, source pointers, or skill membership\. Its output supports the typed dependency edges used by procedural subgraph construction\.

Shared Contract Vocabulary Prompt TemplateYou are a data\-flow analyst for AI software\-agent skill documents\. You are given all numbered procedural sections of one skill\. Build a shared artifact vocabulary so that an artifact produced by one section has exactly the same canonical name when consumed by another\.First identify every artifact or state passed between sections\. Assign each a single descriptivesnake\_casenoun and reuse that token everywhere\. For example, useperiodogramrather than separate tokens such asperiodogram\_object,power\_array, orlomb\_scargle\_resultfor the same artifact\.For every section, list the canonical tokens it consumes and produces, together with guards that must already hold\. External files, datasets, parameters, and environment states may appear as inputs without an internal producer\. Sections with no procedural data flow receive empty lists\. Do not copy inconsistent seed signatures from the input; infer one shared vocabulary from the section contents\.Return format \(strict JSON\):\{ "\{SectionIndex\}": \{ "in": \["\.\.\."\], "out": \["\.\.\."\], "guards": \["\.\.\."\] \}, \.\.\. \}Skill: \{SkillName\} Sections: \[\{Index\}\] roles=\{Roles\} \{SectionText\} \.\.\.

SkillsBenchtask anchoring\. At inference time, PathHydrate maps an artifact\-oriented task brief and its agent\-visible metadata to the structured task objectzqz\_\{q\}defined in Section[4\.3](https://arxiv.org/html/2608.05604#S4.SS3)\. The prompt expresses deliverables using the same signature vocabulary as Sec2Graph and decomposes the task into ordered subgoals for section\-level seed retrieval\.

Technical Task Anchoring Prompt TemplateYou analyze a programming or data task for a node\-centric skill\-retrieval engine\. The engine retrieves procedural section nodes and assembles an executable subgraph\. Re\-express the task so that its deliverables and operations match section output signatures and operation contents\.Return one JSON object with exactly these fields:goal, a one\-sentence objective;domain, a short domain tag;target\_outputs, two to six concrete artifacts written assnake\_casesignature tokens;capabilities, three to eight concise verb–object operations;inputs, the resources supplied by the task; andsub\_goals, an ordered list of two to five steps\. Each subgoal containsindex,description,target\_output,retrieval\_query, and localcapabilities\. Use the task’s nouns and do not invent unrelated steps\.Return format \(strict JSON\):\{ "goal": "\.\.\.", "domain": "\.\.\.", "target\_outputs": \["\.\.\."\], "capabilities": \["\.\.\."\], "inputs": \["\.\.\."\], "sub\_goals": \[\{ "index": 1, "description": "\.\.\.", "target\_output": "\.\.\.", "retrieval\_query": "\.\.\.", "capabilities": \["\.\.\."\] \}\] \}TASK BRIEF: \{TaskBody\} DOMAIN HINT: \{Domain\} OUTPUT FILES: \{OutputFiles\}

The domain hint and output\-file list are derived from the same task brief and metadata exposed to the executor\. Benchmark verifier source, assertions, and outcomes are not inputs to this prompt; they are used only after execution to score the produced artifact\.

ALFWorld task anchoring\. The embodied profile produces the same task objectzqz\_\{q\}, but makes implicit navigation, pickup, state\-change, and placement steps explicit\. This is needed because an ALFWorld goal often names only the target state and destination, whereas retrieval must cover the complete action chain\.

Embodied Task Anchoring Prompt TemplateYou analyze an embodied household task for an action\-skill retrieval engine\. The skill library contains the following action families: navigation to a location or receptacle, object pickup, object placement, cleaning at a sink basin, heating with an appliance, cooling with a fridge, device operation, and slicing with a tool\.Construct the full executable action chain\. Every object\-manipulation task must make explicit the steps needed to navigate to the object, pick it up, navigate to the destination, and place it\. Insert cleaning, heating, cooling, toggling, or slicing when required by the goal, in the order in which the agent must execute them\.Return the same JSON schema as the technical task\-anchoring prompt:goal,domain,target\_outputs,capabilities,inputs, and orderedsub\_goals\. Use two to five end\-state tokens and three to six subgoals\. Phrase eachretrieval\_queryusing action verbs that directly match the corresponding skill family\. Return strict JSON only\.TASK BRIEF: \{TaskBody\} DOMAIN HINT: embodied household navigation VISIBLE OBJECTS OR RECEPTACLES: \{Inputs\}

Both task\-anchoring profiles are parsed into the common representationzqz\_\{q\}\. The raw query is retained alongside this abstraction, allowing the dual\-level seed fusion in PathHydrate to combine signature\-oriented subgoal matching with the original task wording\.

Benchmark execution interfaces\. The following templates are not additional graph\-construction or retrieval stages\. They specify how the context produced by PathHydrate is exposed to each benchmark executor\. The task statement and hydrated section contents are retained unchanged; the interface adds only the retrieval and expansion controls needed to evaluate progressive hydration\.

SkillsBenchcontext delivery\.ForSkillsBench, the hydrated plan is written to the instruction file read by the OpenHands or command\-line executor\. The template leaves the executor’s base prompt unchanged and exposes the complete source library through a search tool\. The bounded search policy prevents the agent from spending its execution budget on repeated retrieval after the required procedure is clear\.

SkillsBenchExecution\-Context InterfaceUse the following SkillZip execution plan to solve the task:\{HydratedContext\}A skill\-search tool over the complete source library is available\. Locate the tool once\. At the start, issue one or two short searches using the required artifact, format, operation, or API, and inspect the one or two most relevant source skills for exact parameters or steps\.Then commit to implementing the solution\. Do not continue searching after the required procedure is clear\. Search again only when execution reaches a specific obstacle that another skill can address\. Prefer the shortest path to producing and verifying the required output artifacts\.Task: \{TaskBrief\} Workspace and available files: \{EnvironmentState\}

ALFWorld action and source\-expansion interface\.For ALFWorld, the executor receives the hydrated context together with the current observation and admissible actions\. It returns either one environment action or one request for missing procedural detail\. An expansion request is appended to the task and recent interaction state, after which PathHydrate returns an updatedCqC\_\{q\}within the fixed expansion budget\.

ALFWorld Action and Expansion InterfaceYou are an ALFWorld agent\. On each turn, return exactly one JSON object\.Action turn: \{"thought": "<one short sentence\>", "action": "<one admissible environment action\>"\}Expansion turn: \{"thought": "<one short sentence\>", "expand\_request": "<the missing procedural detail\>"\}Use exactly one ofactionorexpand\_request\. Prefer an environment action when the next move is clear\. Request expansion only when the current hydrated context lacks a concrete procedural detail\. Do not invent tools or commands\. State\-changing actions such as clean, heat, or cool do not place an object; execute a separate placement action when the goal requires it\.Episode: \{Episode\} Goal: \{TaskQuery\} Hydrated executable context: \{HydratedContext\} Current observation: \{Observation\} Admissible actions: \{AdmissibleActions\}

Similar Articles

SkillSmith: Compiling Agent Skills into Boundary-Guided Runtime Interfaces

arXiv cs.AI

SkillSmith is a boundary-first compiler-runtime framework that extracts fine-grained operational boundaries from LLM agent skills, enabling agents to dynamically access only relevant components, reducing solve-stage token usage by 57.44% and thinking iterations by 42.99% on the SkillsBench benchmark.

SkillOpt: Executive Strategy for Self-Evolving Agent Skills

Hugging Face Daily Papers

SkillOpt introduces a systematic text-space optimizer for agent skills that trains skills as external agent state with stable updates and zero deployment inference overhead, achieving superior performance across multiple benchmarks and execution environments.

Experience Compression Spectrum: Unifying Memory, Skills, and Rules in LLM Agents

arXiv cs.CL

This paper proposes the Experience Compression Spectrum, a unifying framework that integrates agent memory, skill discovery, and rule-based systems along a single axis of increasing compression (5-20× for episodic memory, 50-500× for procedural skills, 1000×+ for declarative rules). The work identifies a critical gap—the 'missing diagonal'—showing that existing systems operate at fixed compression levels without adaptive cross-level support, and articulates design principles for scalable, full-spectrum agent learning systems.