---
title: 'SkillReducer: Build-Time Skill Debloating'
url: https://www.emergentmind.com/topics/skillreducer
type: topic
---

# SkillReducer: Build-Time Skill Debloating

SkillReducer is a build-time skill debloating framework for LLM coding agents that treats skills as structured software artifacts rather than immutable prompt text. In the formulation studied in "SkillReducer: Optimizing LLM Agent Skills for Token Efficiency" [2603.29919], a skill \(s\) consists of a routing **description** \(s.d\), a main **body** \(s.b\), optional **references** \(s.R\), and scripts, with the original invocation cost defined as
\[
\text{Cost}(s) = |s.d| + |s.b| + \sum_{r \in s.R} |r|.
\]
Its objective is to construct an optimized skill \(s'\) with substantially lower token cost while preserving **routing equivalence** and **functional retention** [2603.29919]. The framework was motivated by a large-scale empirical study of 55,315 publicly available skills showing that 26.4% lack descriptions entirely, 44.1% are missing or under 20 tokens, only 38.5% of body content is core rule content, and reference-heavy skills can inject tens of thousands of tokens per invocation [2603.29919].

## 1. Scope, representation, and empirical motivation

SkillReducer studies the skill format used by coding agents such as Claude Code, Cursor, and Windsurf, where descriptions are used for routing and the selected skill’s body and references are then injected into the context window [2603.29919]. In that setting, skills were originally intended to improve token efficiency by encapsulating reusable instructions, but the paper argues that many have become bloated prompt artifacts whose token overhead increases both monetary cost and attention dilution [2603.29919].

The empirical study covers three sources: **Wild** with 55,315 user-created skills from public GitHub repositories, **SkillHub** with 100 curated marketplace skills, and **Community** with 620 forum- or social-platform-shared skills [2603.29919]. Within Wild, 67.5% of skills are single-file, 14.8% include reference files, and 8.3% include scripts; average body and description lengths are 2,796 and 45.9 tokens respectively, while SkillHub averages 5,922 body tokens and 47.78 description tokens [2603.29919]. In the paragraph-level analysis of 15,107 items from 90 skills, content is distributed as 38.5% **core rule**, 40.7% **background**, 12.9% **example**, 7.6% **template**, and 0.3% **redundant**, which is the basis for the claim that over 60% of body content is non-actionable [2603.29919].

These measurements define the paper’s central problem: skill inefficiency is not confined to one component. Descriptions are often either absent or oververbose, bodies interleave actionable rules with explanatory mass, and references are frequently loaded monolithically [2603.29919]. A plausible implication is that the dominant failure mode is architectural rather than merely lexical: skills mix routing metadata, execution constraints, examples, templates, and documentation into a single always-loaded prompt object.

## 2. Two-stage architecture

SkillReducer separates optimization into two stages because descriptions and bodies serve different roles and therefore require different validation criteria [2603.29919]. Stage 1 is **routing-layer optimization** over \(s.d\); Stage 2 is **body restructuring via progressive disclosure** over \(s.b\) and \(s.R\) [2603.29919].

Stage 1 compresses existing descriptions or generates missing ones. The description is segmented into semantic clauses \(U=\{u_1,\ldots,u_n\}\), and a simulated routing oracle
\[
\mathcal{O}(d, Q, C) \to \{0,1\}
\]
tests whether a candidate description \(d\) causes the target skill to be selected for each query in \(Q\) against a candidate pool \(C\) containing the target skill, four TF-IDF distractors, and one LLM-generated adversarial skill \(s_{\text{adv}}\) [2603.29919]. Delta debugging then seeks a 1-minimal subset \(U^* \subseteq U\) that still passes routing, after which retained clauses may be paraphrased and polished if the oracle still passes [2603.29919]. Missing descriptions are generated from the body by extracting a **primary capability**, a **trigger condition**, and **unique identifiers** such as libraries, APIs, or endpoints, each in 20–40 tokens, again subject to oracle validation [2603.29919].

Stage 2 replaces a monolithic body with a compact always-loaded core \(b^*\) and a set of on-demand reference modules \(R^*=\{r_1^*,\ldots,r_n^*\}\) [2603.29919]. The optimized invocation cost is
\[
\text{Cost}'(s) = |s'.d| + |b^*| + \sum_{r \in R^*_{\text{used}}} |r|,
\]
where \(R^*_{\text{used}} \subseteq R^*\) contains only the references actually loaded for a task [2603.29919]. Body items are classified into five categories—core rule, background, example, template, redundant—and only **core rules** remain in the always-loaded body by default [2603.29919]. Examples, templates, and background are moved into on-demand modules such as `examples.md`, `templates.md`, or `background.md`; references are deduplicated against the body, compressed, and annotated with **when** clauses and **topics** keywords to support selective loading [2603.29919].

The design objective is progressive disclosure rather than irreversible deletion. The expected cost model is
\[
\mathbb{E}[\textup{Cost}'(s)] = |s'.d| + \alpha \cdot \rho \cdot |s.b| + \sum_{j=1}^{k} p_j \cdot |r_j^*|,
\]
where \(\rho\) is the fraction of body items classified as core, \(\alpha\) is the compression factor within the core, and \(p_j\) is the probability that reference \(r_j^*\) is loaded [2603.29919]. Using empirical values \(\rho = 0.383\), \(\alpha \approx 0.63\), and \(p \approx 0.30\), the paper derives an expected body cost multiplier of \(0.426\), corresponding to a 57.4% best-case body cost reduction; a conservative scenario gives 30.9%, and the observed range is 26.8%–43.2% [2603.29919].

## 3. Validation logic, faithfulness, and feedback

SkillReducer’s compression is guarded by two explicit validation layers. **Gate 1** is a structural faithfulness check over content types, requiring that every operational concept present in the original body remain present either in the compressed core or in some reference module:
\[
\forall \tau:\; \mathcal{C}_\tau(s.b) \subseteq \mathcal{C}_\tau(b^*) \cup \bigcup_{r \in R^*}\mathcal{C}_\tau(r).
\]
This check is performed per content type, and only failing types are rolled back [2603.29919].

**Gate 2** is task-based evaluation. For each skill, five evaluation tasks are generated, some **core-only** and some **needs-reference**, and the skill is tested under three conditions: **D** (no skill), **A** (original body plus all references), and **C** (compressed core plus on-demand references) [2603.29919]. If compression reduces performance, failed rubric criteria are traced back to non-core items that should have remained in the core; those items are then promoted to `core_rule` and appended in their original form without further compression, and Gate 2 is rerun for up to two iterations [2603.29919]. The paper formalizes the monotone growth of the core set as
\[
I_{\textup{core}^{(0)}} \subseteq I_{\textup{core}^{(1)}} \subseteq \cdots
\]
and notes finite termination, though it also states that score monotonicity can fail in practice because additional content may distract the model [2603.29919].

Routing descriptions receive an analogous real-environment validation. After ddmin and paraphrase-based compression, descriptions are tested using the Claude Code CLI, and if a compressed description fails to trigger for all queries in
\[
Q_{\text{val}} \subseteq Q,
\]
deleted clauses are greedily restored up to three times via
\[
u^+ \leftarrow \arg\max_{u \in D} TriggerRate(U^* \cup \{u\}, Q_{\text{val}})
\]
before falling back to the original description [2603.29919]. This selective-restore mechanism reflects the paper’s general philosophy: optimize aggressively, but preserve behavior conservatively.

## 4. Evaluation methodology and main results

The main evaluation uses 600 skills: 87 official SkillHub skills, 464 community skills, and 49 stratified Wild GitHub skills [2603.29919]. A separate external evaluation is conducted on SkillsBench with 87 tasks across 229 skills and deterministic pytest-style verifiers [2603.29919]. Compression quality is measured by compression ratio, pass rate, improvement rate, and **retention**
\[
\text{Retention}(t) =
\begin{cases}
1.0 & \text{if } \text{score}_A(t) = 0 \\
\min\!\left(\frac{\text{score}_C(t)}{\text{score}_A(t)},\;1.0\right) & \text{otherwise}.
\end{cases}
\]
Evaluation uses both code-execution tasks and rubric tasks, with Cohen’s \(\kappa = 0.939\) between LLM judging and deterministic verifiers on 1,646 overlapping tasks [2603.29919].

The reported results are the core empirical identity of SkillReducer. Across the 600-skill evaluation, it achieves **48.0% mean description reduction** and **39.0% mean body reduction**, with 95% confidence intervals of \([45.2\%, 50.8\%]\) and \([36.2\%, 41.8\%]\) respectively [2603.29919]. On functional quality, the no-skill condition \(D\) scores 0.684, the original-skill condition \(A\) scores 0.722, and the compressed condition \(C\) scores 0.742, yielding the reported **2.8% functional quality improvement** and an **86.0% pass rate** [2603.29919]. The paper characterizes this as a **less-is-more effect**, arguing that removing non-essential content can reduce distraction in the context window [2603.29919].

Routing preservation is exact on non-obsolete skills: **536/536 = 100%** [2603.29919]. Across five models from four families, retention is 0.986 on GLM-5, 0.978 on DeepSeek-V3, 0.955 on Qwen3-max, 0.982 on GPT-OSS-120B, and 0.939 on Qwen2.5-7B, for a mean of **0.965** [2603.29919]. On OpenCode v1.2.27, an independent agent framework, mean retention is **0.944**, with compressed skills scoring 0.764 versus 0.751 for originals [2603.29919]. On SkillsBench, body tokens drop from **359K to 84K**, corresponding to a **75.0% mean per-task reduction** [2603.29919].

SkillReducer also outperforms equal-budget baselines. In the 50-skill baseline comparison, retention is 0.820 for LLMLingua, 0.918 for direct LLM compression, 0.845 for truncation, 0.750 for random sentence removal, and **0.949** for SkillReducer [2603.29919]. The strongest ablation result is that taxonomy classification is central: removing it lowers retention to 0.919, a 6.8 percentage point gap relative to the full pipeline, whereas reference deduplication is especially safe and even improves outcomes in one ablation, with retention 1.000 and score 0.944 > 0.939 [2603.29919].

A recurring misconception addressed by these results is that all compression failures are equally attributable to the reducer. The paper reports that among the 14.0% regressions, about half are due to skill obsolescence, 17% to evaluation noise, and only 33% are genuine compression failures, implying **4.7% of all skills** are true compression failures [2603.29919]. The main failure mode is **example-as-specification**, where examples encode behavior that is not redundantly stated as explicit rules [2603.29919].

## 5. Position within the broader skill-optimization literature

SkillReducer belongs to a broader research line on reducing the active burden of agent skills at inference time, but it addresses a different layer of the stack from related methods. Its direct contribution is build-time debloating of human-authored skill artifacts [2603.29919]. Adjacent work targets organization, retrieval, invocation, weight-space compilation, or latent compression.

Skill organization is treated explicitly in "SkillJuror: Measuring How Agent Skill Organization Changes Runtime Behavior" [2606.11543]. That paper holds knowledge fixed while comparing a normalized flat baseline with **Progressive Disclosure**, showing that distinct skill resources touched per trajectory rise from 1.18 to 3.85, effective uptake events rise from 1.33 to 3.92, and verifier-passing trials improve by 17 out of 410 matched trials, or +4.1% [2606.11543]. This is closely aligned with SkillReducer’s Stage 2 progressive disclosure design, but SkillJuror studies organizational effects under semantically controlled variants rather than compression itself [2606.11543].

Query-adaptive reduction within a single known skill document is the focus of "SkillPager: Query-Adaptive Intra-Skill Navigation via Semantic Node Retrieval" [2606.00822]. SkillPager parses Markdown skills into typed semantic nodes and uses MMR-based global selection, reaching **78.89%** LLM-judged context sufficiency versus **82.23%** for full-document prompting while reducing prompt tokens by **47.04%** on a 395-skill, 1,975-query benchmark [2606.00822]. This suggests a complementary interpretation of SkillReducer: not only offline debloating, but also runtime query-conditioned recovery of the minimum execution-sufficient subset.

Another branch relocates skills from context space to weight space. "LatentSkill" converts textual skills into LoRA adapters through a pretrained hypernetwork, improving ALFWorld success by 21.4 and 13.4 points on seen and unseen splits with **64.1% fewer prefill tokens**, and improving Search-QA exact match by 3.0 points with **72.2% lower skill-token overhead** [2606.06087]. "Skill-to-LoRA" similarly replaces runtime `SKILL.md` text with skill-specific LoRA adapters, improving pass rate by **2.9** points over no-skill and **5.2** points over Full Skill Text while reducing per-step token cost by **6.6%** relative to Full Skill Text prompting [2606.16769]. These methods do not debloat the textual artifact itself; instead, they compile its behavioral effect into parameters. This suggests a broader taxonomy in which SkillReducer is the text-space analogue of weight-space skill compilation.

Selective invocation is studied in "Skill or Skip? Learning Selective Skill Invocation in Agentic Tasks via Dual-Granularity Preference Learning" [2606.00510]. SelSkill treats skill use as a skill-or-skip decision and reports improvements of **10.9** success-rate points and **29.1** execution-precision points on ALFWorld, plus **5.7** success-rate points and **29.5** execution-precision points on BFCL [2606.00510]. The connection is orthogonal: SkillReducer reduces the size of a skill once invoked, whereas SelSkill reduces unnecessary invocation events themselves.

Finally, "Adaptive Multi-Resolution Procedural Knowledge Compression for Large Language Models" introduces SKIM, which compresses skill content into adaptive soft-token prefixes and reports compression to **30% to 60%** of original token length while preserving task performance better than existing compression methods [2606.12203]. SKIM is the closest latent-compression counterpart to SkillReducer’s progressive disclosure. Both target repeated skill reuse, but one preserves human-readable text structure while the other produces model-specific soft-token artifacts [2606.12203].

## 6. Limitations, failure conditions, and historical significance

SkillReducer’s stated limitations follow directly from its assumptions and evaluation scope. The 600-skill study follows the Anthropic/Claude Code skill protocol, so cross-platform generalization beyond the evaluated frameworks remains limited [2603.29919]. Cross-model transfer covers five models from four families, but not all relevant families [2603.29919]. The 198-skill Wild scalability study runs only Gate 1 faithfulness rather than full Gate 2 task evaluation due to cost [2603.29919]. The pipeline also relies on LLM-based classification, compression, and some evaluation, though it mitigates this with temperature 0, compressor/evaluator separation, deterministic verifiers where available, and conservative fallback policies [2603.29919].

The principal technical boundary condition is the already noted **example-as-specification** case [2603.29919]. When examples implicitly encode required behavior rather than merely illustrating explicit rules, moving them to on-demand references can underexpose operational content. A related implication is that progressive disclosure is safest when rule content and support content are cleanly separable; it becomes riskier when explanatory and executable semantics are deeply entangled.

Historically, SkillReducer is significant because it reframes prompt optimization for agent skills as a software-engineering problem rather than a pure summarization problem. Its explicit borrowings from software debloating, delta debugging, program slicing, and progressive disclosure are not decorative: they define the framework’s causal assumptions and evaluation logic [2603.29919]. In that respect, the paper occupies a distinct position in the literature. It neither trains a new runtime policy nor compiles skills into latent weights; instead, it restructures the skill artifact so that the context window carries less inert text and more operational signal.

This suggests a broader interpretation of the term “SkillReducer.” In the narrow sense, it denotes the two-stage skill debloating framework of [2603.29919]. In a wider research sense, it names a class of methods that reduce the active burden of agent skills—by textual debloating, typed retrieval, progressive disclosure, selective invocation, or weight-space relocation—while attempting to preserve or improve skill-mediated behavior [2606.00822] [2606.06087] [2606.00510] [2606.16769] [2606.12203]. Within that wider class, SkillReducer is the canonical text-structural formulation: smaller skills, explicitly validated, that remain editable, inspectable, and often functionally superior precisely because they expose less irrelevant prompt matter to the model.

Source: https://www.emergentmind.com/topics/skillreducer