Skill-as-Pseudocode: Refactoring Skill Libraries to Pseudocode for LLM Agents

Xinze Li, Yuhang Zang, Yixin Cao, Aixin Sun


Abstract
Markdown skill libraries for LLM agents ship as free-form prose, forcing the agent to re-derive both the input schema and the concrete invocation syntax on every retrieval. This produces a "confused → re-retrieve → still confused" loop: the agent issues a partially-correct action, receives uninformative feedback, and re-retrieves the same prose. We propose Skill-as-Pseudocode (SaP), an automatic conversion of markdown skill libraries into typed pseudocode with deterministic quality control. From each cluster of similar procedural passages, SaP extracts a typed contract and filters it through a four-check deterministic verifier (coverage, binding, replacement, risk). Promoted contracts are inlined into a rewritten skill skeleton alongside restored action templates, giving the agent two complementary signals: a typed signature for what a skill does and a concrete template for how to invoke it. On the ALFWorld unseen split (134 games, gpt-4o-mini, three seeds), SaP wins 82/402 paired games versus 47/402 for the Graph-of-Skills (GoS) baseline (pooled McNemar p = 8.2 × 10⁻⁵), at −22.8 ± 6.4% input tokens and −14.5 ± 4.1% LLM calls per game. A bundle-component ablation attributes the gain to the pairing of typed contracts with concrete action templates: the contract alone falls below the prose baseline.
Anthology ID:
2026.findings-emnlp.889
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
18840–18860
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.889/
DOI:
Bibkey:
Cite (ACL):
Xinze Li, Yuhang Zang, Yixin Cao, and Aixin Sun. 2026. Skill-as-Pseudocode: Refactoring Skill Libraries to Pseudocode for LLM Agents. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 18840–18860, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Skill-as-Pseudocode: Refactoring Skill Libraries to Pseudocode for LLM Agents (Li et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.889.pdf