Skip to content
Back to skills

Web Vitals

ASecurity

- **LCP** (Largest Contentful Paint): < 2.5s — largest visible element render time - **INP** (Interaction to Next Paint): < 200ms — responsiveness to user input - **CLS** (Cumulative Layout Shift): < 0.1 — visual stability

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 27, 2026
data-aireactnextjs

Works with

  • cli

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add ByeongminLee/nextjs-claude-code --skill web-vitals --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Web Vitals?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Web Vitals
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/byeongminlee-web-vitals/badge)](https://www.skillsdirectory.com/skills/byeongminlee-web-vitals)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Core Web Vitals Optimization

## Metrics
- **LCP** (Largest Contentful Paint): < 2.5s — largest visible element render time
- **INP** (Interaction to Next Paint): < 200ms — responsiveness to user input
- **CLS** (Cumulative Layout Shift): < 0.1 — visual stability

## LCP Optimization
- Preload hero images: `<link rel="preload" as="image">`
- Use `next/image` with `priority` for above-the-fold images
- Minimize render-blocking CSS: inline critical CSS, defer non-critical
- Server-side render critical content (avoid client-only data fetching for LCP elements)
- Avoid lazy loading above-the-fold content

## INP Optimization
- Keep event handlers < 50ms; offload heavy work to `requestIdleCallback` or Web Workers
- Use `React.startTransition` for non-urgent state updates
- Debounce/throttle input handlers (search, scroll, resize)
- Avoid long tasks: split > 50ms tasks using `scheduler.yield()` or chunking
- Use `useDeferredValue` for expensive re-renders triggered by user input

## CLS Optimization
- Set explicit `width`/`height` or `aspect-ratio` on images, videos, iframes
- Reserve space for dynamic content (skeleton placeholders)
- Avoid inserting content above existing content (banners, ads)
- Use `transform` animations instead of layout-triggering properties (top, left, width, height)
- Font loading: `font-display: swap` + preload critical fonts

## Next.js Specifics
- `@vercel/speed-insights` for real-user monitoring
- `next/image` handles sizing, lazy loading, format optimization
- `next/font` eliminates font CLS with automatic `size-adjust`
- Route prefetching: `<Link>` auto-prefetches in viewport
- Streaming SSR with `loading.tsx` reduces perceived LCP

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.