seo-core-web-vitals
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseseo-core-web-vitals (M15)
seo-core-web-vitals (M15)
Core Web Vitals are a confirmed Google ranking signal and a proxy for page quality. Thresholds, field-vs-lab honesty rules, and LCP decomposition: (follow it exactly).
references/cwv-thresholds.mdCore Web Vitals 是 Google 已确认的排名信号,也是衡量页面质量的代理指标。阈值、field 与 lab 之间的诚实性规则以及 LCP 分解:(严格遵循)。
references/cwv-thresholds.mdInputs
输入
Work from the PageSnapshot named in your dispatch envelope: read from (, , ) plus , , and — field data still needs the PSI tier; Grep for verbatim evidence; site artifacts live in . Deterministic findings already emitted by are listed in — do not re-emit those ids; add model-judged findings only. If invoked directly with a URL/path and no snapshot exists, first run and use the printed snapshot path.
parsed<run_dir>/pages/<slug>.jsonscripts[]stylesheets[]images[]timing.ttfb_msbody.bytesrenderpages/<slug>.html<run_dir>/site/{robots.json,sitemaps.json,discovery.json}audit.mjs<run_dir>/findings.deterministic.jsonnode "${CLAUDE_PLUGIN_ROOT}/scripts/snapshot.mjs" <target> --out "${CLAUDE_PLUGIN_DATA}/runs"以 dispatch envelope 中指定的 PageSnapshot 为基础:从 读取 (、、),以及 、 和 ——field 数据仍需使用 PSI tier;在 中使用 Grep 查找逐字证据;站点工件位于 。 已输出的确定性发现列于 ——不要重复输出这些 id;仅添加模型判断型发现。如果直接使用 URL 或路径调用且不存在 snapshot,请先运行 ,并使用输出的 snapshot 路径。
<run_dir>/pages/<slug>.jsonparsedscripts[]stylesheets[]images[]timing.ttfb_msbody.bytesrenderpages/<slug>.html<run_dir>/site/{robots.json,sitemaps.json,discovery.json}audit.mjs<run_dir>/findings.deterministic.jsonnode "${CLAUDE_PLUGIN_ROOT}/scripts/snapshot.mjs" <target> --out "${CLAUDE_PLUGIN_DATA}/runs"Audits
审计
Working from the PageSnapshot ( when is not , else ):
parsed_renderedrender.usednoneparsed- Field CWV at p75 — LCP ≤ 2.5 s, INP ≤ 200 ms (INP replaced FID), CLS ≤ 0.1, all at the 75th percentile of real-user data. All three must pass for a "good" rating. Use the proactive-warning thresholds (LCP > 2.0 s, INP > 160 ms, CLS > 0.08) to before failing.
warn - Render-blocking resources — synchronous in
<script>(no<head>/defer/async), blockingtype=module, and<link rel="stylesheet">chains that delay first render (LCP/INP risk).@import - Unoptimized images — missing /
width(orheight), noaspect-ratiobelow the fold, no responsiveloading="lazy"/srcset, legacy formats where AVIF/WebP would serve, and a non-preloaded LCP image.sizes - Layout-shift sources — images/iframes/ads/embeds without reserved dimensions, web-font swap without /size-adjust, and content injected above existing content (CLS risk).
font-display - LCP decomposition — attribute LCP to TTFB vs resource load delay vs load duration vs render delay (see ) so each finding targets the dominant subpart.
references/cwv-thresholds.md
根据 PageSnapshot 开展审计(当 不为 时使用 ,否则使用 ):
render.usednoneparsed_renderedparsed- p75 处的 Field CWV——LCP ≤ 2.5 s、INP ≤ 200 ms(INP 已取代 FID)、CLS ≤ 0.1,三者均须达到真实用户数据的第 75 百分位。三项全部通过才可评为“良好”。达到主动预警阈值(LCP > 2.0 s、INP > 160 ms、CLS > 0.08)时,先标记 ,再判定为失败。
warn - 阻塞渲染的资源——位于 中的同步
<head>(没有<script>/defer/async)、阻塞式type=module,以及延迟首次渲染的<link rel="stylesheet">链(LCP/INP 风险)。@import - 未优化的图片——缺少 /
width(或height)、首屏以下未设置aspect-ratio、缺少响应式loading="lazy"/srcset、本可提供 AVIF/WebP 时却使用旧格式,以及 LCP 图片未预加载。sizes - 布局偏移来源——未预留尺寸的图片/iframe/广告/嵌入内容、缺少 /
font-display的 web-font swap,以及插入到现有内容上方的内容(CLS 风险)。size-adjust - LCP 分解——将 LCP 归因于 TTFB、资源加载延迟、加载耗时或渲染延迟(参见 ),确保每项发现都针对主要问题环节。
references/cwv-thresholds.md
Fixes (fixable: advisory)
修复(可修复:仅建议)
Advisory only. Performance fixes touch build config, server, CDN, and runtime JavaScript — high breakage risk — so the tool diagnoses and prioritizes but never auto-edits performance code. For each failing metric, name the specific resource/element causing it and rank fixes by expected leverage (e.g. preload the LCP image, defer non-critical JS, reserve image dimensions). Give framework-specific direction where the stack is known. Never fabricate measured values — if field data is absent, ask the user to supply a PSI/CrUX key or leave a clearly-marked TODO placeholder rather than guessing a metric.
**仅提供建议。**性能修复会涉及构建配置、服务器、CDN 和运行时 JavaScript——破坏现有实现的风险较高——因此该工具只负责诊断和确定优先级,绝不自动修改性能代码。对于每个未通过的指标,指出导致问题的具体资源或元素,并按预期收益对修复方案排序(例如,预加载 LCP 图片、延迟加载非关键 JS、预留图片尺寸)。如果已知技术栈,应提供针对具体框架的指导。绝不要编造测量值——如果缺少 field 数据,应要求用户提供 PSI/CrUX key,或留下明确标记的 TODO 占位符,而不是猜测指标。
Verification
验证
- Field (Tier 1): calls the PageSpeed Insights API (
node "${CLAUDE_PLUGIN_ROOT}/scripts/psi-client.mjs" --url <final_url> [--strategy mobile|desktop] [--timeout 60000], methodloadingExperience). It takes a URL only — there is nopsi_apimode, because field data is measured on the live origin, not on a saved DOM. The key comes from the environment (--snapshot, elseCLAUDE_PLUGIN_OPTION_PSI_API_KEY); there is deliberately noPSI_API_KEYflag. Without a key the script returns--keyat exit 0 — branch onstatus: "needs_api", never on the exit code. When PSI setsstatus, the numbers are origin-level and the finding must say so. CrUX History (origin_fallback) is not implemented by the bundled client (crux_api): never claim a p75 trend from this tool.references/cwv-thresholds.md - Tier 0 (no key): emit for every field-CWV finding, plus clearly-labeled lab heuristics (render-blocking count, missing image dimensions, bundle weight). Label lab signals "lab data — not what Google ranks on"; never present a heuristic as a measured field value.
status: needs_api - When the required data tier is unavailable, status is — never a false
needs_api.pass
- Field(Tier 1):调用 PageSpeed Insights API(
node "${CLAUDE_PLUGIN_ROOT}/scripts/psi-client.mjs" --url <final_url> [--strategy mobile|desktop] [--timeout 60000],method 为loadingExperience)。它只接受 URL——不存在psi_api模式,因为 field 数据是在实时源站上测得,而不是在保存的 DOM 上。key 来自环境变量(--snapshot,否则为CLAUDE_PLUGIN_OPTION_PSI_API_KEY);特意不提供PSI_API_KEYflag。没有 key 时,脚本会返回--key且退出码为 0——应根据status: "needs_api"分支处理,绝不能依据退出码。当 PSI 设置status时,数值属于源站级别,对应发现必须明确说明这一点。随附客户端未实现 CrUX History(origin_fallback)(crux_api):绝不能声称此工具能够提供 p75 趋势。references/cwv-thresholds.md - Tier 0(无 key):为每个 field-CWV 发现输出 ,并补充带有明确标签的 lab 启发式结果(阻塞渲染数量、缺失的图片尺寸、bundle 权重)。将 lab 信号标记为“lab data — not what Google ranks on”(lab 数据——并非 Google 用于排名的数据);绝不能将启发式结果呈现为已测得的 field 值。
status: needs_api - 当所需的数据 tier 不可用时,状态为 ——绝不能标为虚假的
needs_api。pass
Findings
发现
Emit findings per . Severity policy: 5 is reserved for catastrophic, eligibility-killing facts at site/template scope; 4 major · 3 moderate · 2 minor · 1 cosmetic · 0 informational — and only an severity-5 in an active category can cap a score (). Field CWV never reaches 5: it is a tie-breaker, not an eligibility gate. Examples:
schema/finding.schema.jsonestablishedfailreferences/scoring-model.md- — field LCP > 2.5 s at p75 (status
M15.lcp.exceeds_p75, severity 4,fail, axisfixable: advisory, confidencesearch).establishedquotes the measured p75 value and the LCP element;evidence.observedruns the psi-client command.verification.reproduce - — image with no
M15.cls.unsized_image/widthshifting layout (statusheight, severity 4,warn, axisfixable: advisory, confidencesearch).directionalquotes theevidence.observedtag.<img> - — no PSI/CrUX key, field CWV unverifiable (status
M15.field.needs_api, severity 4,needs_api, axisfixable: advisory, confidencesearch). Each finding:establishedquotes the page/measurement;evidence.observedis the runnable command;verification.reproduceis banded + confidence-tagged (no naked %).expected_impact
按 输出发现。严重性策略:5 专用于站点或模板范围内灾难性且会导致失去资格的事实;4(major)· 3(moderate)· 2(minor)· 1(cosmetic)· 0(informational)——只有当前生效类别中状态为 、severity 为 5 且结果为 的发现才能对评分封顶()。Field CWV 的 severity 永远不会达到 5:它只是辅助决胜信号,而不是资格门槛。示例:
schema/finding.schema.jsonestablishedfailreferences/scoring-model.md- ——field LCP 在 p75 处 > 2.5 s(status
M15.lcp.exceeds_p75、severity 4、fail、axisfixable: advisory、confidencesearch)。established引用测得的 p75 值和 LCP 元素;evidence.observed给出运行 psi-client 的命令。verification.reproduce - ——缺少
M15.cls.unsized_image/width且导致布局偏移的图片(statusheight、severity 4、warn、axisfixable: advisory、confidencesearch)。directional引用对应的evidence.observed标签。<img> - ——没有 PSI/CrUX key,无法验证 field CWV(status
M15.field.needs_api、severity 4、needs_api、axisfixable: advisory、confidencesearch)。 每项发现:established引用页面或测量结果;evidence.observed给出可运行的命令;verification.reproduce使用分段区间并附带 confidence 标签(不得给出无依据的百分比)。expected_impact
Honesty
诚实性
- Lab ≠ field. A single local Lighthouse run is diagnostic only; Google ranks on field (CrUX) p75. Never let a lab number drive the Search score or masquerade as a field result.
- CWV is a real but modest tie-breaker signal — it does not override relevance/content quality. Don't promise ranking jumps from a green score; report it as banded , not a predicted percentage gain.
expected_impact - A "100" lab performance score is not a pass if field p75 fails; only field data settles a CWV finding.
- **Lab ≠ field。**单次本地 Lighthouse 运行仅用于诊断;Google 的排名依据是 field(CrUX)p75。绝不能让 lab 数值影响 Search 评分,也不要将其冒充为 field 结果。
- CWV 确实是一个真实但作用有限的决胜信号——不能凌驾于相关性和内容质量之上。不要承诺评分变绿就会带来排名跃升;应将其作为带区间的 报告,而不是预测百分比提升。
expected_impact - 如果 field p75 未通过,lab 性能评分为“100”也不代表通过;只有 field 数据能够最终判定 CWV 发现。