You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: apply skill-creator review feedback to webperf-core-web-vitals
Scripts:
- fix(LCP-Video-Candidate): apply activationStart correction to LCP value
(bfcache navigations returned inflated values without this)
- fix(LCP): use getComputedStyle for background image detection
(inline style check missed CSS-driven backgrounds)
- fix(CLS): add message field to synchronous return so agent knows to call getCLS()
- fix(INP): remove misleading rating:"good" from no-interactions error case;
preserve getDataFn so agent can retry after user interacts
- feat(LCP, LCP-Sub-Parts, LCP-Trail): add window.__cwvHighlight flag
to allow disabling visual element outlines without changing scripts
Documentation:
- docs(schema): document getINPDetails() with return schema and example
- docs(schema): add INP error case (no interactions) to schema examples
- docs(SKILL): add Error Recovery section with per-script guidance
- docs(SKILL): add cross-skill fork note — cross-skill triggers are
recommendations to report, not direct calls from the forked subagent
- docs(SKILL): add Visual Highlighting section documenting __cwvHighlight
- docs(SKILL): prefix cross-skill script references with skill name
- docs(SKILL): document getINPDetails() step in INP debugging workflow
Copy file name to clipboardExpand all lines: skills/webperf-core-web-vitals/SKILL.md
+30-5Lines changed: 30 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,8 @@ INP requires real user interactions to measure. The workflow is:
36
36
2.**Tell the user:** "INP tracking is now active. Please interact with the page — click buttons, open menus, fill form fields — then let me know when you're done."
37
37
3. Wait for the user to confirm they've interacted.
38
38
4. Call `evaluate_script("getINP()")` to collect results.
39
+
5. If `getINP()` returns `status: "error"` → the user has not interacted yet. Remind them and wait.
40
+
6. For a full breakdown of all interactions, call `evaluate_script("getINPDetails()")` — returns all recorded interactions sorted by duration.
39
41
40
42
> The agent cannot interact with the page on behalf of the user for INP measurement. Real user interactions are required.
41
43
@@ -66,7 +68,7 @@ When LCP is slow or the user asks "debug LCP" or "why is LCP slow":
66
68
When layout shifts are detected or the user asks "debug CLS" or "layout shift issues":
67
69
68
70
1.**CLS.js** - Measure overall CLS score
69
-
2.**Layout-Shift-Loading-and-Interaction.js** (from Interaction skill) - Separate loading vs interaction shifts
71
+
2.**Layout-Shift-Loading-and-Interaction.js** (from `webperf-interaction` skill) - Separate loading vs interaction shifts
70
72
3. Cross-reference with **webperf-loading** skill:
@@ -212,3 +215,25 @@ These triggers recommend using snippets from other skills:
212
215
213
216
-**If render delay or interaction delay is high** → Use **webperf-interaction** skill:
214
217
- Long-Animation-Frames.js (main thread blocking)
218
+
219
+
> **Note on cross-skill references:** This skill runs in an isolated subagent (`context: fork`). When a decision tree recommends scripts from another skill (e.g., `webperf-loading`, `webperf-interaction`, `webperf-media`), report the recommendation to the user as a next step — do not attempt to execute those scripts directly. The user or the main agent can activate the appropriate skill to continue the investigation.
220
+
221
+
## Error Recovery
222
+
223
+
When a script returns `status: "error"`:
224
+
225
+
-**LCP/CLS/LCP-Sub-Parts/LCP-Trail** → The page may not have finished loading. Ask the user to wait for full load or reload, then re-run the script.
226
+
-**INP** (`getINP()` returns error) → No interactions have been recorded yet. Remind the user to interact with the page, then call `getINP()` again.
227
+
-**LCP-Image-Entropy** → No images with measurable BPP found. This is normal for text-only pages or pages where all images are data URIs.
228
+
-**LCP-Video-Candidate** → No LCP entries found; see LCP error recovery above.
229
+
230
+
## Visual Highlighting
231
+
232
+
By default, scripts highlight the LCP element(s) with colored dashed outlines — useful when the user is watching the browser while the agent runs. To disable:
233
+
234
+
```js
235
+
window.__cwvHighlight=false;
236
+
// then run any LCP script
237
+
```
238
+
239
+
Scripts that support this flag: `LCP.js`, `LCP-Sub-Parts.js`, `LCP-Trail.js`.
{ "script": "INP", "status": "error", "error": "No interactions recorded yet. Interact with the page and call getINP() again.", "getDataFn": "getINP" }
105
+
```
106
+
`getINPDetails()` returns all recorded interactions sorted by duration (useful for INP deep-dive):
0 commit comments