image-optimization-cdn
БесплатноБез исполняемых скриптовНе проверенSpeed up your store by automatically resizing and converting product images to WebP/AVIF, adding lazy loading, and serving via CDN
от finsilabs★ 69 звёзд на GitHubОб этом скилле
Image Optimization CDN
Overview
Product images are typically the largest assets on e-commerce pages and the single biggest contributor to poor Largest Contentful Paint (LCP) scores. An optimized image pipeline resizes images to the required dimensions, converts to modern formats (WebP, AVIF) for 30–50% smaller file sizes, delivers from a CDN close to the user, and applies lazy loading to images below the fold.
When to Use This Skill
- When product pages fail Core Web Vitals due to large or unoptimized images (LCP > 2.5s)
- When setting up an image pipeline for a new headless storefront
- When original product images from vendors are multi-megabyte files that need automation
- When adding WebP/AVIF support to an existing storefront that serves only JPEG/PNG
- When measuring Core Web Vitals and images are the primary bottleneck
Core Instructions
Step 1: Determine your platform and available image optimization
| Platform | Built-In Image CDN | What You Need to Do |
|---|---|---|
| Shopify | Shopify CDN (Fastly) — automatic WebP conversion, responsive sizing via URL params | Use Liquid img_url filter with size params; ensure all <img> tags have width and height attributes; add loading="lazy" to below-fold images |
| WooCommerce | None by default | Install Imagify or ShortPixel plugin for automatic WebP conversion; add Cloudflare as CDN (free tier) for global delivery |
| BigCommerce | BigCommerce CDN — automatic WebP conversion, responsive sizing | BigCommerce serves images via CDN automatically; optimize by specifying image dimensions in the URL and setting proper <img> attributes in templates |
| Custom / Headless | None — you build it | Use Cloudinary (managed) or Sharp (self-hosted) with a CDN; see implementation below |
Step 2: Platform-specific image optimization
Shopify
Shopify CDN automatically handles WebP conversion and resizing. Your job is to use it correctly in Liquid templates:
- Always use the
image_urlfilter with explicit dimensions:
<!-- Good: Shopify CDN serves WebP at the right size -->
<img
src="{{ product.featured_image | image_url: width: 800 }}"
srcset="{{ product.featured_image | image_url: width: 400 }} 400w,
{{ product.featured_image | image_url: width: 800 }} 800w,
{{ product.featured_image | image_url: width: 1200 }} 1200w"
sizes="(max-width: 640px) 100vw, 50vw"
width="800" height="800"
loading="lazy"
alt="{{ product.featured_image.alt | escape }}"
/>
- Use
loading="eager"only for the hero (LCP) image:
{% if forloop.first %}
{%- assign loading = 'eager' -%}
{%- assign fetchpriority = 'high' -%}
{% else %}
{%- assign loading = 'lazy' -%}
{%- assign fetchpriority = 'auto' -%}
{% endif %}
<img loading="{{ loading }}" fetchpriority="{{ fetchpriority }}" ... />
- Check your LCP score:
- Go to Online Store → Themes in your Shopify admin and click View report
- Or run Google PageSpeed Insights (pagespeed.web.dev) on your product and collection pages
- A score below 75 on mobile often means the hero image needs
fetchpriority="high"or is too large
WooCommerce
WooCommerce serves images from your server without CDN or WebP conversion by default. Two steps are needed:
Step 1: Add WebP conversion (pick one):
- Imagify (free tier: 25 MB/month): Install from WordPress.org, go to Media → Imagify, run the bulk optimization wizard — it converts all existing images to WebP and enables automatic conversion for new uploads
- ShortPixel (free tier: 100 credits/month): Similar workflow; installs as a plugin and converts on upload
Step 2: Add CDN delivery:
- Cloudflare (free): After adding your domain to Cloudflare, all images (and other assets) are served from Cloudflare's 300+ global edge locations automatically
- BunnyCDN ($1/TB): More control, better performance than free Cloudflare for high-traffic stores; configure with the BunnyCDN WordPress plugin
Step 3: Configure lazy loading (WordPress 5.5+ handles this automatically):
WordPress adds loading="lazy" to all <img> tags automatically since version 5.5. Verify it's working:
- View source of a product page
- Confirm non-hero images have
loading="lazy"attribute - The hero/first product image should have
loading="eager"— configure this in your theme's template
Step 4: Set correct image dimensions in WooCommerce:
- Go to WooCommerce → Settings → Products → Display
- Set your image sizes to match your theme's actual rendered dimensions — oversized images waste bandwidth
- After changing sizes, use WP CLI or the Regenerate Thumbnails plugin to resize existing images:
wp media regenerate --only-missing
BigCommerce
BigCommerce serves all images via its CDN with automatic WebP conversion for supported browsers. Optimize your theme tem
Установить image-optimization-cdn в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
claude-codecursorgemini-clicopilotcodex-clikiroopencodeВложенные файлы
FAQ
Что делает скилл image-optimization-cdn?
Speed up your store by automatically resizing and converting product images to WebP/AVIF, adding lazy loading, and serving via CDN
Как установить скилл image-optimization-cdn?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл image-optimization-cdn запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic