core-web-vitals

Diagnose and optimize LCP, INP, and CLS metrics for web pages.

Updated Nov 29, 2025
One-click install
npx skills add https://github.com/achyutkneupane/Blog-Kit --skill core-web-vitals-achyutkneupane
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core-web-vitals
Source: https://github.com/achyutkneupane/Blog-Kit/tree/main/.ai/skills/core-web-vitals
Command: npx skills add https://github.com/achyutkneupane/Blog-Kit --skill core-web-vitals-achyutkneupane

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Web pages that fail Google's Core Web Vitals thresholds rank lower in search results and deliver poor user experiences, but diagnosing slow LCP, laggy INP, or layout shifts requires deep knowledge of browser rendering behavior. ## Core Features & Use Cases - LCP Optimization: Fix slow server responses, render-blocking resources, and unoptimized hero images using preload hints, fetchpriority, critical CSS inlining, and the Speculation Rules API. - INP Optimization: Break up long tasks with scheduler.yield(), prioritize visual feedback in event handlers, defer third-party scripts, and reduce re-renders in React and Vue. - CLS Optimization: Eliminate layout shifts by reserving space for images, ads, and embeds, matching web font metrics, and using transform-based animations. - Use Case: A developer notices their Next.js landing page scores poorly in Search Console. They use this Skill to identify the LCP element, preload the hero image with fetchpriority="high", inline critical CSS, and add speculation rules for instant navigations. ## Quick Start Analyze my page's Core Web Vitals and fix the LCP, INP, and CLS issues in my hero section and event handlers.

Frequently Asked Questions about core-web-vitals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve LCP on my website?

Improve LCP by reducing server response time below 800ms with a CDN, preloading the LCP image with fetchpriority="high", inlining critical CSS under 14KB, and ensuring the LCP element renders in the initial HTML rather than via client-side JavaScript.

How to fix INP issues caused by long JavaScript tasks?

Fix INP by breaking long tasks into chunks and yielding to the main thread with scheduler.yield(), providing immediate visual feedback in event handlers before heavy work, and deferring non-urgent work with requestIdleCallback.

What causes CLS and how do I prevent layout shifts?

CLS is caused by images without dimensions, ads and embeds without reserved space, dynamically injected content, and web font swaps. Prevent shifts by setting width and height or aspect-ratio on media, reserving min-height containers, and using font-display: optional.

Does the Speculation Rules API work in all browsers?

The Speculation Rules API for prerendering works only in Chromium-based browsers. Safari and Firefox ignore the script, so it functions as a progressive enhancement that never causes regressions in unsupported browsers.

How do I measure Core Web Vitals from real users?

Measure field data using the web-vitals library's onLCP, onINP, and onCLS callbacks sent to your analytics, or use the Chrome User Experience Report and Search Console's Core Web Vitals report for aggregated real-user data.