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-image-formats.md

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

Modern Image Formats (WebP/AVIF)

Impact: HIGH (30-50% smaller files vs JPEG/PNG)

Serving images in modern formats like AVIF and WebP dramatically reduces file sizes without visible quality loss. Smaller images mean faster page loads, lower bandwidth costs, and better Core Web Vitals scores. Using the <picture> element with fallbacks ensures all browsers receive the best format they support.

Incorrect

<!-- ❌ Bad: serving only JPEG with no responsive sizing -->
<img src="/images/product-hero.jpg" alt="Product showcase" />

<img
  src="/images/team-photo.png"
  alt="Our team"
  width="1920"
  height="1080"
/>

Problems:

  • JPEG and PNG files are significantly larger than WebP/AVIF equivalents at the same visual quality
  • No srcset means the browser downloads the full-size image on all devices, wasting bandwidth on mobile
  • No fallback chain means you cannot adopt newer formats without breaking older browsers

Correct

<!-- ✅ Good: picture element with AVIF/WebP/JPEG fallback and responsive srcset -->
<picture>
  <source
    type="image/avif"
    srcset="
      /images/product-hero-400.avif 400w,
      /images/product-hero-800.avif 800w,
      /images/product-hero-1200.avif 1200w
    "
    sizes="(max-width: 600px) 100vw, (max-width: 1024px) 80vw, 1200px"
  />
  <source
    type="image/webp"
    srcset="
      /images/product-hero-400.webp 400w,
      /images/product-hero-800.webp 800w,
      /images/product-hero-1200.webp 1200w
    "
    sizes="(max-width: 600px) 100vw, (max-width: 1024px) 80vw, 1200px"
  />
  <img
    src="/images/product-hero-1200.jpg"
    srcset="
      /images/product-hero-400.jpg 400w,
      /images/product-hero-800.jpg 800w,
      /images/product-hero-1200.jpg 1200w
    "
    sizes="(max-width: 600px) 100vw, (max-width: 1024px) 80vw, 1200px"
    alt="Product showcase"
    width="1200"
    height="800"
    loading="lazy"
    decoding="async"
  />
</picture>
// ✅ React: responsive image with modern format sources
export default function ProductCard({ product }: { product: { name: string; image: string } }) {
  return (
    <picture>
      <source
        type="image/avif"
        srcSet={`${product.imageBase}-400.avif 400w, ${product.imageBase}-800.avif 800w`}
        sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
      />
      <source
        type="image/webp"
        srcSet={`${product.imageBase}-400.webp 400w, ${product.imageBase}-800.webp 800w`}
        sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
      />
      <img
        src={product.imageUrl}
        alt={product.name}
        width={800}
        height={600}
        loading="lazy"
        decoding="async"
      />
    </picture>
  );
}

Benefits:

  • AVIF offers 50% savings over JPEG; WebP offers 30% savings, with automatic fallback to JPEG for older browsers
  • Responsive srcset with sizes ensures the browser downloads only the appropriate resolution for each viewport
  • Explicit width and height prevent layout shifts (CLS) while the image loads
  • decoding="async" prevents the image decode from blocking the main thread

Reference: Use modern image formats

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