image-optimization
What it does
This skill reviews all the images in a project and checks each one for common web performance issues. It is for developers and designers who want fast, stable pages.
When to use it
- ✓When your pages load slowly and images are a likely cause.
- ✓When images are missing size attributes or lazy loading settings.
- ✓When you want a full review of image handling before launch.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/image-optimization/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you review all the images on my site and fix the performance problems?”
5 new skills a week. 1 minute to read.
How it works
The agent checks each image for format, responsive sizes, width and height, lazy loading and file size. It groups the issues by severity and suggests fixes such as picture elements with WebP or AVIF and srcset sizes.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Optimize all images for web
Images typically account for 50%+ of page weight. Unoptimized images cause slow load times, wasted bandwidth, poor Core Web Vitals scores, and frustrated users—especially on mobile networks.
Quick Reference
- Use modern formats: AVIF > WebP > JPEG/PNG
- Compress images to 80% quality for photos
- Always provide responsive srcset for different screen sizes
- Use
<picture>element for format fallbacks
Check
Scan this codebase for all image assets and <img> elements. For each image, verify: 1) Format is appropriate (WebP/AVIF for photos, SVG for icons, PNG only for transparency). 2) Responsive srcset and sizes attributes exist for images > 100px wide. 3) width/height attributes are present to prevent layout shift. 4) loading='lazy' is set for below-fold images. 5) File sizes are reasonable (< 200KB for photos, < 50KB for graphics). Report issues grouped by severity with file paths.
Fix
For each image optimization issue found: 1) Convert JPEG/PNG photos to WebP with AVIF fallback using <picture> element. 2) Add srcset with 400w, 800w, 1200w, 1600w variants and appropriate sizes attribute. 3) Add explicit width/height attributes matching aspect ratio. 4) Add loading='lazy' to images below the fold, keep priority images without lazy loading. 5) Compress images to 80% quality for photos, 60% for AVIF. 6) Use SVG for icons and logos. Show the corrected HTML with optimized image markup.
Explain
Explain the impact of image optimization on Core Web Vitals, specifically how unoptimized images affect Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS). Cover the compression differences between AVIF, WebP, and JPEG formats, when to use each, and browser support considerations. Describe how srcset and sizes work together to serve appropriately-sized images, and why width/height attributes prevent layout shift. Include bandwidth savings calculations and loading performance improvements.
Code Review
Review image assets, markup, and delivery configuration related to Optimize all images for web. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/images/image-optimization
FAQ
Should every image be lazy loaded?
No. The skill says to keep priority images, such as the main one at the top, without lazy loading.
What formats does it recommend?
It recommends AVIF first, then WebP, with JPEG or PNG as fallbacks, and SVG for icons and logos.
Why add width and height?
The skill says explicit sizes stop layout shifts while the page loads.
Details
Original description by the author
Use when reviewing image assets, markup, and CDN or build transforms related to Optimize all images for web. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2885
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
gifgrep
394kLets your agent search GIF libraries, preview results, download a GIF, and pull out a still frame or a contact sheet of frames.
meme-maker
394kLets your agent pick a meme template, add your own captions, and create the meme as an SVG or PNG image.
ios-icon-gen
280kLets your agent generate icons for iOS apps. It uses Apple symbols or icons from other sources to create the correct files.