webp-format
它能做什么
这个技能检查网站提供图片的方式,并建议使用带备用方案的 WebP。它面向希望页面更轻的网站所有者和开发者。
适用场景
- ✓网站提供的大型 JPEG 或 PNG 图片,改用 WebP 可以更小的时候。
- ✓添加图片时没有为旧浏览器提供备用方案的时候。
- ✓性能审计指出页面顶部的图片过重的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/webp-format/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我网站上的照片是较大的 JPEG。请帮我改为 WebP,并让它们在旧浏览器中也能正常显示吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会把图片转换为 WebP,并用提供备用方案的 picture 元素包裹它们。然后浏览器会选择它支持的第一种格式。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Use WebP format with fallbacks
WebP is smaller than JPEG and PNG at similar quality—using it reduces page weight by 25-35% for images, improving load times on all devices.
Quick Reference
- WebP provides 25-35% better compression than JPEG/PNG
- 97%+ browser support—nearly universal
- Use picture element for older browser fallbacks
- Supports transparency (like PNG) and animation (like GIF)
Check
Check if images are served in modern formats like WebP with fallbacks for older browsers.
Fix
Convert images to WebP format and implement proper fallback strategies.
Explain
Explain how WebP provides 25-35% better compression than JPEG and PNG.
Code Review
Review image assets, markup, and delivery configuration related to Use WebP format with fallbacks. 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/webp-format
常见问题
WebP 能小多少?
这个技能说,在相近画质下,WebP 通常比 JPEG 或 PNG 小 25% 到 35%。
WebP 支持透明吗?
支持。这个技能说,它支持像 PNG 一样的透明,以及像 GIF 一样的动画。
为什么要使用 picture 元素?
它为旧浏览器提供一个它们能读取格式的备用图片。
详情
作者的原始描述
Use when reviewing image assets, markup, and CDN or build transforms related to Use WebP format with fallbacks. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.
热度
- GitHub 星标
- 75k
- 排名
- #3086
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。