core-web-vitals
1
总安装量
1
周安装量
#45589
全站排名
安装命令
npx skills add https://github.com/kimny1143/claude-code-template --skill core-web-vitals
Agent 安装分布
mcpjam
1
claude-code
1
replit
1
junie
1
windsurf
1
zencoder
1
Skill 文档
Core Web Vitals è¨æ¸¬ã»è¨ºæ
ããã©ã¼ãã³ã¹è¨æ¸¬ã¨åé¡è¨ºæã«ç¹åãæé©åãã¿ã¼ã³ã¯ vercel-react-best-practices ãåç
§ã
ç®æ¨å¤
| ææ¨ | Good | Needs Improvement | Poor |
|---|---|---|---|
| LCP (Largest Contentful Paint) | < 2.5s | 2.5s – 4.0s | > 4.0s |
| INP (Interaction to Next Paint) | < 200ms | 200ms – 500ms | > 500ms |
| CLS (Cumulative Layout Shift) | < 0.1 | 0.1 – 0.25 | > 0.25 |
| FCP (First Contentful Paint) | < 1.8s | 1.8s – 3.0s | > 3.0s |
| TTFB (Time to First Byte) | < 800ms | 800ms – 1800ms | > 1800ms |
è¨æ¸¬ã³ãã³ã
Lighthouse CLI
# ãã¹ã¯ããã
npx lighthouse https://example.com --view --preset=desktop
# ã¢ãã¤ã«
npx lighthouse https://example.com --view --preset=perf --emulated-form-factor=mobile
# ã¢ã¯ã»ã·ããªãã£ã®ã¿
npx lighthouse http://localhost:3000 --only-categories=accessibility --view
# JSONåºåã§è©³ç´°ç¢ºèª
npx lighthouse http://localhost:3000 --output=json | jq '.audits["largest-contentful-paint"]'
Bundle Analyzer
# Next.js
npm run build
npx @next/bundle-analyzer
# æ±ç¨
npx source-map-explorer 'dist/**/*.js'
Vercel Speed Insights
# Vercelããã·ã¥ãã¼ãã§ç¢ºèª
# Analytics > Speed Insights
åé¡å¥è¨ºæ
LCP ãé ã (> 2.5s)
åå ç¹å®:
npx lighthouse URL --output=json | jq '.audits["largest-contentful-paint-element"]'
主ãªåå ã¨å¯¾ç:
| åå | 対ç |
|---|---|
| ãã¼ãã¼ç»åãéã | next/image + priority + WebP |
| Webãã©ã³ãèªã¿è¾¼ã¿ | next/font + display: swap |
| ãµã¼ãã¼å¿çé ã | ãã£ãã·ã¥ãCDNãDBæé©å |
| render-blocking JS | åçã¤ã³ãã¼ããdefer |
INP ãé ã (> 200ms)
åå ç¹å®:
- Chrome DevTools > Performance > Interactions
主ãªåå ã¨å¯¾ç:
| åå | 対ç |
|---|---|
| éãã¤ãã³ããã³ãã© | useTransitionãWeb Worker |
| éå°ãªåã¬ã³ããªã³ã° | React DevTools Profilerç¢ºèª |
| é·ãJSã¿ã¹ã¯ | ã¿ã¹ã¯åå²ãrequestIdleCallback |
CLS ãé«ã (> 0.1)
åå ç¹å®:
npx lighthouse URL --output=json | jq '.audits["layout-shift-elements"]'
主ãªåå ã¨å¯¾ç:
| åå | 対ç |
|---|---|
| ç»åãµã¤ãºæªæå® | width / height å¿
é |
| åçã³ã³ãã³ãæ¿å ¥ | ã¹ã±ã«ãã³ã§é åç¢ºä¿ |
| Webãã©ã³ãåãæ¿ã | font-display: swap + fallback |
| åºå/åã込㿠| åºå®ãµã¤ãºã³ã³ãã |
FCP ãé ã (> 1.8s)
主ãªåå ã¨å¯¾ç:
| åå | 対ç |
|---|---|
| åæHTMLã大ãã | Server Componentsãã¹ããªã¼ãã³ã° |
| render-blocking CSS | Critical CSS inline |
| TTFB ãé ã | ãµã¼ãã¼æé©å |
ãã§ãã¯ãªã¹ã
è¨æ¸¬
- Lighthouse ã¢ãã¤ã«/ãã¹ã¯ããã両æ¹ç¢ºèª
- 宿©ã§ã確èªï¼ã¨ãã¥ã¬ã¼ã·ã§ã³ã¨å·®ç°ããï¼
- æ¬çªç°å¢ã§è¨æ¸¬ï¼éçºç°å¢ã¯åèå¤ï¼
ç£è¦
- Vercel Speed Insights è¨å®
- ã¢ã©ã¼ãé¾å¤è¨å®ï¼LCP > 3sçï¼
- 宿ã¬ãã¼ã確èª
é¢é£ã¹ãã«
- vercel-react-best-practices: æé©åãã¿ã¼ã³ï¼57ã«ã¼ã«ï¼
- ui-ux-pro-max: ã¢ã¯ã»ã·ããªãã£ï¼WCAG ã³ã³ãã©ã¹ãï¼