responsive-images

Implement responsive images with srcset, sizes, lazy loading, and modern formats.

14|5|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/oakoss/agent-skills --skill responsive-images-oakoss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: responsive-images
Source: https://github.com/oakoss/agent-skills/tree/main/skills/responsive-images
Command: npx skills add https://github.com/oakoss/agent-skills --skill responsive-images-oakoss

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of serving appropriately sized and formatted images across different devices and network conditions, preventing layout shifts and improving Core Web Vitals.

Core Features & Use Cases

  • Responsive Sizing: Implements srcset and sizes for optimal image selection.
  • Modern Formats: Utilizes <picture> with AVIF and WebP for reduced file sizes.
  • Art Direction: Provides different image crops for various viewports.
  • Loading Strategies: Implements loading="lazy" and fetchpriority="high" for LCP optimization.
  • CLS Prevention: Ensures space is reserved using width/height or aspect-ratio.
  • Use Case: When adding images to a website, especially hero images or product photos, to ensure fast loading, prevent layout shifts, and reduce bandwidth consumption.

Quick Start

Implement responsive images for the main hero banner using AVIF, WebP, and JPEG formats with appropriate sizes and lazy loading.

Frequently Asked Questions about responsive-images

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize images to prevent layout shift and improve Core Web Vitals?

Optimize images to prevent layout shift by reserving space using width and height attributes or aspect-ratio CSS, implementing responsive sizing with srcset, and applying lazy loading to improve Core Web Vitals.

What's the best way to implement responsive images with AVIF and WebP?

Implement responsive images with AVIF and WebP by using the picture element to serve modern formats, providing fallbacks, and utilizing srcset and sizes attributes for optimal image selection across viewports.

How do I use srcset and sizes for art direction across different viewports?

Use srcset and sizes for art direction by providing different image crops for various viewports, allowing the browser to select the optimal image source based on screen dimensions and network conditions.

When do I need fetchpriority and lazy loading for hero images?

You need fetchpriority set to high and lazy loading configured properly for hero images to optimize Largest Contentful Paint, ensuring above-the-fold visuals load immediately while deferring offscreen images.

Does implementing WebP and AVIF formats reduce bandwidth for responsive images?

Implementing WebP and AVIF formats reduces bandwidth for responsive images by utilizing modern compression within the picture element, serving smaller file sizes compared to JPEG without sacrificing quality.

Why does my responsive image strategy still cause Cumulative Layout Shift?

Your responsive image strategy causes Cumulative Layout Shift if you omit explicit width and height attributes or fail to define an aspect-ratio, preventing the browser from reserving adequate space during rendering.