Command Palette

Search for a command to run...

Назад к скиллам
скилл № 62845

frontend-image-optimization

Use when the user asks about responsive images, srcset and sizes, the picture element, AVIF/WebP, lazy loading images, next/image, image CDNs, fetchpriority…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить frontend-image-optimization в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Frontend Image Optimization

Description: Implements image optimization — format selection, responsive images, lazy loading, CDN transforms, placeholder strategies, and performance budgets. Triggered by "image optimization", "responsive images", "image CDN", "lazy loading images", "next/image", "srcset", "picture element", "WebP", "AVIF", "image compression", "image CDN", "blur placeholder", "progressive image".

Version: 2.0.0 Author: j4flmao License: MIT


Purpose

Deliver optimized images that load fast, look crisp on any screen, and minimize bandwidth usage — directly impacting LCP, CLS, and overall page weight budgets.


Agent Protocol

Trigger

User request includes any of: "image optimization", "responsive images", "image CDN", "lazy loading images", "next/image", "srcset", "picture element", "WebP", "AVIF", "image compression", "image CDN", "blur placeholder", "progressive image".

Input Context

  • Image sources (CMS, local, CDN, user uploads)
  • Layout requirements (hero, card thumbnails, full-width banners)
  • Breakpoints and device targets
  • Performance budget (LCP target, total image weight)

Output Artifact

Image optimization strategy with srcset/picture markup and performance notes.

Response Format

## Strategy
<formats, breakpoints, CDN, placeholders>

## Markup
<srcset, picture, lazy-loading code>

## Performance
<LCP-image, preload, budgets>

—
Compression footer: frontend-image-optimization/v1 | 3 sections | formats: <avif+webp+jpeg> | LCP: <ok|warn>

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.

Completion Criteria

  • All content images use srcset with appropriate breakpoints
  • AVIF with WebP fallback in picture element
  • LCP image preloaded in document head
  • lazy loading applied to all below-fold images
  • Aspect ratio wrapper on every image (prevent CLS)
  • Alt text on every image

Max Response Length

4096 tokens

Image Optimization Architecture / Decision Trees

Format Selection Decision Tree

Type of image?
  |-- Photograph / complex scene -->
  |     |-- AVIF available? --> Use AVIF (50% smaller than JPEG)
  |     |-- WebP available? --> Use WebP fallback
  |     |-- Neither --> Progressive JPEG (perceived faster load)
  |     NOTE: Always serve AVIF + WebP + JPEG via <picture>
  |
  |-- Logo / icon / illustration with few colors -->
  |     |-- Simple shapes? --> SVG (inline for small, sprite for many)
  |     |-- Has transparency? --> PNG + WebP (with transparency support)
  |
  |-- Screenshot / UI mockup -->
        |-- AVIF with WebP fallback (good for synthetic images)

Loading Strategy Decision Tree

Position in viewport?
  |-- Above fold (visible on load) -->
  |     |-- LCP candidate? -->
  |     |     YES: Eager load + preload via `<link rel="preload">`
  |     |     NO:  Eager load (omit loading attribute)
  |     |
  |     |-- Art direction needed?
  |           YES: <picture> with mobile/desktop variants
  |           NO:  <img> with srcset + sizes
  |
  |-- Below fold (scrolled into view) -->
        |-- Native lazy loading? -->
        |     YES: loading="lazy" (supported in all modern browsers)
        |     NO:  IntersectionObserver polyfill
        |
        |-- Placeholder needed?
              YES: LQIP (blur placeholder, ~20px width)
              NO:  aspect-ratio container only

Placeholder Strategy Decision Tree

Perceived loading time?
  |-- Instant (< 1s on fast connection) -->
  |     No placeholder needed, use aspect-ratio box only
  |
  |-- Fast (1-3s) -->
  |     |-- Dominant color: simplest, least data
  |     |-- Blur-up: better UX, needs tiny thumbnail URL
  |
  |-- Slow (3s+) -->
  |     |-- LQIP: Low Quality Image Placeholder (blurred, 20-30px)
  |     |-- Progressive JPEG: loads in passes, perceived faster
  |
  |-- Very slow / poor connectivity -->
        LQIP with skeleton shimmer animation

Workflow

1. Format Selection

  • AVIF: Best compression (50% smaller than JPEG). Serve first via <picture> with WebP/JPEG fallback.
  • WebP: Widely supported fallback. Good compression. Use when AVIF not available.
  • JPEG: Photos, complex scenes. Progressive JPEG for perceived speed.
  • PNG: Transparency requirements (icons, logos with transparency).
  • SVG: Icons, illustrations, logos. Always inline or use sprite sheet for small SVGs.

2. Responsive Images

  • srcset + sizes attribute for resolution switching.
  • Device pixel ratio awareness: 1x, 2x, 3x descriptors.
  • Art direction via <picture> with media queries for mobile/crop variants.
  • Use image CDN transforms to generate variants on-the-fly.
  • Typical breakpoints: 640w, 768w, 1024w, 1280w, 1536w.

3. Lazy Loading

  • Native loading="lazy" attribute on <img> and <iframe>.
  • IntersectionObserver for custom thresholds (rootMargin, threshold).
  • Eager load (loading="eager" o
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/image-accessibility.md
  • references/image-cdn-configuration.md
  • references/image-components.md
  • references/image-delivery.md
  • references/image-formats.md
  • references/image-performance.md

FAQ

Что делает скилл frontend-image-optimization?

Use when the user asks about responsive images, srcset and sizes, the picture element, AVIF/WebP, lazy loading images, next/image, image CDNs, fetchpriority for the LCP image or blur placeholders. Produces image markup and pipeline settings. Not for overall Core Web Vitals diagnosis (use web-performance).

Как установить скилл frontend-image-optimization?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл frontend-image-optimization запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить frontend-image-optimization с