responsive-images — скилл для Claude Code: что делает и как установить
Скилл responsive-images внедряет адаптивные изображения с srcset, современными форматами AVIF и WebP, защищая от сдвигов верстки CLS и ускоряя LCP.
MIT 148 установок ★ 29 обновлён 2026-08-17
npx skills add oakoss/agent-skills --skill responsive-images -a claude-codeЧто делает responsive-images
Скилл учит агента внедрять адаптивную графику на веб-страницах. Он задаёт правила для атрибутов srcset, sizes, loading и контейнера <picture> с цепочкой отдачи AVIF, WebP и JPEG. За счёт этого уменьшается трафик на 50–70% и улучшаются показатели Core Web Vitals.
В инструкциях расписаны шаблоны ширин для разных блоков: баннеров hero во всю ширину (800w, 1200w, 1600w, 2400w), контентных колонок, карточек сетки и боковых миниатюр. Для LCP-изображений задаются атрибуты loading="eager" и fetchpriority="high", а для контента ниже первого экрана — отложенная загрузка lazy.
Для встроенных иконок SVG, фоновых узоров в CSS и графики на холсте <canvas> скилл прямо запрещает использовать эти паттерны.
Какие задачи решает
- Устранить сдвиги макета CLS добавлением атрибутов width и height
- Настроить раздачу картинок в форматах AVIF и WebP через тег picture
- Ускорить загрузку главного баннера страницы для метрики LCP
- Подобрать сетку ширин srcset и условий sizes под адаптивную верстку
Примеры запросов агенту
- Перепиши все теги img на странице каталога с использованием picture, AVIF и WebP
- Проверь главную страницу на проблемы с LCP и сдвигами верстки из-за картинок
- Настрой адаптивные размеры srcset и sizes для трехколоночной сетки карточек
Как установить responsive-images
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill responsive-images -a claude-code2Вручную: положить файлы
~/.claude/skills/responsive-images/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/responsive-images/
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill responsive-images -a codex2Вручную: положить файлы
.agents/skills/responsive-images/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill responsive-images -a cursor2Вручную: положить файлы
.cursor/skills/responsive-images/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install oakoss/agent-skills skills/responsive-images2Вручную: положить файлы
.github/skills/responsive-images/SKILL.md1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill responsive-images -a gemini-cli2Командой платформы
gemini skills install https://github.com/oakoss/agent-skills --path skills/responsive-imagesВручную: положить файлы
.devin/skills/responsive-images/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill responsive-images -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о responsive-images
Как установить responsive-images в Claude Code?
Выполните команду npx skills add oakoss/agent-skills --skill responsive-images -a claude-code. Файл навыка сохранится по пути ~/.claude/skills/responsive-images/SKILL.md.
Что делает скилл responsive-images?
Он предоставляет агенту готовые инструкции по выбору атрибутов srcset, sizes, форматов AVIF и WebP, приоритетов загрузки и предотвращению скачков интерфейса.
В каких случаях скилл не следует применять?
Его правила не предназначены для инлайновых SVG-иконок, повторяющихся фоновых текстур в CSS и элементов, рисуемых через <canvas>.
Исходный текст
SKILL.md · MIT
--- name: responsive-images description: | Implement performant responsive images with srcset, sizes, lazy loading, and modern formats (WebP, AVIF). Covers aspect-ratio for CLS prevention, picture element for art direction, and fetchpriority for LCP optimization. Use when adding images to pages, optimizing Core Web Vitals, preventing layout shift, implementing art direction, or converting to modern formats. license: MIT metadata: author: oakoss version: '1.0' user-invocable: false --- # 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 | Pattern | Approach | Key Points | | ----------------- | --------------------------------------------- | -------------------------------------------------- | | Responsive sizing | `srcset` with width descriptors (w) + `sizes` | Browser selects optimal image for viewport and DPR | | Modern formats | `<picture>` with AVIF, WebP, JPEG sources | AVIF saves 70%, WebP saves 50% vs JPEG | | Art direction | `<picture>` with `media` queries | Different crops per viewport | | LCP hero image | `loading="eager"` + `fetchpriority="high"` | Prioritize download for Core Web Vitals | | Below-fold images | `loading="lazy"` | Defer until near viewport | | Prevent CLS | `width` + `height` attributes | Browser reserves space before load | | Fixed containers | `object-fit: cover` or `contain` | Maintain aspect ratio in constrained space | | Format fallback | AVIF, WebP, JPEG source order | Best compression first, universal fallback last | ## Recommended Image Sizes | Use Case | Widths to Generate | Sizes Attribute | | ------------------ | ------------------------- | --------------------------------- | | Full-width hero | 800w, 1200w, 1600w, 2400w | `100vw` | | Content width | 400w, 800w, 1200w | `(max-width: 768px) 100vw, 800px` | | Grid cards (3-col) | 300w, 600w, 900w | `(max-width: 768px) 100vw, 33vw` | | Sidebar thumbnail | 150w, 300w | `150px` | ## Loading Strategy | Image Position | loading | fetchpriority | Why | | -------------------- | ------- | ------------- | --------------------------------- | | Hero/LCP | `eager` | `high` | Optimize LCP, prioritize download | | Above fold (not LCP) | `eager` | omit | Load normally | | Below fold | `lazy` | omit | Defer until near viewport | | Off-screen carousel | `lazy` | omit | Defer until interaction | ## Format Comparison | Format | Quality | File Size | Browser Support | Use Case | | ------ | --------- | --------- | --------------- | -------------------------------- | | JPEG | Good | Medium | 100% | Photos, complex images | | PNG | Lossless | Large | 100% | Logos, transparency | | WebP | Excellent | Small | 96%+ | Modern browsers, photos | | AVIF | Excellent | Smallest | 93%+ | Newest format, fallback required | ## Common Mistakes | Mistake | Correct Pattern | | ------------------------------------------------------------ | --------------------------------------------------------------------- | | Omitting width and height attributes on img elements | Always include `width` and `height` to prevent CLS layout shift | | Lazy loading the LCP hero image | Use `loading="eager"` and `fetchpriority="high"` for LCP images | | Using density descriptors (1x, 2x) for variable-width images | Use width descriptors (400w, 800w) with a `sizes` attribute | | Missing alt text on content images | Provide descriptive alt text; use `alt=""` only for decorative images | | Serving only JPEG without modern format fallbacks | Use `<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](references/srcset-sizes.md) - [Picture element and art direction](references/picture-element.md) - [Modern image formats: WebP, AVIF, and conversion tools](references/modern-formats.md) - [Lazy loading, fetchpriority, and LCP optimization](references/lazy-loading.md) - [Aspect ratio, object-fit, and CLS prevention](references/aspect-ratio.md)
© oakoss · MIT · oakoss/agent-skills