ContractSkill: Repairable Contract-Based Skills for Multimodal Web Agents
Authors: Zijian Lu, Yiping Zuo, Yupeng Nie, Xin He, Weibei Fan, Lianyong Qi, Shi Jin
Organizations: Nanjing University of Posts and Telecommunications, Nanjing, China · China University of Petroleum (East China), Qingdao, China · Southeast University, Nanjing, China
Self-generated skills for web agents are often unstable and can even hurt performance relative to direct acting. We argue that the key bottleneck is not only skill generation quality, but the fact that web skills remain implicit and therefore cannot be checked or locally repaired. To address this, we present ContractSkill, a framework that converts a draft skill into an executable artifact with explicit procedural structure, enabling deterministic verifica tion, fault localization, and minimal local repair. This turns skill refinement from full rewriting into localized editing of a single skill artifact. Experiments on VisualWebArena show that Contract Skill is effective in realistic web environments, while MiniWoB provides a controlled test of the mechanism behind the gain. Under matched transfer layers, repaired artifacts also remain reusable after removing the source model from the loop, providing evi dence of portability within the same benchmark family rather than full-benchmark generalization. These results suggest that the central challenge is not merely generating skills, but mak ing them explicit, executable, and repairable. Code is available at https://github.com/underfitting-lu/contractskill.git.
Figures & tables
Figure 1. Overview of ContractSkill. The pipeline proceeds through five stages. It starts with input and draft generation, then compiles the draft into a contracted artifact, performs verification-guided execution with deterministic fault localization, applies minimal patch repair under an explicit objective, and finally reuses the repaired artifact with both the source model and a target model. A five-stage pipeline for ContractSkill showing input and draft generation, skill compilation into a contracted artifact, verification-guided execution with deterministic fault localization, minimal patch repair, and downstream reuse by source and target models.
Error code
Meaning
NOT_FOUND
The specified selector does not match a valid page element.
WRONG_STATE
The current page state violates a step precondition.
ASSERT_FAIL
The action completes, but the expected postcondition is not satisfied.
LOOP_TIMEOUT
The agent repeats unproductive actions or exceeds the step budget.
INPUT_INVALID
The action arguments do not satisfy page-side constraints.
Table 1. Structured error codes used by the deterministic verifier.
Operator
Typical use
Selector replacement
Replace or expand a brittle selector after NOT_FOUND .
Precondition insertion
Add a missing state assumption after WRONG_STATE .
Postcondition insertion
Add missing evidence of completion after ASSERT_FAIL .
Recovery insertion
Add a fallback action such as close-popup or reload.
Argument correction
Fix input values or action arguments after INPUT_INVALID .
Table 2. Minimal patch operators in ContractSkill.
Figure 2. Representative repair case on VisualWebArena. The verifier localizes the failure to the post-exploration stage, and ContractSkill repairs the artifact by inserting only the missing continuation steps rather than rewriting the whole strategy. A qualitative case study showing task failure, verifier localization, minimal patch insertion, and successful patched execution on a VisualWebArena task.
GLM-VWA
Method
Succ. (%)
Steps
Tokens (k)
No-Skill
12.5
12.59
52.7
Self-Generated Skill
9.4
1.95
5.6
ContractSkill
28.1
3.62
46.45
Qwen-VWA
Method
Succ. (%)
Steps
Tokens (k)
Table 3. Main results on VisualWebArena main_100.
GLM-MiniWoB
Method
Succ. (%)
Steps
Tokens (k)
No-Skill
61.5
4.11
4.44
Self-Generated Skill
66.5
1.84
4.6
ContractSkill
77.5
1.93
5.16
Qwen-MiniWoB
Method
Succ. (%)
Steps
Tokens (k)
Table 4. Main results on MiniWoB main_20 with 10 instances per task.
Setting
Transfer Succ. (%)
Target Skill (%)
Delta
Transfer Steps
Baseline Steps
VWA (aggregate)
80.4
32.6
+47.8
2.83
1.46
VWA Q → G
79.2
29.2
+50.0
3.21
1.46
VWA G → Q
81.8
36.4
+45.5
2.41
1.45
MiniWoB (aggregate)
96.2
83.5
+12.8
1.80
1.66
MiniWoB Q → G
100.0
87.5
+12.5
1.84
1.68
MiniWoB G → Q
92.3
79.2
+13.1
1.77
1.63
Table 5. Portability under matched transfer layers compared against the target model’s own self-generated skill baseline. Aggregate rows merge Layer 1 and Layer 2 within each benchmark.
GLM-MiniWoB
Qwen-MiniWoB
Variant
Success (%)
Avg. Steps
Avg. Tokens (k)
Success (%)
Avg. Steps
Avg. Tokens (k)
Full ContractSkill
77.5
1.93
5.16
81.0
2.00
7.9
Unconstrained Repair
68.5
1.92
6.6
70.5
2.00
11.3
No Failure Localization
65.0
1.75
4.9
70.0
1.95
7.4
Text-Only Rewrite
62.0
1.71
2.7
60.5
1.70
5.3
Table 6. MiniWoB ablation results for fault localization and repair constraints.
Figure 3. Template-level MiniWoB pass rates across the main baselines and ablations. ContractSkill gains concentrate on a small subset of repairable templates. A heatmap of MiniWoB template-level pass rates for no-skill, skill-no-repair, text-only rewrite, ContractSkill, ContractSkill without failure localization, and ContractSkill with unconstrained repair. Most easy templates are saturated, while the largest gains of ContractSkill appear on a smaller set of harder templates.
Figure 4. VWA failure analysis across Qwen3.5-Plus and GLM-4.6V. Across both models, ContractSkill reduces the dominance of late coarse failures that are common in No-Skill execution and exposes a larger share of residual failures as earlier, more localizable breakdowns. Two stacked horizontal bar charts for VisualWebArena arranged vertically. The top chart shows failure-code distributions for no-skill, self-generated skill, and ContractSkill under Qwen3.5-Plus and GLM-4.6V. The bottom chart shows the corresponding first-failing-step distributions. ContractSkill shifts failures away from late coarse outcomes and toward more localized failure categories.