Back to list
secondsky

image-optimization

by secondsky

Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations

21🍴 0📅 Jan 24, 2026

SKILL.md


name: image-optimization description: Optimizes images for web performance using modern formats, responsive techniques, and lazy loading strategies. Use when improving page load times, implementing responsive images, or preparing assets for production deployment. license: MIT

Image Optimization

Optimize images for web performance with modern formats and responsive techniques.

Format Selection

FormatBest ForCompression
JPEGPhotosLossy, 50-70% reduction
PNGIcons, transparencyLossless, 10-30%
WebPModern browsers25-35% better than JPEG
AVIFNext-gen50% better than JPEG
SVGLogos, iconsVector, scalable

Responsive Images

<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img
    src="image.jpg"
    srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
    sizes="(max-width: 600px) 100vw, 50vw"
    alt="Description"
    loading="lazy"
    decoding="async"
  >
</picture>

Lazy Loading

<!-- Native lazy loading -->
<img src="image.jpg" loading="lazy" alt="Description">

<!-- With blur placeholder -->
<img
  src="placeholder-blur.jpg"
  data-src="image.jpg"
  class="lazy"
  alt="Description"
>

Build Pipeline (Sharp)

const sharp = require('sharp');

async function optimizeImage(input, output) {
  await sharp(input)
    .resize(1200, null, { withoutEnlargement: true })
    .webp({ quality: 80 })
    .toFile(output);
}

Performance Targets

Asset TypeTarget Size
Hero image<200KB
Thumbnail<30KB
Total images<500KB

Optimization Checklist

  • Use WebP with JPEG fallback
  • Implement responsive srcset
  • Enable lazy loading for below-fold
  • Compress at quality 70-85
  • Serve from CDN
  • Set proper cache headers

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon