Skill-as-Pseudocode: Refactoring Skill Libraries to Pseudocode for LLM Agents
cs.PL, cs.CL
Submitted: 2026-05-27
Updated: 2026-08-31
Comments: EMNLP Findings 2026
Code: https://github.com/InternLM/Skill-as-Pseudocode
License: http://creativecommons.org/licenses/by/4.0/
The gist: 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.
Terminology
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 to re-retrieve to 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 times 10-5), at-22.8 plus or minus 6.4 % input tokens and-14.5 plus or minus 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.
Sources
- SkillRet: A Large-Scale Benchmark for Skill Retrieval in LLM Agents
- MRKL Systems: A modular, neuro-symbolic architecture that combines large language models, external knowledge sources and discrete reasoning
- SkillsBench: Benchmarking How Well Agent Skills Work Across Diverse Tasks
- Graph-of-Skills: Dependency-Aware Structural Retrieval for Massive Agent Skills
- Prompt Injection attack against LLM-integrated Applications
- Refactoring Programs Using Large Language Models with Few-Shot Examples
- SkillOps: Managing LLM Agent Skill Libraries as Self-Maintaining Software Ecosystems
- SkillWeaver: Web Agents can Self-Improve by Discovering and Honing Skills
- RestGPT: Connecting Large Language Models with Real-World RESTful APIs
- Solving math word problems with process- and outcome-based feedback
- GraSP: Graph-Structured Skill Compositions for LLM Agents
Related papers
- Language-Based Agent Control
- ANEForge: Python for direct computation on the Apple Neural Engine
- Volition Elicitation: Operational Semantics for People and Their Machines
- Griotte: Verified Compartmentalisation via Capabilities
- GraphMend: Code Transformations for Fixing Graph Breaks in PyTorch 2
- Two Birds One Stone: Effective Static Detection of Resource and Communication Deadlocks in Rust Programs