What problem does it solve?
This Skill addresses the common issue of slow website loading times and poor user experience caused by unoptimized images, preventing layout shifts and oversized payloads.
Core Features & Use Cases
- Prevents CLS: Ensures images have dimensions set to avoid layout shifts.
- Optimizes LCP: Uses
priority for above-the-fold images to improve Largest Contentful Paint.
- Efficient Formats: Leverages modern formats like AVIF and WebP for smaller file sizes.
- Responsive Images: Configures
sizes for optimal image loading across different viewports.
- External Image Handling: Supports optimization of images from external sources via
remotePatterns.
- Accessibility: Enforces descriptive
alt text for all images.
- Use Case: When adding a hero image to a Next.js application, use this skill to ensure it's rendered with correct dimensions, priority loading, and an optimized format to improve initial page load performance and user experience.
Quick Start
Optimize the hero image '/hero.jpg' for a Next.js app, ensuring it has dimensions, priority loading, and uses the WebP format.