arXiv:2609.06052cs.SESep 2026

Manuscript Offprint

arXiv:2609.06052

SkillSpec: Intent-Masked Specification Reasoning for Agent Skill Correctness

Yizhuo Zhang, Bo Kang, Yi Yang, Zhiyu Duan, Zhouteng Ye, Shunkun Yang

Yizhuo Zhang, Bo Kang, Yi Yang, Zhiyu Duan, Zhouteng Ye and Shunkun Yang †^{\dagger}

Beihang University, Beijing 100191, China

Email: {yizhuo5755, kangbo05, yangyio, duanzhiyu, zhoutengye, ysk}@buaa.edu.cn

Abstract—Autonomous agent systems increasingly depend on reusable skill abstractions for consolidating experiential knowledge and domain expertise. These artifacts typically bundle free-form instructions with heterogeneous resources. However, ensuring their correctness remains challenging. Their failure modes transcend conventional code defects to subtle semantic inconsistencies such as intent conflicts, which manifest as silent failures masked by the underlying model. Moreover, skill correctness must be grounded in intended task boundaries and generalizability. We propose SKILLSPEC, a Hoare-style framework that formulates skill correctness as a specification reasoning problem. It transforms a heterogeneous skill repository into a unified graph representation that aligns descriptions, instructions and code artifacts. For each node, SKILLSPEC derives an EXPECTSPEC from the surrounding declared intent, and infers FACTSPECs from encoded behavior under partially disclosed intent. An intent mask regulates access to holistic, lineage, neighborhood, and local views to balance the bias introduced by excessive context against unsupported inference caused by insufficient context. SKILLSPEC jointly reasons over these views to flag candidate defects, and automatically validates them in an isolated sandbox. On 515 real-world skills from SkillsBench and widely downloaded repositories, SKILLSPEC identified 763 manually confirmed defects across 239 skills, achieving 61.2% precision. The node-level analysis across multiple model families shows that specification reasoning is consistently reliable for code nodes, whereas plain-text nodes remain a major bottleneck. Most defects arise at the boundaries between declared intent and implementation, demonstrating that explicit specifications provide a practical foundation for skill quality assurance in real-world agent ecosystems.

Index Terms—LLM Agents, Skill Correctness, Specification Reasoning, Program Analysis

I. INTRODUCTION

Large Language Models (LLMs) are shifting AI systems from passive dialogue interfaces to autonomous agents for long-horizon tasks [1], [2]. Within this emerging software stack, the LLM serves as the computational engine, the agent harness provides the runtime, and skills have become first-class software artifacts that enable reuse, distribution, and version control [3]. A skill typically bundles metadata, natural-language instructions, and resources such as scripts and data, thereby encapsulating domain knowledge or best practices as deployable workflows and capability libraries [4]. This ecosystem is expanding rapidly: more than 200,000 skills were released within six months [5].

However, research on agent skills remains at an early stage. Existing work has primarily focused on benchmarks [5], [6], capability enhancement [7], [8], and safety [9], [10], while skill defects remain underexplored [11], [12]. The behavior of traditional software is deterministically defined by code and checked through type systems, tests, and runtime failures [13], [14]. In contrast, agent skills rely on unstructured natural-language instructions, which admit semantic faults beyond conventional code defects, such as description drift and intent conflicts [15]. In practice, these issues manifest as silent failures, where the agent masks underlying faults by relying on the foundation model's intrinsic capabilities [6], [16], [17]. Moreover, a skill defect cannot be identified from observed failures alone, requiring assessment against the skill's generality and declared intent. This motivates the research question: How can we check the correctness of agent skills?

Our key insight is that the skill is an executable artifact with inherent specifications. A SKILL.md file is not merely free-form documentation, but operational guidance with resources [18]. Its correctness depends on an implicit consistency contract: the artifact must be aligned with the declared intent while satisfying its own correctness requirements. This perspective recasts skill validation as a specification consistency problem, for which recent work has extended classical Hoare-style reasoning from code to natural-language instructions and to verification in large-scale systems [19]–[22]. Agent skills fit this assumption naturally, the instructions declare what each step should achieve and thus define an expected specification, whereas the workflow structure and code resources record the encoded behavior and thus yield a factual specification. Correctness is therefore determined by the behavioral consistency between these specifications.

However, detecting such violations faces the following challenges:

C1) Heterogeneous Artifacts and Discrete Constraints. Correctness constraints are scattered across textual instructions, implementations in different programming languages or format. These heterogeneous representations and abstraction levels complicate systematic alignment and validation.

C2) Intent Disclosure Granularity. A specification inconsistency reflects the gap between declared intent and encoded behavior. Excessive intent disclosure biases factual extraction toward expected behavior while obscuring implementation evidence, whereas insufficient high-level context admits implausible interpretations of behavioral boundaries.

In this paper, we propose SKILLSPEC, a Hoare-style framework that, to the best of our knowledge, is the first to integrate

†^{\dagger}Corresponding author.

static defect detection with dynamic validation across workflow and code artifacts in agent skills. SkillSpec transforms an entire skill repository into a unified graph representation of its heterogeneous artifacts (C1): it maps the semi-structured descriptions in SKILL.md to workflow graph, and parses the scripts into a language-agnostic intermediate representation (IR) derived from concrete syntax trees. Bidirectional node bindings align declared intent with encoded behavior. SkillSpec then derives specifications for each graph node: EXPECT-SPEC captures the behavior expected by complete declared intent, and FACTSPEC, which is inferred from implementation artifacts under deliberately masked intent. To regulate the granularity (C2), SkillSpec introduces an intent mask that composes four visibility layers: holistic, lineage, neighbors and self. It reasons over ExpectSpec and the multi-view FactSpecs to identify candidate defects. Finally, SkillSpec validates each candidate in a realistic environment within an isolated sandbox by reusing a warm container while assigning each run a fresh workspace and agent context. The validator executes minimal probes for code-level claims and constructs scenarios for workflow-level corroboration, retaining records the runtime evidence, trajectory for each validated candidate.

We evaluate SKILLSPEC on 515 real-world skill repositories collected from SkillsBench [5] and SkillsTop, a collection of the most downloaded skills on skills.sh [23]. SKILLSPEC identifies 239 skills (46.4%) containing 763 confirmed defects through manual review, and achieves a defect precision of 61.2% under validation in sandbox. SKILLSPEC remains effective across multiple model families, while our case studies and cost analysis further demonstrate its practical applicability. Overall, our results show that correctness issues are prevalent in real-world skills and that Hoare-style specification reasoning enables effective automated quality assurance for agent artifacts.

In summary, the paper makes the following contributions:

  • We formulate agent skill correctness as a specification consistency problem and adapt Hoare-style reasoning to this emerging class of software artifacts.

  • We propose a unified graph representation for heterogeneous skill repositories, with bidirectional bindings between declared intent and implementation.

  • We introduce an intent mask that enables multi-view reasoning by providing fine-grained visibility of declared intent during specification extraction.

  • We evaluate its effectiveness on real-world skills and publicly release the skill defect dataset and source code at: https://github.com/IainZhang/SkillSpec and https://huggingface.co/datasets/IainZhang/SkillSpec.

References (61)