All skills
patricio0312rev avatar

/core-web-vitals-tuner

@63451c7

Systematically improves Largest Contentful Paint (LCP), Interaction to Next Paint (INP), and Cumulative Layout Shift (CLS) with prioritized fixes and verification. Use for "Core Web Vitals", "performance", "LCP", "INP", or "CLS".

Use this Skill: https://skilld.dev/gh/patricio0312rev/skills/core-web-vitals-tuner

This session only. Nothing lands on disk.

SKILL.md

≈63 tokens always: the name and description. ≈547 when used: this file.

Core Web Vitals Tuner

Improve LCP, INP, and CLS systematically.

LCP Optimization (<2.5s)

Prioritized Fixes:

  1. Optimize images (Biggest impact)

    <!-- Before -->
    <img src="hero.jpg" />
    
    <!-- After -->
    <img
      src="hero.jpg"
      srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
      sizes="(max-width: 600px) 400px, (max-width: 1200px) 800px, 1200px"
      loading="eager"
      fetchpriority="high"
    />
  2. Preload LCP resource

    <link rel="preload" as="image" href="/hero.webp" fetchpriority="high" />
  3. Inline critical CSS

    <style>
      /* Above-the-fold styles */
      .hero {
        display: flex;
        height: 100vh;
      }
    </style>
  4. Use CDN

    • Serve images from CloudFront/Cloudflare
    • Enable HTTP/2 or HTTP/3

INP Optimization (<200ms)

Fixes:

  1. Debounce expensive interactions

    import { debounce } from "lodash";
    
    const handleSearch = debounce((query) => {
      fetchResults(query);
    }, 300);
  2. Use Web Workers for heavy tasks

    const worker = new Worker("processor.js");
    worker.postMessage(largeData);
    worker.onmessage = (e) => console.log(e.data);
  3. Code splitting

    const HeavyComponent = lazy(() => import("./HeavyComponent"));

CLS Optimization (<0.1)

Fixes:

  1. Reserve space for images/ads

    <img src="banner.jpg" width="1200" height="600" />
  2. Use CSS aspect-ratio

    .video-container {
      aspect-ratio: 16 / 9;
    }
  3. Avoid injecting content above existing

    .notification {
      position: fixed;
      top: 0;
    }

Verification

# Lighthouse CI
npm run lighthouse -- --url=https://example.com

# Web Vitals in production
import { getCLS, getFID, getLCP } from 'web-vitals';

getCLS(console.log);
getFID(console.log);
getLCP(console.log);

Output Checklist

  • LCP optimized (<2.5s)
  • INP optimized (<200ms)
  • CLS optimized (<0.1)
  • Monitoring in place
  • Performance regression tests ENDFILE

Source: SKILL.md on GitHub

1 warning17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides standard optimization techniques and code snippets for improving web performance metrics (Core Web Vitals). No malicious patterns or security risks were identified.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 63451c7. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 9 months ago

README badge

README badge for patricio0312rev/skills/core-web-vitals-tuner