core-web-vitals

Measure and optimize Core Web Vitals (LCP, INP, CLS). Use when implementing CWV tracking or debugging performance.

⭐5stars🔀1forks📁View on GitHub🕐Updated Jan 11, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill empowers developers and SEO specialists to measure, monitor, and optimize Core Web Vitals (LCP, INP, and CLS) to enhance user experience and search engine rankings. It provides technical guidance on implementing performance tracking, identifying root causes of slow interactions, and applying best practices for visual stability and loading performance.

Use Cases

  • Scenario 1: Implementing a robust tracking system for Core Web Vitals to monitor real-world performance metrics across different site routes and user segments.
  • Scenario 2: Diagnosing and fixing Largest Contentful Paint (LCP) issues by identifying slow Time to First Byte (TTFB) or unoptimized hero images that delay page rendering.
  • Scenario 3: Optimizing Interaction to Next Paint (INP) by analyzing long-running JavaScript tasks and implementing debouncing or lazy loading for third-party scripts.
  • Scenario 4: Eliminating Cumulative Layout Shift (CLS) by auditing dynamic content injections and ensuring all media elements have predefined dimensions to prevent visual instability.
namecore-web-vitals
descriptionMeasure and optimize Core Web Vitals (LCP, INP, CLS). Use when implementing CWV tracking or debugging performance.
priority1

Core Web Vitals

Measure the three metrics Google uses to assess user experience.

The Three Metrics

Metric Measures Good Poor
LCP Loading - Largest Contentful Paint ≤2.5s >4.0s
INP Interactivity - Interaction to Next Paint ≤200ms >500ms
CLS Visual Stability - Cumulative Layout Shift ≤0.1 >0.25

Key Principles

  1. Always include attribution - Without it, you can't debug
  2. Track all three - INP replaced FID, don't skip it
  3. Track by route - Aggregate data hides problems
  4. Alert on poor vitals - Don't just log, enable alerts

Attribution = Actionable

Without With
"LCP is 3.2s" "LCP is 3.2s, caused by hero-image.jpg"
Can't fix Actionable

Common Causes

LCP

  • Large hero images → Optimize, preload
  • Slow TTFB → CDN, improve server
  • Render-blocking resources → Defer non-critical

INP

  • Long JS tasks → Break into chunks
  • Heavy event handlers → Debounce
  • Third-party scripts → Defer, lazy load

CLS

  • Images without dimensions → Set width/height
  • Dynamic content → Reserve space
  • Web fonts → font-display: optional

Implementation

See templates/web-vitals.ts for production-ready code.

Use Read tool to load template when generating implementation.

Anti-Patterns

See references/anti-patterns.md for:

  • CWV without attribution
  • Missing INP tracking
  • Blocking main thread with telemetry
  • skills/hydration-performance - SSR impact on LCP
  • skills/bundle-performance - JS impact on INP
  • references/core-web-vitals.md - Deep dive