HEXIS: Compiling Agent Skills into Extended Finite State Machines
cs.AI
Submitted: 2026-09-24
Updated: 2026-09-26
Code: https://github.com/anomalyco/opencode
License: http://creativecommons.org/licenses/by/4.0/
The gist: Agent skills provide instructions and reusable knowledge, yet agents have to frequently infer which action to take next.
Terminology
Abstract
Agent skills provide instructions and reusable knowledge, yet agents have to frequently infer which action to take next. This skill's execution paradigm combines task reasoning with control decisions, which could cause the agent to act improperly or omit necessary steps. To improve agent compliance for skills, we introduce HEXIS, which compiles agent skills into extended finite state machines (FSM) that separate knowledge from control flow. Skill knowledge is incorporated into local instructions that guide reasoning and generation within states. The machine records execution progress and intermediate results, while explicit transition conditions determine subsequent operations. Our incremental compiler first maps skill clauses and tool interfaces to state operations, local instructions, data bindings, and transitions. It then aligns development traces with existing states to identify missing operations and dependencies. These are incorporated by adding or reusing states and refining their connections. Updates are accepted only after static checks and replay of the current and all previously accepted traces. Across four benchmarks and four executors, HEXIS improves success over Skill + ReAct by 16.2 percentage points on average. Qwen3.8-27B reduces execution tokens by 38.4-88.9% across benchmarks.
Sources
- Agent Skills Matter: Inferring Proprietary Skills from Execution Trajectories
- LiveMathematicianBench: A Live Benchmark for Research-Level Mathematical Reasoning with Proof Sketches
- SkillsBench: Benchmarking How Well Agent Skills Work Across Diverse Tasks
- SOPBench: Evaluating Language Agents at Following Standard Operating Procedures and Constraints
- StateFlow: Enhancing LLM Task-Solving through State-Driven Workflows
- TraceCompiler: Skill-Guided Mining and Compilation of LLM Agent Traces into Mostly Deterministic Workflows
- SkillOpt: Executive Strategy for Self-Evolving Agent Skills
- Compile, Then Page: Executable SOP Programs and a Capability-Gated Runtime for Procedural LLM Agents
- Formal Skill: Programmable Runtime Skills for Efficient and Accurate LLM Agents
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems