critical-images
它能做什么
这项技能检查访客最先看到的图片是否以高优先级加载。适合希望可见内容加载更快、改善 Core Web Vitals 评分的开发者。
适用场景
- ✓当页面上最大的图片加载缓慢时。
- ✓当位于顶部可见的主视觉图被标记为懒加载时。
- ✓当页面的主图没有被预加载时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/critical-images/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请让我首页的主视觉图优先加载,因为它是访客最先看到的最大内容。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会为首屏可见的主图添加高获取优先级,在页面 head 中预加载主视觉图,并去掉开头可见图片的懒加载设置。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Prioritize loading critical images
The Largest Contentful Paint (LCP) is often an image—prioritizing its load can improve LCP by 20-40%, directly impacting Core Web Vitals and SEO.
Quick Reference
- Use fetchpriority='high' on LCP images
- Preload hero images in document head
- Remove loading='lazy' from above-the-fold images
- Critical images directly impact LCP Core Web Vital
Check
Identify which images are critical for initial render and ensure they load with high priority.
Fix
Add fetchpriority='high' to critical images and use preload for hero images.
Explain
Explain how prioritizing critical images improves Largest Contentful Paint (LCP).
Code Review
Review image assets, markup, and delivery configuration related to Prioritize loading critical images. 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/critical-images
常见问题
什么是 LCP?
最大内容绘制(Largest Contentful Paint),用于衡量页面上最大的可见元素何时出现的速度指标,它通常是一张图片。
首屏图片应该懒加载吗?
不应该。这项技能建议去掉它们的懒加载。
这能带来多大的帮助?
这项技能说明,优先加载 LCP 图片可以使 LCP 提升 20% 到 40%。
详情
作者的原始描述
Use when reviewing image assets, markup, and CDN or build transforms related to Prioritize loading critical images. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.
热度
- GitHub 星标
- 75k
- 排名
- #2789
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。