Intelligent Core Web Vitals analysis with automated workflows and decision trees. Measures LCP, CLS, INP with guided debugging that automatically determines follow-up analysis based on results. Includes workflows for LCP deep dive (5 phases), CLS investigation (loading vs interaction), INP debugging (latency breakdown + attribution), and cross-skill integration with loading, interaction, and media skills. Use when the user asks about Core Web Vitals, LCP optimization, layout shifts, or interaction responsiveness. Compatible with Chrome DevTools MCP.
3.2k tokens
context cost
SKILL.md, read when the skill is used
10
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
1 454
stars on the repo
on the repository, not the skill itself
Install
one command, takes just this skill from the repository
JavaScript snippets for measuring web performance in Chrome DevTools.
Running a script
Run the script with mcp__chrome-devtools__evaluate_script and read the object it returns. The scripts have no console output, so the returned object is the result: script, status and the metric data (value, rating, details, items, issues), as described in references/schema.md.
When status is "tracking", the script keeps observing the page. After the interactions, call the function named in getDataFn with another mcp__chrome-devtools__evaluate_script call, for example getINP(), and read the object it returns.
When status is "error" or "unsupported", read error: the page may not have loaded yet, or the browser lacks the API.
Without Chrome DevTools MCP, run the same snippet with the webperf-snippets CLI, which loads the page in headless Chromium and prints the same result objects: npx webperf-snippets <url> --snippet <Name> --json, where <Name> is the script name without .js. It needs Playwright and Chromium (npm install --save-dev webperf-snippets playwright, then npx playwright install chromium), and tracking snippets take --interact-script <file> to drive the interactions.
Scripts
scripts/CLS.js — Cumulative layout shift (CLS)
scripts/INP.js — Interaction to next paint (INP)
scripts/LCP-Image-Entropy.js — LCP image entropy
scripts/LCP-Subparts.js — LCP subparts
scripts/LCP-Trail.js — LCP trail
scripts/LCP-Video-Candidate.js — LCP video candidate
scripts/LCP.js — Largest contentful paint (LCP)
Common Workflows
Complete Core Web Vitals Audit
When the user asks for a comprehensive Core Web Vitals analysis or "audit CWV":
LCP.js - Measure Largest Contentful Paint
CLS.js - Measure Cumulative Layout Shift
INP.js - Measure Interaction to Next Paint
LCP-Subparts.js - Break down LCP timing phases
LCP-Trail.js - Track LCP candidate evolution
LCP Deep Dive
When LCP is slow or the user asks "debug LCP" or "why is LCP slow":
LCP.js - Establish baseline LCP value
LCP-Subparts.js - Break down into TTFB, resource load, render delay
LCP-Trail.js - Identify all LCP candidates and changes
LCP-Image-Entropy.js - Check if LCP image has visual complexity issues
LCP-Video-Candidate.js - Detect if LCP is a video (poster or video element)
CLS Investigation
When layout shifts are detected or the user asks "debug CLS" or "layout shift issues":
CLS.js - Measure overall CLS score
Layout-Shift-Loading-and-Interaction.js _(pending — available in webperf-interaction skill)_
If specific interaction type is slow (e.g., keyboard) → Focus analysis on that interaction type
After INP data is collected → call getINPDetails() for the 15 slowest interactions, slowest first (useful for identifying patterns across multiple slow interactions)
Error Recovery
If any script returns status: "error" → Check if the page has finished loading:
If early in load: wait and re-run the script
If page is an SPA: user may need to navigate to the target route first
If LCP.js / LCP-Subparts.js returns status: "error" → Tell the user: "LCP data is not available yet. Please ensure the page has fully loaded, then run the analysis again."
If INP.js getINP() returns status: "error" → The getDataFn: "getINP" field signals the agent can retry after user interaction. Prompt the user to click, type, or scroll, then call getINP() again.
Cross-Skill Triggers
> Context fork note: This skill runs with context: fork. Cross-skill triggers below are recommendations to report back to the parent agent, not direct calls this subagent can execute. When a cross-skill trigger fires, tell the user which skill and script to run next. Scripts marked _(pending)_ are not yet available — skip them and note the limitation.
These triggers recommend using snippets from other skills:
From LCP to Loading Skill
If LCP > 2.5s and TTFB phase is dominant → Use webperf-loading skill: