From 4e12435773992bf6c23a00848a922538de81797f Mon Sep 17 00:00:00 2001 From: yoreva-01 <195282707+yoreva-01@users.noreply.github.com> Date: Sun, 18 Oct 2026 17:02:55 +0300 Subject: [PATCH 1/3] docs: add captured Core Web Vitals examples --- .../skills/webperf-core-web-vitals/SKILL.md | 3 +- .../references/examples.json | 170 +++++++++++++++ .../references/snippets.md | 202 ++++++++++++++++++ cli/tests/fixtures/README.md | 1 + .../core-web-vitals-interactions.json | 5 + cli/tests/fixtures/core-web-vitals.html | 32 +++ components/Snippet.jsx | 11 +- components/Snippet.test.jsx | 13 ++ content/CoreWebVitals/CLS.mdx | 3 +- content/CoreWebVitals/INP.mdx | 3 +- content/CoreWebVitals/LCP-Image-Entropy.mdx | 3 +- content/CoreWebVitals/LCP-Subparts.mdx | 3 +- content/CoreWebVitals/LCP-Trail.mdx | 3 +- content/CoreWebVitals/LCP-Video-Candidate.mdx | 3 +- content/CoreWebVitals/LCP.mdx | 3 +- .../webperf-core-web-vitals/SKILL.md | 3 +- .../references/examples.json | 170 +++++++++++++++ .../references/snippets.md | 202 ++++++++++++++++++ package.json | 1 + scripts/capture-snippet-examples.mjs | 76 +++++++ scripts/generate-skills.js | 21 ++ skills/webperf-core-web-vitals/SKILL.md | 3 +- .../references/examples.json | 170 +++++++++++++++ .../references/snippets.md | 202 ++++++++++++++++++ styles/globals.css | 20 ++ 25 files changed, 1315 insertions(+), 11 deletions(-) create mode 100644 .claude/skills/webperf-core-web-vitals/references/examples.json create mode 100644 cli/tests/fixtures/core-web-vitals-interactions.json create mode 100644 cli/tests/fixtures/core-web-vitals.html create mode 100644 dist/antigravity/webperf-core-web-vitals/references/examples.json create mode 100644 scripts/capture-snippet-examples.mjs create mode 100644 skills/webperf-core-web-vitals/references/examples.json diff --git a/.claude/skills/webperf-core-web-vitals/SKILL.md b/.claude/skills/webperf-core-web-vitals/SKILL.md index 434f9cad..9beba17a 100644 --- a/.claude/skills/webperf-core-web-vitals/SKILL.md +++ b/.claude/skills/webperf-core-web-vitals/SKILL.md @@ -241,4 +241,5 @@ When multiple CWV metrics are poor, prioritize investigation: ## References - `references/snippets.md` — Descriptions and thresholds for each script -- `references/schema.md` — Return value schema for interpreting script output \ No newline at end of file +- `references/schema.md` — Return value schema for interpreting script output +- `references/examples.json` — Captured return values used in the snippet pages \ No newline at end of file diff --git a/.claude/skills/webperf-core-web-vitals/references/examples.json b/.claude/skills/webperf-core-web-vitals/references/examples.json new file mode 100644 index 00000000..71cd7cc1 --- /dev/null +++ b/.claude/skills/webperf-core-web-vitals/references/examples.json @@ -0,0 +1,170 @@ +{ + "fixture": "cli/tests/fixtures/core-web-vitals.html", + "viewport": "desktop", + "waitMs": 1000, + "examples": { + "CLS": { + "script": "CLS", + "status": "ok", + "metric": "CLS", + "value": 0, + "unit": "score", + "rating": "good", + "thresholds": { + "good": 0.1, + "needsImprovement": 0.25 + }, + "message": "CLS tracking active. Call getCLS() for updated value after page interactions.", + "getDataFn": "getCLS" + }, + "INP": { + "script": "INP", + "status": "ok", + "metric": "INP", + "value": 16, + "unit": "ms", + "rating": "good", + "thresholds": { + "good": 200, + "needsImprovement": 500 + }, + "details": { + "totalInteractions": 1, + "worstEvent": "click → button#interaction-button", + "phases": { + "inputDelay": 1, + "processingTime": 1, + "presentationDelay": 15 + } + } + }, + "LCP": { + "script": "LCP", + "status": "ok", + "metric": "LCP", + "value": 84, + "unit": "ms", + "rating": "good", + "thresholds": { + "good": 2500, + "needsImprovement": 4000 + }, + "details": { + "element": "#main-heading", + "elementType": "Text block", + "url": null, + "sizePixels": 24624 + } + }, + "LCP-Image-Entropy": { + "script": "LCP-Image-Entropy", + "status": "ok", + "count": 1, + "details": { + "totalImages": 1, + "lowEntropyCount": 0, + "lcpElement": "h1", + "lcpImageEligible": null, + "lcpImage": null + }, + "items": [ + { + "url": "hero.png", + "width": 100, + "height": 100, + "displayedWidth": 320, + "displayedHeight": 320, + "fileSizeBytes": 30173, + "bpp": 24.1384, + "isLowEntropy": false, + "lcpEligible": true, + "isLCP": false + } + ], + "issues": [ + { + "severity": "info", + "message": "The LCP element is

, text and not an image, so its entropy does not apply. Run the LCP snippet to measure it." + } + ] + }, + "LCP-Subparts": { + "script": "LCP-Subparts", + "status": "ok", + "metric": "LCP", + "value": 84, + "unit": "ms", + "rating": "good", + "thresholds": { + "good": 2500, + "needsImprovement": 4000 + }, + "details": { + "element": "#main-heading", + "url": null, + "subParts": { + "ttfb": { + "value": 6, + "percent": 7, + "overTarget": false + }, + "resourceLoadDelay": { + "value": 0, + "percent": 0, + "overTarget": false + }, + "resourceLoadTime": { + "value": 0, + "percent": 0, + "overTarget": false + }, + "elementRenderDelay": { + "value": 78, + "percent": 93, + "overTarget": true + } + }, + "slowestPhase": "elementRenderDelay" + } + }, + "LCP-Trail": { + "script": "LCP-Trail", + "status": "ok", + "metric": "LCP", + "value": 108, + "unit": "ms", + "rating": "good", + "thresholds": { + "good": 2500, + "needsImprovement": 4000 + }, + "details": { + "candidateCount": 1, + "finalElement": "#main-heading", + "candidates": [ + { + "index": 1, + "selector": "#main-heading", + "time": 108, + "elementType": "Text block" + } + ] + } + }, + "LCP-Video-Candidate": { + "script": "LCP-Video-Candidate", + "status": "ok", + "details": { + "isVideo": false, + "lcpElement": "h1", + "lcpUrl": null + }, + "issues": [ + { + "severity": "info", + "message": "The LCP element is

, not a