Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Responsive Images

  • 92 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with ai & agent building tasks during AI-assisted development.

About

responsive-images is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • responsive-images
  • AI & Agent Building
  • AI-coding skill

Responsive Images by the numbers

  • 92 all-time installs (skills.sh)
  • +6 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #4,749 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill responsive-images

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs92
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

Responsive Images

Overview

Responsive images serve the right image size and format based on viewport, device pixel ratio, and browser capabilities. Proper implementation prevents layout shift (CLS), optimizes Largest Contentful Paint (LCP), and reduces bandwidth by 50-70% with modern formats.

When to use: Any page with images, especially content images, hero images, product photos, and gallery layouts.

When NOT to use: Inline SVG icons, CSS background patterns, or canvas-rendered graphics.

Quick Reference

PatternApproachKey Points
Responsive sizingsrcset with width descriptors (w) + sizesBrowser selects optimal image for viewport and DPR
Modern formats<picture> with AVIF, WebP, JPEG sourcesAVIF saves 70%, WebP saves 50% vs JPEG
Art direction<picture> with media queriesDifferent crops per viewport
LCP hero imageloading="eager" + fetchpriority="high"Prioritize download for Core Web Vitals
Below-fold imagesloading="lazy"Defer until near viewport
Prevent CLSwidth + height attributesBrowser reserves space before load
Fixed containersobject-fit: cover or containMaintain aspect ratio in constrained space
Format fallbackAVIF, WebP, JPEG source orderBest compression first, universal fallback last

Recommended Image Sizes

Use CaseWidths to GenerateSizes Attribute
Full-width hero800w, 1200w, 1600w, 2400w100vw
Content width400w, 800w, 1200w(max-width: 768px) 100vw, 800px
Grid cards (3-col)300w, 600w, 900w(max-width: 768px) 100vw, 33vw
Sidebar thumbnail150w, 300w150px

Loading Strategy

Image PositionloadingfetchpriorityWhy
Hero/LCPeagerhighOptimize LCP, prioritize download
Above fold (not LCP)eageromitLoad normally
Below foldlazyomitDefer until near viewport
Off-screen carousellazyomitDefer until interaction

Format Comparison

FormatQualityFile SizeBrowser SupportUse Case
JPEGGoodMedium100%Photos, complex images
PNGLosslessLarge100%Logos, transparency
WebPExcellentSmall96%+Modern browsers, photos
AVIFExcellentSmallest93%+Newest format, fallback required

Common Mistakes

MistakeCorrect Pattern
Omitting width and height attributes on img elementsAlways include width and height to prevent CLS layout shift
Lazy loading the LCP hero imageUse loading="eager" and fetchpriority="high" for LCP images
Using density descriptors (1x, 2x) for variable-width imagesUse width descriptors (400w, 800w) with a sizes attribute
Missing alt text on content imagesProvide descriptive alt text; use alt="" only for decorative images
Serving only JPEG without modern format fallbacksUse <picture> with AVIF and WebP sources falling back to JPEG

Delegation

  • Audit a page for responsive image issues and CLS problems: Use Explore agent to scan HTML for missing attributes, incorrect loading strategies, and format gaps
  • Convert all images on a page to use picture element with modern formats: Use Task agent to rewrite img tags with AVIF/WebP/JPEG fallback chain
  • Plan an image optimization pipeline for a multi-page site: Use Plan agent to design srcset breakpoints, format conversion workflow, and CDN integration

References

  • srcset, sizes, and width descriptor patterns
  • Picture element and art direction
  • Modern image formats: WebP, AVIF, and conversion tools
  • Lazy loading, fetchpriority, and LCP optimization
  • Aspect ratio, object-fit, and CLS prevention

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.