如何讓 Claude 擔起重任修正 Core Web Vitals 問題
何時使用: PageSpeed 下滑,LCP 超過 2.5 秒,業務端在追問原因。
步驟
-
診斷Use the perf skill on https://mysite.com. Pull a CrUX report, run a Lighthouse trace, and identify the top 3 LCP and INP culprits.✓ 已複製→ 含檔案參照的排名問題清單,而非「最佳化圖片」這種籠統建議
-
修正For the top LCP culprit, apply the fix. For images, prefer fetchpriority + AVIF/WebP fallback. Show diff and rationale.✓ 已複製→ 程式碼變更 + 預期的前後指標對比
-
驗證Re-run Lighthouse locally. Compare to previous run.✓ 已複製→ 數字改善;若無,假設有誤——返回步驟 1
結果: 可測量的 LCP/INP 改善,並留有完整記錄。
注意事項
- Claude 過度積極地建議大規模框架重寫 — Skill 包含「最小可行變更」規則——若 Agent 偏離,貼回這條規則