core-web-vitals by kostja94/marketing-skills
npx skills add https://github.com/kostja94/marketing-skills --skill core-web-vitals指导优化核心网页指标(CWV)——谷歌影响搜索排名的用户体验指标。CWV 是已确认影响移动端和桌面端排名的因素。
调用时机:在首次使用时,如果合适,可以用 1-2 句话开场,说明此技能涵盖的内容及其重要性,然后提供主要输出。在后续使用或用户要求跳过时,直接进入主要输出。
| 指标 | 目标 | 良好 | 需要改进 | 差 |
|---|---|---|---|---|
| LCP | ≤2.5s | ≤2.5s | 2.5–4.0s | >4.0s |
| INP | ≤200ms | ≤200ms | 200–500ms | >500ms |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| <0.1 |
| ≤0.1 |
| 0.1–0.25 |
| >0.25 |
来源:Google 页面体验
首先检查项目上下文:如果存在 .claude/project-context.md 或 .cursor/project-context.md,请读取其中的网站 URL。
识别:
LCP 衡量最大内容元素(图片、视频或文本块)可见所需的时间。
| 原因 | 修复方法 |
|---|---|
| 服务器响应慢 | 减少 TTFB;使用 CDN;优化服务器 |
| 渲染阻塞资源 | 延迟加载非关键 CSS/JS;内联关键 CSS |
| 图片过大 | 使用 WebP/AVIF;压缩;设置 width/height 以防止 CLS;参见 image-optimization |
| 客户端渲染 | 对首屏内容使用 SSR/SSG;参见 rendering-strategies |
| 第三方脚本 | 异步加载;延迟加载非关键脚本 |
LCP 候选元素:首页大图、大段文本块、视频封面。确保首屏图片使用 loading="eager"(默认);切勿对 LCP 候选元素使用延迟加载。
INP 衡量响应性——从用户交互到下一次绘制的时间。于 2024 年 3 月取代 FID。
| 原因 | 修复方法 |
|---|---|
| 长时间运行的 JS | 拆分超过 50ms 的任务;使用 requestIdleCallback;使用 Web Workers |
| 繁重的事件处理器 | 防抖/节流;延迟非关键工作 |
| 主线程阻塞 | 减少第三方脚本;延迟加载非关键 JS |
| 布局抖动 | 批量处理 DOM 读取/写入;避免强制重排 |
CLS 衡量意外的布局偏移。
| 原因 | 修复方法 |
|---|---|
| 图片无尺寸 | 始终设置 width 和 height 属性 |
| 动态内容 | 为广告、嵌入内容预留空间;使用 min-height |
| 网络字体 | 使用 font-display: optional 或 swap;预加载关键字体 |
| 动画 | 使用 transform 替代 top/left/width |
预留空间:对于图片、广告、嵌入内容——在加载前定义尺寸。避免在没有预留空间的情况下,在现有内容上方插入新内容。
| 工具 | 用途 |
|---|---|
| GSC | 核心网页指标报告;URL 分组;真实环境数据 |
| PageSpeed Insights | 实验室数据 + 真实环境数据;移动端 + 桌面端 |
| Chrome DevTools | 性能面板;LCP 元素;布局偏移覆盖层 |
每周安装量
128
仓库
GitHub 星标数
239
首次出现
14 天前
安全审计
安装于
cursor119
gemini-cli118
codex118
kimi-cli118
github-copilot118
opencode118
Guides optimization of Core Web Vitals (CWV)—Google's user experience metrics that affect search ranking. CWV are confirmed ranking factors for mobile and desktop.
When invoking : On first use , if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.
| Metric | Target | Good | Needs Improvement | Poor |
|---|---|---|---|---|
| LCP | ≤2.5s | ≤2.5s | 2.5–4.0s | >4.0s |
| INP | ≤200ms | ≤200ms | 200–500ms | >500ms |
| CLS | <0.1 | ≤0.1 | 0.1–0.25 | >0.25 |
Source : Google Page Experience
Check for project context first: If .claude/project-context.md or .cursor/project-context.md exists, read it for site URL.
Identify:
LCP measures the time until the largest content element (image, video, or text block) is visible.
| Cause | Fix |
|---|---|
| Slow server response | Reduce TTFB; use CDN; optimize server |
| Render-blocking resources | Defer non-critical CSS/JS; inline critical CSS |
| Large images | WebP/AVIF; compress; width/height to prevent CLS; see image-optimization |
| Client-side rendering | SSR/SSG for above-fold content; see rendering-strategies |
| Third-party scripts | Load async; defer non-critical |
LCP candidates : Hero image, large text block, video poster. Ensure above-fold images use loading="eager" (default); never lazy-load LCP.
INP measures responsiveness—time from user interaction to next paint. Replaced FID in March 2024.
| Cause | Fix |
|---|---|
| Long-running JS | Break tasks >50ms; use requestIdleCallback; Web Workers |
| Heavy event handlers | Debounce/throttle; defer non-critical work |
| Main thread blocking | Reduce third-party scripts; defer non-critical JS |
| Layout thrashing | Batch DOM reads/writes; avoid forced reflows |
CLS measures unexpected layout shifts.
| Cause | Fix |
|---|---|
| Images without dimensions | Always set width and height attributes |
| Dynamic content | Reserve space for ads, embeds; use min-height |
| Web fonts | font-display: optional or swap; preload critical fonts |
| Animations | Use transform instead of top// |
Reserve space : For images, ads, embeds—define dimensions before load. Avoid inserting content above existing content without reserved space.
| Tool | Use |
|---|---|
| GSC | Core Web Vitals report; URL grouping; field data |
| PageSpeed Insights | Lab + field data; mobile + desktop |
| Chrome DevTools | Performance panel; LCP element; layout shift overlay |
Weekly Installs
128
Repository
GitHub Stars
239
First Seen
14 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
cursor119
gemini-cli118
codex118
kimi-cli118
github-copilot118
opencode118
Schema标记专家指南:结构化数据实现与SEO优化,提升富媒体搜索结果
30,900 周安装
Nansen CLI 钱包管理工具:安全创建、发送加密货币,支持 EVM 和 Solana 链
124 周安装
Google Cloud Platform专家指南:GCP服务、云原生架构与gcloud CLI实战教程
124 周安装
DeepSeek API 使用指南:聊天、推理与代码生成,OpenAI 经济替代方案
124 周安装
AI文本人性化工具 - 消除AI写作痕迹,让内容更自然真实 | Humanize
124 周安装
Bash防御性编程模式:生产级Shell脚本错误处理与安全最佳实践指南
124 周安装
比特币底部判断模型:6大链上指标精准抄底,避免接飞刀
124 周安装
leftwidth