SkillSpec: Intent-Masked Specification Reasoning for Agent Skill Correctness
Beihang University, Beijing, China
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.
- Skills analyzed
- 515
- Confirmed defects
- 763
- Skills with defects
- 239/ 515
- Reports confirmed
- 61.2%
Overview
SkillSpec aligns instructions and code in a unified graph, compares expected and factual specifications under complementary intent views, and validates candidate defects in an isolated sandbox.
Multi-View Intent Masking
Workflow target · FactSpec · Self view
Target step + its reachable code.
Dashed arrows show containment; solid arrows show workflow dependencies or code calls. The cross-graph arrow marks invocation.
Semantics in Skills
Dataset
Our evaluation corpus contains 515 real-world skill repositories from two sources. SkillsBench provides manually curated skills for diverse agent tasks. SkillsTop contains widely downloaded skills from skills.sh, selected as the top 160 repositories in each of the text and script subsets by cumulative downloads.
| Dataset | Type | Skills | Files | Skill lines | Code lines | Other lines |
|---|---|---|---|---|---|---|
| SkillsTop | Text | 160 | 1,032 | 26,533 | — | 96,169 |
| Script | 160 | 2,873 | 39,624 | 172,402 | 453,030 | |
| SkillsBench | Text | 152 | 280 | 28,518 | — | 25,318 |
| Script | 43 | 303 | 8,330 | 26,002 | 61,339 | |
| Total | 515 | 4,488 | 103,005 | 198,404 | 635,856 | |
Text and Script denote repositories without and with standalone scripts, respectively. Skill, Code, and Other lines count lines in SKILL.md, code files, and other resources. A dash indicates that code lines are not applicable. Repositories were deduplicated and frozen at the revisions available on July 14, 2026.
Citation
@misc{zhang2026skillspec,
title = {SkillSpec: Intent-Masked Specification Reasoning for Agent Skill Correctness},
author = {Yizhuo Zhang and Bo Kang and Yi Yang and Zhiyu Duan and Zhouteng Ye and Shunkun Yang},
year = {2026},
note = {Manuscript},
url = {https://github.com/IainZhang/SkillSpec}
}