webperf-interaction
Skill1.5k starsChanged 8 months agoMITView on GitHub
Intelligent interaction performance analysis with automated workflows for INP debugging, scroll jank investigation, and main thread blocking. Includes decision trees that automatically run script attribution when long frames detected, break down input latency phases, and correlate layout shifts with interactions. Features workflows for complete interaction audit, third-party script impact analysis, and animation performance debugging. Cross-skill integration with Core Web Vitals (INP/CLS correlation) and Loading (script execution analysis). Use when the user asks about slow interactions, janky scrolling, unresponsive pages, or INP optimization. Compatible with Chrome DevTools MCP.
- Installs packages
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 14 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Run the script with mcp__chrome-devtools__evaluate_script and read the object it returns.
- Very specific: line 20
When status is "tracking", the script keeps observing the page.
- Very specific: line 21
When status is "error" or "unsupported", read error: the page may not have loaded yet, or the browser lacks the API.
- Distinctive: line 43
When the user asks for interaction analysis or "audit responsiveness":
- Distinctive: line 53
When INP is slow (>200ms) or the user asks "debug INP" or "slow interactions":
- Distinctive: line 63
When the user reports "scroll jank", "choppy scrolling", or "scroll performance issues":
- Very specific: line 67
Layout-Shift-Loading-and-Interaction.js: - Check for layout shifts during scroll
- Distinctive: line 72
When the page feels unresponsive or the user asks "why is the page frozen":
- Distinctive: line 83
When the user reports "things move when I click" or CLS issues during interaction:
- Distinctive: line 93
When animations feel sluggish or the user asks "debug animation performance":
- Very specific: line 98
Scroll-Performance.js: - If scroll animations are involved
- Very specific: line 99
DOM-Size-and-Depth.js: - Check whether a large or deep DOM makes each style and layout pass expensive
- Distinctive: line 103
When interactions are slow and third-party scripts are suspected:
- Distinctive: line 114
Use this decision tree to automatically run follow-up snippets based on results:
- Distinctive: line 207
No automatic follow-up, use data to inform next steps
- Distinctive: line 211
Use these thresholds to automatically trigger follow-up analysis:
- Distinctive: line 237
When multiple interaction metrics are poor:
- Distinctive: line 242
Consider code splitting or Web Workers
- Distinctive: line 247
Check for dynamic content insertion
- Very specific: line 250
Run Long-Animation-Frames-Script-Attribution.js during scroll
- Distinctive: line 251
Check for non-passive scroll listeners
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
WebPerf: Interaction & Animation
JavaScript snippets for measuring web performance in Chrome DevTools.
Running a script
- Run the script with
mcp__chrome-devtools__evaluate_scriptand read the object it returns. The scripts have no console output, so the returned object is the result:script,statusand the metric data (value,rating,details,items,issues), as described inreferences/schema.md. - When
statusis"tracking", the script keeps observing the page. After the interactions, call the function named ingetDataFnwith anothermcp__chrome-devtools__evaluate_scriptcall, for examplegetINP(), and read the object it returns. - When
statusis"error"or"unsupported", readerror: the page may not have loaded yet, or the browser lacks the API.
Without Chrome DevTools MCP, run the same snippet with the webperf-snippets CLI, which loads the page in headless Chromium and prints the same result objects: npx webperf-snippets <url> --snippet <Name> --json, where <Name> is the script name without .js. It needs Playwright and Chromium (npm install --save-dev webperf-snippets playwright, then npx playwright install chromium), and tracking snippets take --interact-script <file> to drive the interactions.
Scripts
scripts/DOM-Size-and-Depth.js— DOM size and depthscripts/Forced-Synchronous-Layout.js— Forced synchronous layout detectorscripts/Input-Latency-Breakdown.js— Input latency breakdownscripts/Interactions.js— Interactionsscripts/Layout-Shift-Loading-and-Interaction.js— Layout shift trackingscripts/Long-Animation-Frames-Helpers.js— LoAF helpersscripts/Long-Animation-Frames-Script-Attribution.js— Long animation frames script attributionscripts/Long-Animation-Frames.js— Long animation frames (LoAF)scripts/LongTask.js— Long tasksscripts/Scroll-Performance.js— Scroll performance analysis
Common Workflows
Complete Interaction Performance Audit
When the user asks for interaction analysis or "audit responsiveness":
- Interactions.js - List all user interactions with timing
- Input-Latency-Breakdown.js - Break down interaction phases
- Long-Animation-Frames.js - Detect blocking animation frames
- LongTask.js - Identify long tasks blocking the main thread
- Scroll-Performance.js - Measure scroll smoothness
INP Deep Dive
When INP is slow (>200ms) or the user asks "debug INP" or "slow interactions":
- Interactions.js - Identify which interactions are slow
- Input-Latency-Breakdown.js - Break down into input delay, processing time, presentation delay
- Long-Animation-Frames.js - Find animation frames >50ms that block interactions
- Long-Animation-Frames-Script-Attribution.js - Identify scripts causing the blocking
- Long-Animation-Frames-Helpers.js - Get detailed timing and attribution helpers
Scroll Jank Investigation
When the user reports "scroll jank", "choppy scrolling", or "scroll performance issues":
- Scroll-Performance.js - Measure scroll smoothness and frame drops
- Long-Animation-Frames.js - Detect frames causing jank (>50ms)
- Layout-Shift-Loading-and-Interaction.js - Check for layout shifts during scroll
- Long-Animation-Frames-Script-Attribution.js - Find scripts running during scroll
Main Thread Blocking Analysis
When the page feels unresponsive or the user asks "why is the page frozen":
- LongTask.js - List all tasks >50ms blocking the main thread
- Long-Animation-Frames.js - Correlate with animation frame timing
- Long-Animation-Frames-Script-Attribution.js - Attribute blocking to specific scripts
- Cross-reference with webperf-loading skill:
- JS-Execution-Time-Breakdown.js (script parsing/execution time)
- First-And-Third-Party-Script-Info.js (identify third-party blockers)
Layout Shift During Interaction
When the user reports "things move when I click" or CLS issues during interaction:
- Layout-Shift-Loading-and-Interaction.js - Separate loading vs interaction shifts
- Interactions.js - Correlate shifts with specific interactions
- CLS.js (from Core Web Vitals skill) - Measure total CLS
- Cross-reference with webperf-media skill:
- Image-Element-Audit.js (images without dimensions causing shifts)
Animation Performance Analysis
When animations feel sluggish or the user asks "debug animation performance":
- Long-Animation-Frames.js - Identify frames taking too long to render
- Long-Animation-Frames-Helpers.js - Detailed frame timing analysis
- Long-Animation-Frames-Script-Attribution.js - Find scripts delaying frames
- Scroll-Performance.js - If scroll animations are involved
- DOM-Size-and-Depth.js - Check whether a large or deep DOM makes each style and layout pass expensive
Third-Party Script Impact on Interactions
When interactions are slow and third-party scripts are suspected:
- Long-Animation-Frames-Script-Attribution.js - Identify third-party scripts in long frames
- LongTask.js - Measure long task frequency
- Cross-reference with webperf-loading skill:
- First-And-Third-Party-Script-Info.js (list all third-party scripts)
- First-And-Third-Party-Script-Timings.js (measure script loading impact)
- Script-Loading.js (check for blocking scripts)
Decision Tree
Use this decision tree to automatically run follow-up snippets based on results:
After Interactions.js
- If any interaction > 200ms → Run Input-Latency-Breakdown.js on slow interactions; also run webperf-core-web-vitals:INP.js for official INP measurement
- If many interactions > 200ms → Main thread congestion, run:
- Long-Animation-Frames.js (blocking frames)
- LongTask.js (long tasks)
- Long-Animation-Frames-Script-Attribution.js (culprit scripts)
- If specific interaction types are slow (e.g., click vs keyboard) → Focus on that interaction type
- If interactions occur during page load → Cross-check with webperf-loading:JS-Execution-Time-Breakdown.js
After Input-Latency-Breakdown.js
- If Input Delay > 50ms → Main thread was busy, run:
- Long-Animation-Frames.js (what was blocking)
- LongTask.js (long task before interaction)
- If Processing Time > 100ms → Heavy event handlers, run:
- Long-Animation-Frames-Script-Attribution.js (which scripts)
- webperf-loading:First-And-Third-Party-Script-Info.js (third-party involvement)
- If Presentation Delay > 50ms → Rendering bottleneck, run:
- Long-Animation-Frames.js (frame rendering time)
- Layout-Shift-Loading-and-Interaction.js (check for layout work)
After Long-Animation-Frames.js
- If many frames > 50ms → Run Long-Animation-Frames-Script-Attribution.js to identify causes
- If frames > 100ms → Critical blocking, run:
- Long-Animation-Frames-Script-Attribution.js (detailed attribution)
- LongTask.js (related long tasks)
- webperf-loading:JS-Execution-Time-Breakdown.js (script execution cost)
- If frames occur during scroll → Run Scroll-Performance.js to measure impact
- If frames occur during page load → Cross-check with webperf-loading:Event-Processing-Time.js
After Long-Animation-Frames-Script-Attribution.js
- If third-party scripts are causing long frames → Run:
- webperf-loading:First-And-Third-Party-Script-Info.js (list all third-party scripts)
- webperf-loading:Script-Loading.js (check loading strategy)
- Recommend deferring or removing problematic scripts
- If first-party scripts are causing long frames → Recommend:
- Code splitting
- Debouncing/throttling event handlers
- Web Workers for heavy computation
- If forced reflow/layout detected → Analyze DOM manipulation patterns
- If time goes to style recalculation or layout → Run DOM-Size-and-Depth.js to check the size of the tree
After LongTask.js
- If many long tasks (>5) → Main thread is congested, run:
- Long-Animation-Frames-Script-Attribution.js (detailed attribution)
- webperf-loading:JS-Execution-Time-Breakdown.js (script execution analysis)
- webperf-loading:First-And-Third-Party-Script-Info.js (identify heavy scripts)
- If long tasks > 500ms → Critical blocking, investigate:
- Synchronous third-party scripts
- Heavy computation without Web Workers
- Excessive DOM manipulation
- If long tasks correlate with interactions → Run Interactions.js to see impact
After DOM-Size-and-Depth.js
- If total elements > 1400 → Recommend virtualizing long lists and loading off-screen content on demand
- If depth > 32 → Recommend flattening wrapper elements added by components
- If a single parent has > 60 children → Recommend pagination or virtualization for that container
- If the DOM is within limits but interactions are still slow → Run Long-Animation-Frames-Script-Attribution.js to find the scripts responsible
After Scroll-Performance.js
- If scroll FPS < 30 → Severe jank, run:
- Long-Animation-Frames.js (blocking frames during scroll)
- Long-Animation-Frames-Script-Attribution.js (scripts running on scroll)
- Layout-Shift-Loading-and-Interaction.js (layout work during scroll)
- If scroll FPS 30-50 → Noticeable jank, investigate:
- Scroll event handlers
- Passive event listeners
- CSS will-change properties
- If scroll FPS > 50 → Good, but check for layout shifts during scroll
After Layout-Shift-Loading-and-Interaction.js
- If shifts occur during page load → Cross-reference with webperf-core-web-vitals:CLS.js
- If shifts occur during interaction → This impacts INP and UX, investigate:
- Dynamic content insertion
- Images/ads loading without dimensions
- Font swaps (run webperf-loading:Fonts-Preloaded-Loaded-and-used-above-the-fold.js)
- If shifts occur during scroll → Run Scroll-Performance.js to measure impact
After Long-Animation-Frames-Helpers.js
This is a utility snippet, use results to:
- Understand frame timing in detail
- Identify precise script attribution
- Measure style/layout/paint phases
- No automatic follow-up, use data to inform next steps
Performance Budget Thresholds
Use these thresholds to automatically trigger follow-up analysis:
INP Thresholds:
- Good: ≤ 200ms → Monitor, no action needed
- Needs Improvement: 200-500ms → Run Input-Latency-Breakdown.js
- Poor: > 500ms → Run full INP debugging workflow (5 snippets)
Long Animation Frames:
- Warning: > 50ms → Run Long-Animation-Frames-Script-Attribution.js
- Critical: > 100ms → Run full main thread blocking workflow
Long Tasks:
- Warning: > 50ms → Monitor frequency
- Critical: > 200ms or >5 tasks per second → Run attribution and script analysis
Scroll Performance:
- Good: ≥ 50 FPS → Monitor
- Needs Improvement: 30-50 FPS → Run Long-Animation-Frames.js
- Poor: < 30 FPS → Run full scroll jank workflow
Interaction Frequency:
- If >10 interactions/second → User is actively interacting, prioritize INP optimization
- If <1 interaction/5 seconds → Interactions are rare, focus on first interaction responsiveness
Multi-Metric Correlation
When multiple interaction metrics are poor:
- If Long Tasks AND Long Animation Frames both detected → Shared root cause:
- Run Long-Animation-Frames-Script-Attribution.js
- Likely heavy JavaScript execution
- Consider code splitting or Web Workers
- If INP slow AND CLS high → Interaction-triggered layout shifts:
- Run Layout-Shift-Loading-and-Interaction.js
- Correlate shift timing with interaction timing
- Check for dynamic content insertion
- If Scroll jank AND Long Animation Frames → Scroll handlers blocking main thread:
- Run Long-Animation-Frames-Script-Attribution.js during scroll
- Check for non-passive scroll listeners
- Audit scroll-triggered animations
References
references/snippets.md— Descriptions and thresholds for each scriptreferences/schema.md— Return value schema for interpreting script output
Trending
More talk lately.about the whole repository
Who's talking about nucliweb/webperf-snippets
- A Hacker News story“Web Performance Snippets”Hacker News · May 27, 2023 · 3 points
- @nucliweb.net“📣 New webperf-snippet to measure the click interactions on the page. …”Bluesky · May 26, 2023 · 3 likes
- A Hacker News story“Web Performance Snippets”Hacker News · May 28, 2023 · 2 points
- @nucliweb.net“📣 New webperf-snippet "Largest Contentful Paint Sub-Parts" …”Bluesky · May 24, 2023 · 1 likes
- @nucliweb.net“Get your <head> in order, a new web perf snipped, by Rick Viscomi, to use in the Chrome Dev Tools How you …”Bluesky · May 22, 2023 · 1 likes
The biggest 5 of 24 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 24
Talked about on GitHub, Bluesky and Hacker News (24 times).
On GitHub · 19
- Oct 30, 2026claude-code-marketplaces.github.nucliweb.webperf-snippets: 2.4.1 → 2.4.2 — sudosubin/agents.nix0 reactions
- Oct 30, 2026agent-skills.github.nucliweb.webperf-snippets: 2.4.0 → 2.4.1 — sudosubin/agents.nix0 reactions
- Oct 29, 2026claude-code-plugins.github.nucliweb.webperf-snippets: 2.4.0 → 2.4.1 — sudosubin/agents.nix0 reactions
- Oct 29, 2026claude-code-marketplaces.github.nucliweb.webperf-snippets: 2.4.0 → 2.4.1 — sudosubin/agents.nix0 reactions
- Oct 29, 2026claude-code-plugins.github.nucliweb.webperf-snippets: 2.3.0 → 2.4.0 — sudosubin/agents.nix0 reactions
14 more on GitHub
- Oct 29, 2026claude-code-marketplaces.github.nucliweb.webperf-snippets: 2.3.0 → 2.4.0 — sudosubin/agents.nix0 reactions
- Oct 29, 2026agent-skills.github.nucliweb.webperf-snippets: 2.3.0 → 2.4.0 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-plugins.github.nucliweb.webperf-snippets: init at 2.3.0 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-marketplaces.github.nucliweb.webperf-snippets: init at 2.3.0 — sudosubin/agents.nix0 reactions
- Oct 27, 2026agent-skills.github.nucliweb.webperf-snippets: 2.1.0 → 2.3.0 — sudosubin/agents.nix0 reactions
- Oct 25, 2026agent-skills.github.nucliweb.webperf-snippets: 2.0.1 → 2.1.0 — sudosubin/agents.nix0 reactions
- Oct 20, 2026[Candidate] nucliweb/webperf-snippets/skills/webperf - webperf — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 20, 2026[Candidate] nucliweb/webperf-snippets/.claude/skills/webperf-core-web-vitals - webperf-core-web-vitals — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 20, 2026[Candidate] nucliweb/webperf-snippets/.claude/skills/webperf - webperf — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 16, 2026agent-skills.github.nucliweb.webperf-snippets: 1.3.0 → 2.0.1 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.nucliweb.webperf-snippets: 1.2.0 → 1.3.0 — sudosubin/agents.nix0 reactions
- Sep 30, 2026agent-skills.github.nucliweb.webperf-snippets: init at 1.2.0 — sudosubin/agents.nix0 reactions
- Apr 12, 2024Improve TTFB snippet — corewebvitals/pagespeed0 reactions
- Dec 7, 2022feat: add other author snippets — push-based/awesome-web-performance-snippets0 reactions
On Bluesky · 3
- May 26, 2023📣 New webperf-snippet to measure the click interactions on the page. https://github.com/nucliweb/webperf-snippets#interactions Thank you… — @nucliweb.net3 likes and reposts
- May 24, 2023📣 New webperf-snippet "Largest Contentful Paint Sub-Parts" https://github.com/nucliweb/webperf-snippets#largest-contentful-paint-sub-parts-… — @nucliweb.net1 likes and repost
- May 22, 2023Get your <head> in order, a new web perf snipped, by Rick Viscomi, to use in the Chrome Dev Tools How you order elements can have an effect… — @nucliweb.net1 likes and repost
On Hacker News · 2
- May 27, 2023Web Performance Snippets3 points
- May 28, 2023Web Performance Snippets2 points
In this repository14 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- public/llms-full.txtllms.txt
- public/llms.txtllms.txt
- webperf-core-web-vitalsSkill
- webperf-interactionSkill
- webperf-loadingSkill
- webperf-mediaSkill
- webperf-resourcesSkill
- webperfSkill
- webperf-core-web-vitalsSkill
- webperf-loadingSkill
- webperf-mediaSkill
- webperf-resourcesSkill
- webperfSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

