Adaptive Skill Granularity for Coding Agents: Runtime Routing and Macro-to-Micro Recovery

cs.AI cs.SE Dingxuan Zhang, Yanhui Jiang, Jun Wang, Hefeng Zhou · Oct 22, 2026
Local to this browser
What it does
Coding agents typically retrieve skills before execution but rarely choose at runtime whether to invoke coarse macro skills or fine-grained primitives. This paper reframes skill use as a runtime control problem, introducing Adaptive Skill...
Why it matters
This paper reframes skill use as a runtime control problem, introducing Adaptive Skill Granularity: a decision-tree router selects micro, macro, or hybrid execution, and a finite-state executor downgrades from macro to micro after...
Main concern
The formal separation of granularity control from retrieval (Eq. 2–5) is precise and engineer-friendly, yet the evidence base is thin: only 12 mixed tasks and 7 recovery tasks with three hand-written macros appear in the pilot study,...
Community signal
0
0 up · 0 down
Sign in to vote with arrows
AI Review AI reviewed
Plain-language introduction

Coding agents typically retrieve skills before execution but rarely choose at runtime whether to invoke coarse macro skills or fine-grained primitives. This paper reframes skill use as a runtime control problem, introducing Adaptive Skill Granularity: a decision-tree router selects micro, macro, or hybrid execution, and a finite-state executor downgrades from macro to micro after observable failures. The framework matters because it shifts skill libraries from static documents into controllable, verifiable execution abstractions that can trade off efficiency against robustness.

Critical review
Verdict
Bottom line

The formal separation of granularity control from retrieval (Eq. 2–5) is precise and engineer-friendly, yet the evidence base is thin: only 12 mixed tasks and 7 recovery tasks with three hand-written macros appear in the pilot study, leaving claims about robustness and cost-efficiency as proof-of-concept rather than established findings. The authors candidly acknowledge this by stating that "Future work will extend GranBench-Code across broader task sets, repositories, failure modes, and models" (Section 6). Meanwhile, the motivating external finding that "39 of 49 skills yield zero pass-rate improvement" (SWE-Skills-Bench, Sec. 1) is borne out by our source check, confirming that the runtime granularity problem is real but not yet solved at scale.

“Future work will extend GranBench-Code across broader task sets, repositories, failure modes, and models”
“39 of 49 skills yield zero pass-rate improvement”
What holds up

The strongest contributions are conceptual and architectural. The admissible-action formalism in Eq. (2) clearly distinguishes runtime granularity control from prior retrieval work: "the controller changes the action abstraction available to the downstream agent" (Section 3.2). The three design invariants—pre-execution routing, event-driven recovery, and verifier-defined success—make the system auditable, and the macro skill contract (Eq. 10) with explicit preconditions, effects, and fallback paths is a solid engineering requirement. The choice of a shallow deterministic JSON decision tree "guaranteeing full auditability" (Section 4.4) is a welcome departure from opaque neural routers.

“the controller changes the action abstraction available to the downstream agent”
Zhang et al., Sec. 3.2 · Section 3.2
“guaranteeing full auditability”
Zhang et al., Sec. 4.4 · Section 4.4
Main concerns

The evaluation is severely under-powered: Table 2 reports 12 mixed tasks, Table 3 uses 7 tasks, and the full end-to-end test returns to just 7 tasks, so any statistical claim is unsupported. The learned router achieves 100% success, but it is trained on empirical labels from the same tiny dataset with no holdout split described, making the result likely overfit. The paper also explicitly defers critical baselines, admitting it is only "specifying the unconstrained and LLM-router baselines required for the full study" (Section 1). Finally, the five-class failure taxonomy—introducing labels such as "precondition mismatch when the macro does not apply to the current workspace" (Section 4.6)—is never applied in the reported results, so there is no evidence that recovery succeeds differentially by failure type.

“specifying the unconstrained and LLM-router baselines required for the full study”
“precondition mismatch when the macro does not apply to the current workspace”
Zhang et al., Sec. 4.6 · Section 4.6
Evidence and comparison

Within the small-scale experiments, the evidence supports the qualitative trend that micro execution is robust but costly and macro execution is brittle. However, the quantitative claims are unreliable because the learned router is trained and tested on the same 12 tasks. Comparisons to related systems such as HiMAC or SkillRouter are positional rather than empirical: the paper never runs head-to-head experiments. The motivating claim that "SWE-Skills-Bench reports that skill injection can yield uneven gains and higher cost depending on abstraction level and context fit" (Section 2) is externally verifiable—we confirmed that the source finds "39 of 49 skills yield zero pass-rate improvement" (SWE-Skills-Bench, Sec. 1)—but the leap from limited skill utility to the necessity of runtime granularity control is plausible yet experimentally undemonstrated.

“SWE-Skills-Bench reports that skill injection can yield uneven gains and higher cost depending on abstraction level and context fit”
“39 of 49 skills yield zero pass-rate improvement”
Reproducibility

Reproducibility is mixed. The authors provide a public GitHub repository URL and use a deterministic JSON decision-tree router, which aids auditability. Yet the benchmark itself—GranBench-Code with its hand-written tasks and macros—is not described in sufficient detail to reconstruct independently; there is no mention of task prompts, repository fixtures, or validator scripts. Crucial LLM hyperparameters such as model version, temperature, or system prompt are omitted, and the three macro implementations are only summarized at a high level. The paper states that "Code is available at: https://github.com/Jayceon-3/Adaptive-Skill-Agent" (title block), and the macro contract is formally given as "m = (name, args, pre, effect, Vm, Fm, fallback)" (Eq. 10), but without the benchmark artifacts and full experimental configuration, independent reproduction remains blocked.

“Code is available at: https://github.com/Jayceon-3/Adaptive-Skill-Agent”
Zhang et al., title block · Title / author block
“m = (name, args, pre, effect, Vm, Fm, fallback)”
Zhang et al., Eq. 10 · Equation 10
Abstract

Reusable skills allow large language model agents to package task-specific procedures, tool affordances, and execution guidance into modular units. Prior work has largely studied how agents retrieve, compose, or synthesize skills before execution. In coding agents, however, execution poses an additional runtime control problem: the same task may be solved through primitive tool calls, macro skills, or hybrid execution that starts with a macro and falls back to micro-level recovery. We introduce Adaptive Skill Granularity, a framework that treats skill granularity as an action-abstraction policy conditioned on task structure, execution state, and macro-skill failures. The system combines a feature-based granularity controller and a finite-state recovery executor. We evaluate the framework with a deterministic coding-agent protocol using verifier-defined success, total cost, and process metrics such as macro adoption, failure recovery, route match, and transition correctness. Results show that fixed macro execution is efficient when applicable but brittle under mismatch, while runtime routing and explicit macro-to-micro recovery improve robustness and recover controlled macro failures that fixed-granularity execution leaves unresolved. Our findings suggest that skill libraries for coding agents should be treated not only as retrievable resources, but also as controllable, verifiable, and recoverable execution abstractions.

Challenge the Review

Pick a starting point or write your own. Challenges run in the background, so you can keep reading while the AI investigates.

No challenges yet. Disagree with the review? Ask the AI to revisit a specific claim.