modern-format
できること
このスキルは、古い形式の画像を見つけ、より小さいファイルになる WebP や AVIF を提案します。ページを速く、データ量を少なくしたいウェブ制作者向けです。
使う場面
- ✓サイトの画像を速く読み込めるようにしてほしいとき。
- ✓写真やグラフィックの容量が大きく、ページが遅いとき。
- ✓サイト用の画像を準備していて、古いブラウザ向けの代替表示を付けた新しい形式を使いたいとき。
スキルのリンク
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/modern-format/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のウェブサイトの画像の読み込みが遅いです。最新の形式に変換して、コードも更新してもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、img タグと背景画像の中の JPEG と PNG を探します。WebP や、任意で AVIF のバージョンを作る手伝いをし、古いブラウザでも表示されるように、画像を picture 要素で囲み、代替表示を付けます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Use modern image formats (WebP, AVIF)
Images are typically 50%+ of page weight. Switching from JPEG to WebP alone reduces transfer sizes by 25-35% with no visible quality change, directly improving Largest Contentful Paint (LCP) and saving bandwidth for users on mobile data plans. These savings compound across every visitor and every image on the site.
Quick Reference
- WebP is ~25-35% smaller than JPEG at equivalent quality (per web.dev)
- AVIF is ~40-50% smaller than JPEG at equivalent quality (per web.dev)
- Use
<picture>with<source type="image/avif">and<source type="image/webp">plus an<img>fallback - WebP has 97%+ global browser support; AVIF is supported in all modern browsers as of 2023
Check
Scan all <img> elements and CSS background-image declarations in this codebase. Identify: 1) Any <img src> pointing to .jpg, .jpeg, or .png files (not served via a CDN that auto-negotiates format). 2) Any <picture> elements that lack <source type="image/webp"> or <source type="image/avif"> entries. 3) Any CSS background images using JPEG or PNG when a WebP equivalent could be used. Report each finding with file path and line number.
Fix
For each image not using modern formats: 1) Convert to WebP at 80% quality using Squoosh or Sharp. 2) Optionally also generate AVIF at 60% quality for browsers that support it. 3) Wrap the original <img> in a <picture> element and add <source type="image/avif"> and <source type="image/webp"> entries with the new files. 4) Keep the original JPEG/PNG as the <img src> fallback. For CSS background images, use a @supports (background-image: url('.webp')) { } query to serve WebP to supporting browsers.
Explain
Explain the compression advantages of WebP and AVIF over JPEG and PNG. According to web.dev, WebP lossless images are 26% smaller than PNG and WebP lossy images are 25-35% smaller than JPEG at equivalent visual quality. AVIF offers further improvements: roughly 40-50% smaller than equivalent JPEG. Explain browser support: WebP has 97%+ global browser support as of 2024. AVIF is supported in Chrome 85+, Firefox 93+, and Safari 16.4+. The <picture> element with fallbacks means there is no risk in adopting these formats today.
Code Review
Review image assets, markup, and delivery configuration related to Use modern image formats (WebP, AVIF). Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/images/modern-format
よくある質問
WebP の画像は本当に小さいのですか?
このスキルは、同程度の品質で WebP は JPEG よりおおよそ25〜35パーセント小さく、AVIF はさらに小さくできると説明しています。
古いブラウザでも画像は表示されますか?
はい。picture 要素は img を代替表示として使うため、新しい形式に対応していないブラウザでも画像が表示されます。
読み込み速度に影響しますか?
小さい画像は Largest Contentful Paint を改善し、データ量を減らすことがあるとこのスキルは説明しています。
詳細
作者による元の説明
Use when reviewing image assets, markup, and CDN or build transforms related to Use modern image formats (WebP, AVIF). Check encoded size, rendered size, loading strategy, and above-the-fold impact together.
人気
- GitHubのスター
- 75k
- ランキング
- #2944
- ライセンス
- MIT
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
frontendchecklist
75kコマンドラインツールを使って、フロントエンドのコードとライブページを、アクセシビリティ、速度、SEO、セキュリティに関する380以上のルールと照らし合わせて確認します。
frontend-checklist-global
75kフロントエンドのプロジェクトを、386のFront-End Checklistのルールすべてと照らし合わせて監査し、見つかった問題ごとに具体的な修正方法を示します。
404-page
75k見つからないページの画面に役立つリンクがあり、本物の404ステータスを返すかを確認し、迷った訪問者が目的のページを見つけられるようにします。
about-page
75kサイトの運営者が誰かを説明する、分かりやすいAboutページがあるかを確認し、訪問者と検索エンジンからの信頼を高めます。