SkillBridge: Cost-Aware Diagnosis and Repair of Cross-OS Compatibility Defects in Agent Skills
Organizations: Key Lab of High Confidence Software Technologies (Peking University), Ministry of Education, China · School of Computer Science, Peking University, Beijing, China · Zhongguancun Academy, Beijing, China · School of Computer Science, Northwestern Polytechnical University, Xi’an, China
Abstract
LLM agents increasingly reuse executable capabilities through skills, but a skill that works on one OS may fail on another because OS assumptions are spread across guide text, scripts, metadata, install contracts, and local entrypoints. Diagnosing such failures by running every skill on every OS is expensive: many executions spend model tokens, runner time, and review effort before revealing whether the failure is truly OS-related. We present SkillBridge, a contract-based workflow with three stages: static analysis, dynamic validation, and repair. SkillBridge first screens 3,270 skill-target-OS cases, covering 1,090 skills across Linux, macOS, and Windows, to find OS-sensitive contract evidence. It then runs dynamic tasks and root-cause review on selected cases to confirm whether a failure is caused by an OS assumption, and repairs the contract field that caused the failure, such as guide text, package scripts, dependencies, or platform declarations. Repair raises the reviewer-judged target-task pass rate from 30.6% to 38.4%, a gain of 7.8 percentage points. A retrospective Linux/macOS budget analysis further shows the efficiency effect: SkillBridge reaches 38 confirmed OS issues with 185 dynamic validations, where uniform random selection would require about 865 validations in expectation.
Figures & tables
| Contract field | Target-OS rule groups | Typical evidence | Repair target |
|---|---|---|---|
| guide | Shell, utility, install, and native-app command rules. | ./run.sh , date -d , apt / brew , osascript . | Guarded guide alternatives or portable commands. |
| package | Missing entrypoint, single-OS wrapper, executable-bit, and native-binary rules. | Absent referenced file, *.sh -only or *.ps1 -only surface, ELF/Mach-O/PE binary. | Portable wrapper, missing file, or target-OS entrypoint. |
| metadata | Support-declaration and declared-runtime consistency rules. | Advertised OS support, required binary/runtime, version or platform metadata. | Correct support metadata or add the missing contract. |
| dependency | Package-manager, OS-specific CLI, and desktop/session dependency rules. | apt / brew / winget , xclip / pbcopy , browser or accessibility requirement. | Per-OS install recipe, dependency probe, adapter, or headless fallback. |
| assumption | Native API, filesystem namespace, path, permission, and GUI-assumption rules. | /proc , AppleScript [ 9 ] , COM [ 10 ] , /tmp , chmod . | Adapter, runtime path API, guard, or unsupported declaration. |
| Cross-field | Contract-contradiction and fallback-recognition rules. | Broad support claim with single-OS evidence; existing platform.system() guard. | Repair the authoritative field or suppress guarded evidence. |
| Target OS | OS-related cases | Prec. | Rec. | F1 |
|---|---|---|---|---|
| Linux | 42 | 0.276 | 0.640 | 0.386 |
| macOS | 25 | 0.173 | 0.688 | 0.277 |
| Windows | 108 | 0.242 | 0.719 | 0.362 |
| Overall | 175 | 0.218 | 0.685 | 0.331 |
| Root cause | Count | OS split | What review observed |
|---|---|---|---|
| Command/path/shell assumptions | 86 (42.0%) | 11/18/57 | POSIX shell [ 11 ] on native Windows, BSD/GNU flag mismatches [ 18 , 19 ] , hard-coded paths, missing portable wrappers, or Windows path, encoding, locale, and path-length conventions [ 13 , 14 ] . |
| Native app/API assumptions | 65 (31.7%) | 31/11/23 | AppleScript [ 9 ] , COM [ 10 ] , X11, browser automation, desktop control, or platform-intrinsic apps. |
| Dependency/install contracts | 31 (15.1%) | 16/6/9 | Install steps or required tools exist for one package manager, local CLI, runtime, desktop app, or host service but not the target OS. |
| Support metadata mismatch | 16 (7.8%) | 0/0/16 | Metadata or guide text advertises support that the package surface or dependency contract does not implement. |
| Permission/session model | 7 (3.4%) | 3/3/1 | GUI display, accessibility, TTY, account state, or desktop session is required but not declared or guarded. |
| OS | Method | Pass rate ( ) | |
|---|---|---|---|
| Linux | Direct Agent | 46.8% (+2.0) | 13/18/11 |
| Linux | SkillBridge Workflow | 48.4% (+3.6) | 14/20/8 |
| macOS | Direct Agent | 42.2% (+9.3) | 8/16/1 |
| macOS | SkillBridge Workflow | 42.9% (+9.9) | 5/19/1 |
| Windows | Direct Agent | 33.7% (+7.7) | 28/61/19 |
| Windows | SkillBridge Workflow | 34.7% (+8.7) | 25/72/11 |
| Policy | Runs | OS issues | Recall | NC tok. | Cache tok. | Cost | Agent h |
|---|---|---|---|---|---|---|---|
| Full dynamic | 1,298 | 57.0 | 1.000 | 391.1M | 3.95B | $77.6 | 170.7 |
| To find 38 OS issues | |||||||
| Random w/o static | 865 | 38.0 | 0.667 | 260.7M | 2.63B | $51.7 | 113.8 |
| SkillBridge | 185 | 38.0 | 0.667 | 55.7M | 562.9M | $11.1 | 24.3 |
Software Engineering
Software engineering studies how to design, build, test, deploy, and maintain reliable software systems and the processes behind them.
See all 299 papers