All skills
asyrafhussin avatar

/seo-best-practices

@46bae0b

SEO patterns, conventions, and audit for web applications. Use when implementing meta tags, structured data, Core Web Vitals, sitemaps, Open Graph, auditing SEO, or optimizing pages for search engines. Triggers on "audit SEO", "check SEO", "review SEO", or tasks involving search optimization, schema markup, or social sharing meta tags.

Use this Skill: https://skilld.dev/gh/asyrafhussin/agent-skills/seo-best-practices

This session only. Nothing lands on disk.

rulesperf-lazy-loading.md

≈806 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Lazy Loading Implementation

Impact: HIGH (Reduces initial page weight and improves LCP)

Native lazy loading defers off-screen images until the user scrolls near them, reducing initial page weight and speeding up the critical rendering path. However, applying lazy loading to the LCP element delays the most important visual content and directly hurts your Core Web Vitals score.

Incorrect

<!-- ❌ Bad: lazy loading the hero/LCP image -->
<section class="hero">
  <img
    src="/images/hero-banner.jpg"
    loading="lazy"
    alt="Welcome to our store"
  />
</section>

<!-- ❌ Bad: using a custom JS lazy loader for all images -->
<img data-src="/images/product-1.jpg" class="lazyload" alt="Product 1" />
<img data-src="/images/product-2.jpg" class="lazyload" alt="Product 2" />
<script src="/js/lazysizes.min.js"></script>

Problems:

  • loading="lazy" on the hero image causes the browser to deprioritize the LCP element, delaying the largest paint
  • Custom JavaScript lazy loaders add bundle weight, introduce a runtime dependency, and are invisible to the browser's preload scanner
  • Images using data-src instead of src are not discoverable by the browser until JavaScript executes

Correct

<!-- ✅ Good: hero image loads eagerly with high priority -->
<section class="hero">
  <img
    src="/images/hero-banner.webp"
    fetchpriority="high"
    width="1200"
    height="600"
    alt="Welcome to our store"
  />
</section>

<!-- ✅ Good: below-fold images use native lazy loading -->
<section class="product-grid">
  <img
    src="/images/product-1.webp"
    loading="lazy"
    decoding="async"
    width="400"
    height="300"
    alt="Product 1"
  />
  <img
    src="/images/product-2.webp"
    loading="lazy"
    decoding="async"
    width="400"
    height="300"
    alt="Product 2"
  />
</section>
// ✅ React: eager loading for LCP image, lazy loading for below-fold images
export default function HomePage() {
  return (
    <>
      {/* LCP element: no lazy loading, high fetch priority */}
      <img
        src="/images/hero-banner.webp"
        alt="Welcome to our store"
        width={1200}
        height={600}
        fetchPriority="high"
      />

      {/* Below-fold: native lazy loading */}
      <div className="product-grid">
        <img
          src="/images/product-1.webp"
          alt="Product 1"
          width={400}
          height={300}
          loading="lazy"
          decoding="async"
        />
      </div>
    </>
  );
}

Benefits:

  • fetchpriority="high" on the LCP element ensures it is fetched before other resources, improving LCP
  • Native loading="lazy" requires no JavaScript, works with the browser's preload scanner, and is supported by all modern browsers
  • Real src attributes allow the browser to discover images immediately, unlike data-src patterns
  • Explicit width and height reserve layout space and prevent CLS

Reference: Browser-level image lazy loading

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a comprehensive SEO reference and audit tool for React and Laravel applications. It provides detailed patterns for optimizing Core Web Vitals, technical SEO, and structured data. No malicious code, obfuscation, or data exfiltration patterns were identified. The skill is designed to analyze project code and provide structural feedback based on a predefined checklist.

  • Socket16d

    5 alerts: gptAnomaly

  • Snyk16d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

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

Last checked against GitHub last month.

Steadyupdated 6 months ago
metadata
{
  "author": "agent-skills",
  "version": "1.2.0"
}

README badge

README badge for asyrafhussin/agent-skills/seo-best-practices