frontend-perf-core-web-vitals-inp
Installation
SKILL.md
Frontend Perf : Core Web Vitals + INP
This skill is the operational reference for measuring and improving the 2026 Core Web Vitals (LCP, INP, CLS), with deep coverage of INP since it replaced FID as a Core Web Vital in March 2024. It covers the binding 75th-percentile thresholds, the three INP phases, the yielding ladder, LCP and CLS tactics, the LongAnimationFrame attribution surface, and the Speculation Rules API folded in per D-R10 because it is Chromium-only Limited Availability. The skill does NOT cover animation-specific performance (see [[frontend-perf-animation-gpu-containment]]), CSS containment for layout / paint / size isolation, or RUM tool integration (Datadog, Cloudflare, Vercel).
Quick Reference
Floor rules
- ALWAYS set
fetchpriority="high"on the LCP<img>AND give it explicitwidth/heightattributes. NEVER useloading="lazy"on the LCP image. - ALWAYS reserve space for late-loading content :
widthandheighton images and iframes,aspect-ratiofor fluid embeds,min-heightfor ad and embed slots. NEVER let a late asset push existing content downward. - ALWAYS break long synchronous work in event handlers with
await scheduler.yield()plus asetTimeout(_, 0)fallback. NEVER ship a single >50 ms synchronous task on the main thread on a critical interaction path. - ALWAYS apply the visual update FIRST in an event handler, then defer compute past the paint via
requestAnimationFrame(() => setTimeout(work, 0)). NEVER do heavy compute before the DOM update : the user sees a slow tap response. - ALWAYS feature-detect
scheduler.yield()and Speculation Rules. NEVER assume Baseline ; both are Limited Availability (Chromium-only) as of 2026-05-19. - ALWAYS use
font-display: swapwithsize-adjust/ascent-override/descent-overrideon a matched fallback. NEVER usefont-display: block(three-second invisible text period kills LCP). - ALWAYS exclude destructive URLs from Speculation Rules (
/logout,?add-to-cart=,[rel~=nofollow], sign-in flows, OTP submission, ad-conversion endpoints). NEVER ship a blanketwhere: { href_matches: "/*" }prerender rule without anotclause for side-effecting paths. - ALWAYS pair
content-visibility: autowithcontain-intrinsic-size: auto Npx. NEVER usecontent-visibility: autoalone ; off-screen children collapse to zero and the scrollbar jitters. - ALWAYS evaluate all three vitals at the 75th percentile of page loads, segmented mobile vs desktop. NEVER claim "passes Core Web Vitals" until that holds at p75.