Skip to content

Commit f62ebc0

Browse files
committed
feat: add Cache-Strategy-Analysis snippet and sync skill assets
- Add Cache-Strategy-Analysis snippet to webperf-loading - Add Forced-Synchronous-Layout to interaction skill assets - Rename LCP-Sub-Parts β†’ LCP-Subparts for consistency across all locations - Update skill references (schema, snippets, SKILL.md) for webperf-loading and webperf-interaction - Refactor Interactions.js to remove verbose inline implementation - Sync dist/, skills/, and .claude/skills/ with latest snippet changes - Update llms-full.txt and llms.txt with new snippets
1 parent 4728f69 commit f62ebc0

118 files changed

Lines changed: 1362 additions & 914 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Ž.claude/skills/webperf-core-web-vitals/SKILL.mdβ€Ž

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ context: fork
55
license: MIT
66
metadata:
77
author: Joan Leon | @nucliweb
8-
version: 1.1.0
8+
version: 1.2.0
99
mcp-server: chrome-devtools
1010
category: web-performance
1111
repository: https://github.com/nucliweb/webperf-snippets
@@ -20,7 +20,7 @@ JavaScript snippets for measuring web performance in Chrome DevTools. Execute wi
2020
- `scripts/CLS.js` β€” Cumulative Layout Shift (CLS)
2121
- `scripts/INP.js` β€” Interaction to Next Paint (INP)
2222
- `scripts/LCP-Image-Entropy.js` β€” LCP Image Entropy
23-
- `scripts/LCP-Sub-Parts.js` β€” LCP Sub-Parts
23+
- `scripts/LCP-Subparts.js` β€” LCP Subparts
2424
- `scripts/LCP-Trail.js` β€” LCP Trail
2525
- `scripts/LCP-Video-Candidate.js` β€” LCP Video Candidate
2626
- `scripts/LCP.js` β€” Largest Contentful Paint (LCP)
@@ -35,15 +35,15 @@ When the user asks for a comprehensive Core Web Vitals analysis or "audit CWV":
3535
1. **LCP.js** - Measure Largest Contentful Paint
3636
2. **CLS.js** - Measure Cumulative Layout Shift
3737
3. **INP.js** - Measure Interaction to Next Paint
38-
4. **LCP-Sub-Parts.js** - Break down LCP timing phases
38+
4. **LCP-Subparts.js** - Break down LCP timing phases
3939
5. **LCP-Trail.js** - Track LCP candidate evolution
4040

4141
### LCP Deep Dive
4242

4343
When LCP is slow or the user asks "debug LCP" or "why is LCP slow":
4444

4545
1. **LCP.js** - Establish baseline LCP value
46-
2. **LCP-Sub-Parts.js** - Break down into TTFB, resource load, render delay
46+
2. **LCP-Subparts.js** - Break down into TTFB, resource load, render delay
4747
3. **LCP-Trail.js** - Identify all LCP candidates and changes
4848
4. **LCP-Image-Entropy.js** - Check if LCP image has visual complexity issues
4949
5. **LCP-Video-Candidate.js** - Detect if LCP is a video (poster or video element)
@@ -74,7 +74,7 @@ When LCP is a video element (detected by LCP-Video-Candidate.js):
7474

7575
1. **LCP-Video-Candidate.js** - Identify video as LCP candidate
7676
2. **Video-Element-Audit.js** (from Media skill) - Audit video loading strategy
77-
3. **LCP-Sub-Parts.js** - Analyze video loading phases
77+
3. **LCP-Subparts.js** - Analyze video loading phases
7878
4. Cross-reference with **webperf-loading** skill:
7979
- Resource-Hints-Validation.js (check for video preload)
8080
- Priority-Hints-Audit.js (check for fetchpriority on video)
@@ -84,7 +84,7 @@ When LCP is a video element (detected by LCP-Video-Candidate.js):
8484
When LCP is an image (most common case):
8585

8686
1. **LCP.js** - Measure LCP timing
87-
2. **LCP-Sub-Parts.js** - Break down timing phases
87+
2. **LCP-Subparts.js** - Break down timing phases
8888
3. **LCP-Image-Entropy.js** - Analyze image complexity
8989
4. Cross-reference with **webperf-media** skill:
9090
- Image-Element-Audit.js (check format, dimensions, lazy loading)
@@ -99,13 +99,13 @@ Use this decision tree to automatically run follow-up snippets based on results:
9999

100100
### After LCP.js
101101

