largest-contentful-paint
它能做什么
这个技能检查页面中最大的可见元素出现的速度。它面向希望页面更快呈现可用状态的开发者。
适用场景
- ✓你的首图或标题出现得很慢的时候。
- ✓你的页面在 Largest Contentful Paint 指标上得分较低的时候。
- ✓你的服务器发送首个页面响应很慢的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/largest-contentful-paint/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为什么我页面上的主图出现得这么慢?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会测量最大元素出现的时间,并找出造成延迟的原因,例如图片加载慢或服务器响应慢。它会建议预加载关键资源、优化图片并使用 CDN。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Optimize largest contentful paint
LCP is the most important Core Web Vital for perceived load speed—it measures when the main content becomes visible, directly impacting user perception and SEO rankings.
Quick Reference
- LCP measures when the largest element renders—target under 2.5s
- Use preload for hero images and critical resources
- Optimize image formats and use responsive sizes
- Reduce server response time (TTFB)
Check
Measure LCP using Lighthouse or PageSpeed Insights. Verify the largest visible element renders within 2.5 seconds.
Fix
Optimize LCP by preloading critical resources, optimizing images, using CDN, and reducing server response time.
Explain
Explain how LCP measures perceived load speed by tracking when the largest visible content element becomes visible.
Code Review
Review the routes, assets, and loading behavior that affect Optimize largest contentful paint. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/performance/largest-contentful-paint
常见问题
这个技能建议的目标是什么?
它建议主要内容在约 2.5 秒内出现。
什么是 TTFB?
它是服务器发送页面第一个字节所需的时间,这个技能建议减少它。
如何测量?
这个技能建议使用 Lighthouse 或 PageSpeed Insights。
详情
作者的原始描述
Use when auditing slow page loads, heavy assets, or rendering delays related to Optimize largest contentful paint. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.
热度
- GitHub 星标
- 75k
- 排名
- #2914
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。