core-web-vitals

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

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/trobias/portfolio-nextjs-v2 --skill core-web-vitals-trobias
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: core-web-vitals
Source: https://github.com/trobias/portfolio-nextjs-v2/tree/main/.agents/skills/core-web-vitals
Command: npx skills add https://github.com/trobias/portfolio-nextjs-v2 --skill core-web-vitals-trobias

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires web-vitals, and 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 experience, but identifying and fixing LCP, INP, and CLS issues requires deep knowledge of rendering, networking, and JavaScript execution. ## Core Features & Use Cases - LCP Optimization: Diagnose slow server responses, render-blocking resources, and unoptimized hero images, with fixes like preloading, fetchpriority, and critical CSS inlining. - INP Optimization: Break up long tasks, defer heavy event handler work, and reduce main-thread blocking to keep interactions under 200ms. - CLS Optimization: Eliminate layout shifts by reserving space for images, embeds, and ads, and by using transform-based animations and font metric overrides. - Use Case: A Next.js site has a 4.5s LCP and failing Search Console report. Use this Skill to identify the LCP element, preload the hero image with fetchpriority="high", inline critical CSS, and verify the fix with the web-vitals library. ## Quick Start Analyze my page's Core Web Vitals and fix the LCP and CLS issues in my Next.js hero section.

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 CDN or edge caching, 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 reduce INP and fix slow interactions?▼

Reduce INP by breaking long tasks into chunks that yield to the main thread, providing immediate visual feedback in event handlers, deferring non-critical work with requestIdleCallback, and lazy-loading heavy third-party scripts on interaction.

What causes CLS layout shifts and how do I fix them?▼

CLS is caused by images without dimensions, ads or embeds without reserved space, dynamically injected content above the viewport, and web fonts with mismatched metrics. Fix it by setting width/height or aspect-ratio, reserving min-height containers, and using font-display: optional or size-adjust overrides.

Does this work with Next.js and React frameworks?▼

Yes, the Skill includes framework-specific guidance. For Next.js it covers next/image with priority for LCP and dynamic imports for INP; for React it covers useTransition and memoization; Vue, Nuxt, and Astro patterns are also documented.

How do I measure Core Web Vitals from real users?▼

Use the web-vitals JavaScript library to capture onLCP, onINP, and onCLS callbacks and send them to your analytics. Field data is also available through the Chrome User Experience Report and Search Console's Core Web Vitals report.