102-
- **If LCP > 2.5s** β†’ Run **LCP-Sub-Parts.js** to diagnose which phase is slow
102+
- **If LCP > 2.5s** β†’ Run **LCP-Subparts.js** to diagnose which phase is slow
103103
- **If LCP > 4.0s (poor)** β†’ Run full LCP deep dive workflow (5 snippets)
104104
- **If LCP candidate is an image** β†’ Run **LCP-Image-Entropy.js** and **webperf-media:Image-Element-Audit.js**
105105
- **If LCP candidate is a video** β†’ Run **LCP-Video-Candidate.js** and **webperf-media:Video-Element-Audit.js**
106106
- **Always run** β†’ **LCP-Trail.js** to understand candidate evolution
107107

108-
### After LCP-Sub-Parts.js
108+
### After LCP-Subparts.js
109109

110110
- **If TTFB phase > 600ms** β†’ Switch to **webperf-loading** skill and run TTFB-Sub-Parts.js
111111
- **If Resource Load Time > 1500ms** β†’ Run:
@@ -140,7 +140,7 @@ Use this decision tree to automatically run follow-up snippets based on results:
140140
- **If video is LCP** β†’ Run:
141141
1. **webperf-media:Video-Element-Audit.js** (check poster, preload, formats)
142142
2. **webperf-loading:Priority-Hints-Audit.js** (check fetchpriority on poster)
143-
3. **LCP-Sub-Parts.js** (analyze video loading phases)
143+
3. **LCP-Subparts.js** (analyze video loading phases)
144144
- **If poster image is LCP** β†’ Treat as image LCP (run image workflows)
145145

146146
### After CLS.js
@@ -169,7 +169,7 @@ Use this decision tree to automatically run follow-up snippets based on results:
169169
- **If any script returns `status: "error"`** β†’ Check if the page has finished loading:
170170
- If early in load: wait and re-run the script
171171
- If page is an SPA: user may need to navigate to the target route first
172-
- **If LCP.js / LCP-Sub-Parts.js returns `status: "error"`** β†’ Tell the user: "LCP data is not available yet. Please ensure the page has fully loaded, then run the analysis again."
172+
- **If LCP.js / LCP-Subparts.js returns `status: "error"`** β†’ Tell the user: "LCP data is not available yet. Please ensure the page has fully loaded, then run the analysis again."
173173
- **If INP.js `getINP()` returns `status: "error"`** β†’ The `getDataFn: "getINP"` field signals the agent can retry after user interaction. Prompt the user to click, type, or scroll, then call `getINP()` again.
174174

175175
### Cross-Skill Triggers

β€Ž.claude/skills/webperf-core-web-vitals/references/schema.mdβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Scripts using `PerformanceObserver` with `buffered: true` can read the same data
125125
})();
126126
```
127127
128-
**Scripts using this pattern:** LCP, CLS, LCP-Sub-Parts, LCP-Trail, LCP-Image-Entropy, Event-Processing-Time, Long-Animation-Frames (buffered LoAFs), LongTask (buffered tasks).
128+
**Scripts using this pattern:** LCP, CLS, LCP-Subparts, LCP-Trail, LCP-Image-Entropy, Event-Processing-Time, Long-Animation-Frames (buffered LoAFs), LongTask (buffered tasks).
129129
130130
### Pattern 3: Tracking observers
131131
@@ -238,10 +238,10 @@ If no interactions yet, `getINP()` returns `status: "error"` with `getDataFn: "g
238238
]
239239
```
240240
241-
#### LCP-Sub-Parts
241+
#### LCP-Subparts
242242
```json
243243
{
244-
"script": "LCP-Sub-Parts",
244+
"script": "LCP-Subparts",
245245
"status": "ok",
246246
"metric": "LCP",
247247
"value": 2100,

β€Ž.claude/skills/webperf-core-web-vitals/references/snippets.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ Checks if images qualify as LCP candidates based on their entropy (bits per pixe
4040
| < 0.05 | πŸ”΄ Low | ❌ No | Solid colors, simple gradients, placeholders |
4141
| β‰₯ 0.05 | 🟒 Normal | βœ… Yes | Photos, complex graphics |
4242
---
43-
## LCP Sub-Parts
43+
## LCP Subparts
4444

4545
Breaks down Largest Contentful Paint into its four phases to identify optimization opportunities. Understanding which phase is slowest helps you focus your optimization efforts where they'll have the most impact. Based on the Web Vitals Chrome Extension.
4646

47-
**Script:** `scripts/LCP-Sub-Parts.js`
47+
**Script:** `scripts/LCP-Subparts.js`
4848
---
4949
## LCP Trail
5050

β€Ž.claude/skills/webperf-core-web-vitals/scripts/CLS.jsβ€Ž

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ž.claude/skills/webperf-core-web-vitals/scripts/LCP-Sub-Parts.jsβ€Ž

Lines changed: 0 additions & 2 deletions
This file was deleted.

β€Ž.claude/skills/webperf-core-web-vitals/scripts/LCP-Subparts.jsβ€Ž

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)