skills/webperf-core-web-vitals/SKILL.md
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.
npx skillsauth add nucliweb/webperf-snippets webperf-core-web-vitalsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
JavaScript snippets for measuring web performance in Chrome DevTools. Execute with mcp__chrome-devtools__evaluate_script, capture output with mcp__chrome-devtools__get_console_message.
scripts/CLS.js — Cumulative Layout Shift (CLS)scripts/INP.js — Interaction to Next Paint (INP)scripts/LCP-Image-Entropy.js — LCP Image Entropyscripts/LCP-Subparts.js — LCP Subpartsscripts/LCP-Trail.js — LCP Trailscripts/LCP-Video-Candidate.js — LCP Video Candidatescripts/LCP.js — Largest Contentful Paint (LCP)When the user asks for a comprehensive Core Web Vitals analysis or "audit CWV":
When LCP is slow or the user asks "debug LCP" or "why is LCP slow":
When layout shifts are detected or the user asks "debug CLS" or "layout shift issues":
When interactions feel slow or the user asks "debug INP" or "slow interactions":
getINP() after interactions, getINPDetails() for full listWhen LCP is a video element (detected by LCP-Video-Candidate.js):
When LCP is an image (most common case):
Use this decision tree to automatically run follow-up snippets based on results:
getINPDetails() for the full sorted interaction list (useful for identifying patterns across multiple slow interactions)status: "error" → Check if the page has finished loading:
status: "error" → Tell the user: "LCP data is not available yet. Please ensure the page has fully loaded, then run the analysis again."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.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:
If LCP > 2.5s and TTFB phase is dominant → Use webperf-loading skill:
If LCP image is lazy-loaded → Use webperf-loading skill:
If LCP has no fetchpriority → Use webperf-loading skill:
If CLS caused by fonts → Use webperf-loading skill:
If CLS caused by images → Use webperf-media skill:
When multiple CWV metrics are poor, prioritize investigation:
If LCP > 2.5s AND CLS > 0.1 → Likely shared root cause:
If LCP > 2.5s AND INP > 200ms → Main thread congestion:
If CLS > 0.1 AND INP > 200ms → Layout thrashing or interaction-triggered shifts:
references/snippets.md — Descriptions and thresholds for each scriptreferences/schema.md — Return value schema for interpreting script outputtools
Web performance measurement and debugging toolkit. Use when the user asks about web performance, wants to audit a page, or says "analyze performance", "debug lcp", "check ttfb", "measure core web vitals", "audit images", or similar.
tools
Intelligent network quality analysis with adaptive loading strategies. Detects connection type (2g/3g/4g), bandwidth, RTT, and save-data mode, then automatically triggers appropriate optimization workflows. Includes decision trees that recommend image compression for slow connections, critical CSS inlining for high RTT, and save-data optimizations (disable autoplay, reduce quality). Features connection-aware performance budgets (500KB for 2g, 1.5MB for 3g, 3MB for 4g+) and adaptive loading implementation guides. Cross-skill integration with Loading (TTFB impact), Media (responsive images), and Core Web Vitals (connection impact on LCP/INP). Use when the user asks about slow connections, mobile optimization, save-data support, or adaptive loading strategies. Compatible with Chrome DevTools MCP.
tools
Intelligent media optimization with automated workflows for images, videos, and SVGs. Includes decision trees that detect LCP images (triggers format/lazy-loading/priority analysis), identify layout shift risks (missing dimensions), and flag lazy loading issues (above-fold lazy or below-fold eager). Features workflows for complete media audit, LCP image investigation, video performance (poster optimization), and SVG embedded bitmap detection. Cross-skill integration with Core Web Vitals (LCP/CLS impact) and Loading (priority hints, resource preloading). Provides performance budgets and format recommendations based on content type. Use when the user asks about image optimization, LCP is an image/video, layout shifts from media, or media loading strategy. Compatible with Chrome DevTools MCP.
tools
Intelligent loading performance analysis with automated workflows for TTFB investigation (DNS/connection/server breakdown), render-blocking detection, script performance deep dive (first vs third-party attribution), font optimization, and resource hints validation. Includes decision trees that automatically analyze TTFB sub-parts when slow, detect script loading anti-patterns (async/defer/preload conflicts), identify render-blocking resources, and validate resource hints usage. Features workflows for complete loading audit (6 phases), backend performance investigation, and priority optimization. Cross-skill integration with Core Web Vitals (LCP resource loading), Interaction (script execution blocking), and Media (lazy loading strategy). Use when the user asks about TTFB, FCP, render-blocking, slow loading, font performance, script optimization, or resource hints. Compatible with Chrome DevTools MCP.