shennawardana23/skillme/core-web-vitals

Claude Code and agent skill by shennawardana23/skillme

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Optimize Core Web Vitals (LCP, INP, CLS) for better page experience and search ranking. Use when asked to "improve Core Web Vitals", "fix LCP", "reduce CLS", "optimize INP", "page experience optimization", or "fix layout shifts".

Install

npx vskill@latest install shennawardana23/skillme/core-web-vitals

SKILL.md

The same SKILL.md was published earlier as shennawardana23/skillme/core-web-vitals.

Core Web Vitals optimization

Targeted optimization for the three Core Web Vitals metrics that affect Google Search ranking and user experience.

The three metrics

MetricMeasuresGoodNeeds workPoor
LCPLoading≤ 2.5s2.5s – 4s> 4s
INPInteractivity≤ 200ms200ms – 500ms> 500ms
CLSVisual Stability≤ 0.10.1 – 0.25> 0.25

Google measures at the 75th percentile — 75% of page visits must meet "Good" thresholds.


LCP: Largest Contentful Paint

LCP measures when the largest visible content element renders — usually a hero image, video poster, large background image, <svg> element, or large text block.

In rough order of impact, the common causes are: slow server response (TTFB > 800ms), the LCP image not preloaded with fetchpriority="high", render-blocking CSS/JS in <head>, and client-side-rendered content that isn't present in the initial HTML (fix with SSR/SSG/streaming instead of fetching after mount). Beyond the landed page, the Speculation Rules API can prerender likely-next-page navigations so the LCP a user experiences on the next click is near-instant.

Full code patterns for each fix, the Speculation Rules setup and its caveats, the LCP optimization checklist, and the element-identification script are in references/LCP.md — load it when actually fixing an LCP issue.


INP: Interaction to Next Paint

INP measures responsiveness across ALL interactions (clicks, taps, key presses) during a page visit. It reports the worst interaction (at 98th percentile for high-traffic pages).

Total INP = Input Delay + Processing Time + Presentation Delay

PhaseTargetOptimization
Input Delay< 50msReduce main thread blocking
Processing< 100msOptimize event handlers
Presentation< 50msMinimize rendering work

The recurring causes are long synchronous tasks blocking the main thread, event handlers that do heavy work before giving visual feedback, eagerly-loaded third-party scripts, and excessive component re-renders. The fix pattern for the first two is the same: give immediate visual feedback, then yield to the scheduler (scheduler.yield(), falling back to setTimeout(0)) before doing the expensive work.

Full code patterns, the INP optimization checklist, and the debugging script (including the web-vitals/attribution build for field data) are in references/INP.md — load it when actually fixing an INP issue.


CLS: Cumulative Layout Shift

CLS measures unexpected layout shifts. A shift occurs when a visible element changes position between frames without user interaction.

CLS Formula: impact fraction × distance fraction

The recurring causes are images/iframes/embeds without reserved dimensions, content injected above existing content, web fonts causing FOUT/FOIT reflow, and animations that transition layout properties (height/width) instead of transform/opacity.

Full code patterns, the CLS optimization checklist, and the layout-shift debugging script are in references/CLS.md — load it when actually fixing a CLS issue.


Measurement tools

Lab testing
  • Chrome DevTools → Performance panel, Lighthouse
  • WebPageTest → Detailed waterfall, filmstrip
  • Lighthouse CLI → npx lighthouse <url>
Field data (real users)
  • Chrome User Experience Report (CrUX) → BigQuery or API
  • Search Console → Core Web Vitals report
  • web-vitals library → Send to your analytics
javascript
import {onLCP, onINP, onCLS} from 'web-vitals';
function sendToAnalytics({name, value, rating}) {
gtag('event', name, {
event_category: 'Web Vitals',
value: Math.round(name === 'CLS' ? value * 1000 : value),
event_label: rating
});
}
onLCP(sendToAnalytics);
onINP(sendToAnalytics);
onCLS(sendToAnalytics);

Lab tools (DevTools, Lighthouse, WebPageTest) show what could happen on one run; field data (CrUX, Search Console, the web-vitals library) shows what real users actually experienced at the 75th percentile — treat lab scores as diagnostic, not as the ranking signal itself.

Framework quick fixes

Next.js, React, and Vue/Nuxt each have idiomatic one-liners for the LCP/INP/CLS fixes above (e.g. next/image with priority, useTransition, NuxtImg with preload). See references/framework-quick-fixes.md.

References

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
2
7-day trend score
5

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/shennawardana23/skillme/core-web-vitals/badge)](https://verified-skill.com/skills/shennawardana23/skillme/core-web-vitals)

Something wrong with this skill or its page? Tell us.