first-contentful-paint
它能做什么
这项技能检查页面向访客首次显示内容的速度。适用于希望页面在首次加载时就显得很快的开发者。
适用场景
- ✓当访客在任何内容出现前长时间看到空白页面的时候。
- ✓当你的页面在 First Contentful Paint 上得分较低的时候。
- ✓当脚本或样式阻碍了网站首屏显示的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/first-contentful-paint/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为什么我的页面要等很久才显示出任何内容?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查阻塞渲染的样式和脚本、缓慢的服务器响应以及第三方连接。它会建议移除阻碍因素、内联关键 CSS,并对外部网站使用 preconnect。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Optimize first contentful paint
FCP is the first visual signal that a page is loading—fast FCP reassures users that the site is responding, reducing perceived wait time and bounce rates.
Quick Reference
- FCP measures time until first text/image appears—target under 1.8s
- Eliminate render-blocking CSS and JavaScript
- Inline critical CSS for above-fold content
- Use preconnect for third-party origins
Check
Measure FCP using Lighthouse or PageSpeed Insights. Verify first content appears within 1.8 seconds.
Fix
Optimize FCP by eliminating render-blocking resources, inlining critical CSS, and reducing server response time.
Explain
Explain how FCP measures the time until the first text or image is painted, indicating page load has begun.
Code Review
Review the routes, assets, and loading behavior that affect Optimize first 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/first-contentful-paint
常见问题
什么是 First Contentful Paint?
它是页面上首次出现文字或图片所需的时间。
这项技能提到的目标是什么?
它提到的目标是低于 1.8 秒。
什么是 preconnect?
它是一个 HTML 提示,可以提前与外部网站建立连接,使其文件更快加载。
详情
作者的原始描述
Use when auditing slow page loads, heavy assets, or rendering delays related to Optimize first contentful paint. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.
热度
- GitHub 星标
- 75k
- 排名
- #2846
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。