skills/core-web-vitals/SKILL.md
Audits HTML patterns that affect Core Web Vitals (LCP, CLS, INP). Checks for layout shift causes, largest contentful paint blockers, and interaction responsiveness issues. Use when optimising page performance or fixing Google PageSpeed Insights warnings.
npx skillsauth add thisisahsaniqbal/nextjs-seo-audit core-web-vitalsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit HTML for patterns that negatively impact Core Web Vitals — the performance metrics Google uses as a ranking signal.
| Metric | Full name | Good threshold | What it measures | |---|---|---|---| | LCP | Largest Contentful Paint | ≤ 2.5s | Loading — time until the largest visible element renders | | CLS | Cumulative Layout Shift | ≤ 0.1 | Visual stability — unexpected layout movement | | INP | Interaction to Next Paint | ≤ 200ms | Responsiveness — delay between user input and visual update |
Identify the likely LCP element and check for blockers:
The LCP element is typically the largest visible element above the fold:
<img> near top of <body>)background-image)<h1>) with significant text| Check | Status |
|---|---|
| Hero/banner <img> missing fetchpriority="high" | ⚠️ WARN "Add fetchpriority=high to LCP image" |
| Hero image uses loading="lazy" | ❌ FAIL "Never lazy-load the LCP element" |
| LCP image not preloaded (<link rel="preload" as="image">) | ⚠️ WARN "Preload LCP image for faster rendering" |
| Render-blocking CSS in <head> (stylesheets without media attribute) | ⚠️ WARN |
| Render-blocking JS in <head> (scripts without async/defer) | ⚠️ WARN |
| LCP image served in legacy format (JPG/PNG instead of WebP/AVIF) | ⚠️ WARN |
| No render-blocking resources | ✅ PASS |
| Check | Status |
|---|---|
| Custom fonts without <link rel="preload" as="font"> | ⚠️ WARN "Preload critical fonts" |
| No font-display: swap or font-display: optional in @font-face | ⚠️ WARN "Add font-display to prevent invisible text" |
| Fonts preloaded properly | ✅ PASS |
Identify HTML patterns that cause layout shift:
| Check | Status |
|---|---|
| <img> without width and height attributes | ❌ FAIL "Missing dimensions cause layout shift" |
| <video> or <iframe> without width/height | ⚠️ WARN |
| Ads/embeds without reserved space (no explicit dimensions) | ⚠️ WARN "Reserve space for dynamic content" |
| Web fonts causing FOIT (Flash of Invisible Text) — no font-display | ⚠️ WARN |
| Content injected above existing content (banners, cookie notices without reserved space) | ⚠️ WARN |
| All images have dimensions | ✅ PASS "No layout shift from images" |
| Check | Status |
|---|---|
| Animations using top, left, width, height (trigger layout) | ⚠️ WARN "Use transform instead for animations" |
| Animations using transform and opacity only | ✅ PASS "GPU-accelerated, no layout shift" |
Identify patterns that block the main thread:
| Check | Status |
|---|---|
| <script> tags without async or defer | ⚠️ WARN "Blocks main thread during parsing" |
| Inline <script> with heavy computation (> 50 lines) | ⚠️ WARN "Move heavy JS to async external file" |
| Event handlers in HTML attributes (onclick, onchange, etc.) | ⚠️ WARN "Use addEventListener instead for better performance" |
| Third-party scripts loaded synchronously | ⚠️ WARN "Load third-party scripts with async" |
| All scripts properly deferred/async | ✅ PASS |
Count third-party scripts (different domain):
| Check | Status |
|---|---|
| <link rel="preconnect"> for third-party origins | ✅ PASS if present, ⚠️ WARN if missing with 3rd-party resources |
| <link rel="dns-prefetch"> for third-party origins | ✅ PASS if present |
| <link rel="preload"> for critical resources | ✅ PASS if present |
| Excessive DOM size (> 1500 elements) | ⚠️ WARN "Large DOM slows rendering" |
| <meta name="viewport"> with width=device-width | Required for mobile CWV (see mobile-optimization for full viewport checks) |
Core Web Vitals Audit
─────────────────────
LCP Risk Factors: X issues found
CLS Risk Factors: Y issues found
INP Risk Factors: Z issues found
Overall CWV Risk: LOW / MEDIUM / HIGH
<style> for critical CSS is intentional and should NOT be flagged as a CLS risk — distinguish from injected layout-shifting styles<script type="module"> is inherently deferred — do not flag as render-blocking<iframe> do not block the main thread — exclude from INP third-party counttesting
Audits sitemap references, robots.txt directives, canonical tags, crawlability, URL structure, redirect chains, and indexability. Use when checking technical SEO foundations or fixing crawl/index issues.
development
Audits stylesheet loading, inline CSS volume, image alt text, image formats, and Next.js Image component usage. Use when checking page speed related to HTML structure. For render-blocking scripts, image dimensions, lazy loading, and resource hints, see the core-web-vitals skill.
development
Validates HTML5 semantic elements, ARIA landmarks, skip navigation, and page structure. Use when auditing semantic HTML, accessibility, or content structure for SEO. For the lang attribute, see the international-seo skill.
testing
Validates existing JSON-LD structured data and suggests relevant schemas based on auto-detected page type. Does NOT enforce all schema types — only checks what is applicable to the current page context. Use when auditing or generating structured data for search engine rich results.