webperf-loading
Skill1.5k starsChanged 8 months agoMITView on GitHub
Intelligent loading performance analysis with automated workflows for TTFB investigation (DNS/connection/server breakdown), render-blocking detection, script performance deep dive (first vs third-party attribution), font optimization, and resource hints validation. Includes decision trees that automatically analyze TTFB sub-parts when slow, detect script loading anti-patterns (async/defer/preload conflicts), identify render-blocking resources, and validate resource hints usage. Features workflows for complete loading audit (6 phases), backend performance investigation, and priority optimization. Cross-skill integration with Core Web Vitals (LCP resource loading), Interaction (script execution blocking), and Media (lazy loading strategy). Use when the user asks about TTFB, FCP, render-blocking, slow loading, font performance, script optimization, or resource hints. Compatible with Chrome DevTools MCP.
- Installs packages
We split this skill into the rules it gives an agent
24 rules. About 0 are common, 8 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
16
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 67
When the user asks for a comprehensive loading analysis or "audit loading performance":
- Very specific: line 70
FCP.js: - Check initial render timing
- Very specific: line 74
Resource-Hints-Validation.js: - Check optimization hints
- Distinctive: line 78
When TTFB is slow or the user asks "why is my server slow":
- Very specific: line 82
Service-Worker-Analysis.js: - Check for SW overhead impacting TTFB
- Very specific: line 84
Server-Timing-Early-Hints.js: - Read backend phases from Server-Timing and check 103 Early Hints
- Distinctive: line 88
When the user asks about fonts, FOIT, FOUT, or font performance:
- Very specific: line 91
Resource-Hints-Validation.js: - Verify font preloads are correct
- Very specific: line 92
Find-render-blocking-resources.js: - Check if fonts block rendering
- Distinctive: line 97
When the user asks about compression, gzip, brotli, or large transfer sizes for text resources:
- Very specific: line 101
TTFB-Resources.js: - Check server response of the uncompressed resources
- Distinctive: line 105
When scripts are suspected to slow down the page:
- Distinctive: line 117
When the user wants to optimize resource loading priorities:
- Very specific: line 120
Resource-Hints-Validation.js: - Verify hints are actually used
- Very specific: line 121
Priority-Hints-Audit.js: - Check fetchpriority usage
- Distinctive: line 128
When CSS is bloated or blocking rendering:
- Very specific: line 130
Critical-CSS-Detection.js: - Check critical CSS strategy
- Very specific: line 137
When analyzing Next.js, Nuxt, Remix, or other SSR frameworks:
- Very specific: line 140
Script-Loading.js: - Check framework script loading patterns
- Very specific: line 142
Content-Visibility.js: - Check if content-visibility is used for optimization
- Distinctive: line 146
Use this decision tree to automatically run follow-up snippets based on results:
≈ “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: Loading Performance
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/Back-Forward-Cache.js— Back Forward Cachescripts/CSS-Media-Queries-Analysis.js— CSS media queries analysisscripts/Cache-Strategy-Analysis.js— Cache Strategy Analysisscripts/Client-Side-Redirect-Detection.js— Client Side Redirect Detectionscripts/Compression-Audit.js— Compression auditscripts/Content-Visibility.js— Content visibilityscripts/Critical-CSS-Detection.js— Critical CSS detectionscripts/Event-Processing-Time.js— Event processing timescripts/FCP.js— First contentful paint (FCP)scripts/Find-Above-The-Fold-Lazy-Loaded-Images.js— Find above the fold lazy loaded imagesscripts/Find-Images-With-Lazy-and-Fetchpriority.js— Find images with loading lazy and fetchpriorityscripts/Find-non-Lazy-Loaded-Images-outside-of-the-viewport.js— Find non lazy loaded images outside of the viewportscripts/Find-render-blocking-resources.js— Find render-blocking resourcesscripts/First-And-Third-Party-Script-Info.js— First And Third Party Script Infoscripts/First-And-Third-Party-Script-Timings.js— First and third party script timingsscripts/Fonts-Preloaded-Loaded-and-used-above-the-fold.js— Fonts preloaded, loaded, and used above the foldscripts/Inline-CSS-Info-and-Size.js— Inline CSS info and sizescripts/Inline-Script-Info-and-Size.js— Inline script info and sizescripts/JS-Execution-Time-Breakdown.js— JavaScript execution time breakdownscripts/Prefetch-Resource-Validation.js— Prefetch resource validationscripts/Priority-Hints-Audit.js— Priority hints auditscripts/Resource-Hints-Validation.js— Resource Hints Validationscripts/Resource-Hints.js— Resource hintsscripts/SSR-Hydration-Data-Analysis.js— SSR framework hydration data analysisscripts/Script-Loading.js— Scripts loadingscripts/Server-Timing-Early-Hints.js— Server-Timing and Early Hints viewerscripts/Service-Worker-Analysis.js— Service worker analysisscripts/Speculation-Rules-Inspector.js— Speculation rules inspectorscripts/TTFB-Resources.js— Time to first byte: Measure TTFB for all resourcesscripts/TTFB-Sub-Parts.js— Time to first byte: Measure TTFB sub-partsscripts/TTFB.js— Time to first byte: Measure the time to first bytescripts/Third-Party-Impact-by-Domain.js— Third-party impact by domainscripts/Validate-Preload-Async-Defer-Scripts.js— Validate Preload Async Defer Scriptsscripts/Webfont-Usage-Analyzer.js— Webfont usage analyzer
Common Workflows
Complete Loading Performance Audit
When the user asks for a comprehensive loading analysis or "audit loading performance":
- TTFB.js - Establish baseline server/network performance
- FCP.js - Check initial render timing
- Find-render-blocking-resources.js - Identify what's blocking rendering
- Critical-CSS-Detection.js - Validate CSS strategy
- Script-Loading.js - Audit script loading patterns
- Resource-Hints-Validation.js - Check optimization hints
Server/Backend Performance Investigation
When TTFB is slow or the user asks "why is my server slow":
- TTFB.js - Measure overall TTFB
- TTFB-Sub-Parts.js - Break down into DNS, connection, server time
- Service-Worker-Analysis.js - Check for SW overhead impacting TTFB
- TTFB-Resources.js - Identify slow third-party or API endpoints
- Server-Timing-Early-Hints.js - Read backend phases from
Server-Timingand check 103 Early Hints
Font Loading Optimization
When the user asks about fonts, FOIT, FOUT, or font performance:
- Fonts-Preloaded-Loaded-and-used-above-the-fold.js - Full font audit
- Resource-Hints-Validation.js - Verify font preloads are correct
- Find-render-blocking-resources.js - Check if fonts block rendering
- Webfont-Usage-Analyzer.js - Find font faces that are unused, never loaded, or use a blocking
font-display
Text Compression Audit
When the user asks about compression, gzip, brotli, or large transfer sizes for text resources:
- Compression-Audit.js - Find text resources served without compression and estimate savings
- Find-render-blocking-resources.js - Prioritize uncompressed CSS/JS that block rendering
- TTFB-Resources.js - Check server response of the uncompressed resources
Script Performance Deep Dive
When scripts are suspected to slow down the page:
- Script-Loading.js - Identify blocking scripts and loading strategy
- First-And-Third-Party-Script-Info.js - Separate first vs third-party impact
- Third-Party-Impact-by-Domain.js - Rank third-party domains by render-blocking, main-thread time and size
- First-And-Third-Party-Script-Timings.js - Diagnose slow script connections
- JS-Execution-Time-Breakdown.js - Network vs parse/execution time
- Inline-Script-Info-and-Size.js - Measure inline script overhead
- Validate-Preload-Async-Defer-Scripts.js - Find preload anti-patterns
Resource Hints & Priority Optimization
When the user wants to optimize resource loading priorities:
- Resource-Hints.js - Overview of all hints in use
- Resource-Hints-Validation.js - Verify hints are actually used
- Priority-Hints-Audit.js - Check fetchpriority usage
- Prefetch-Resource-Validation.js - Validate prefetch strategy
- Validate-Preload-Async-Defer-Scripts.js - Find conflicts
- Speculation-Rules-Inspector.js - Inspect prefetch/prerender rules and prerender activation
CSS Optimization Workflow
When CSS is bloated or blocking rendering:
- Critical-CSS-Detection.js - Check critical CSS strategy
- Inline-CSS-Info-and-Size.js - Measure inline CSS overhead
- CSS-Media-Queries-Analysis.js - Find unused responsive CSS
- Find-render-blocking-resources.js - Identify blocking stylesheets
SSR/Framework Performance
When analyzing Next.js, Nuxt, Remix, or other SSR frameworks:
- SSR-Hydration-Data-Analysis.js - Analyze hydration data size
- Script-Loading.js - Check framework script loading patterns
- JS-Execution-Time-Breakdown.js - Measure hydration execution cost
- Content-Visibility.js - Check if content-visibility is used for optimization
Decision Tree
Use this decision tree to automatically run follow-up snippets based on results:
After TTFB.js
- If TTFB > 600ms → Run TTFB-Sub-Parts.js to diagnose where time is spent
- If Service Worker detected → Run Service-Worker-Analysis.js to check for SW overhead
- If TTFB varies significantly across resources → Run TTFB-Resources.js
- If server time dominates TTFB-Sub-Parts.js → Run Server-Timing-Early-Hints.js to see which backend phase is slow
After Server-Timing-Early-Hints.js
- If no
Server-Timingmetrics found → Recommend addingServer-Timingheaders for database, cache and render phases - If cross-origin resources look hidden → Recommend
Timing-Allow-Originon those responses - If no 103 Early Hints received and server time is high → Recommend Early Hints for the main stylesheet and LCP image
After FCP.js
- If FCP > 1.8s → Run:
- Find-render-blocking-resources.js (CSS/JS blocking)
- Critical-CSS-Detection.js (CSS strategy)
- Script-Loading.js (blocking scripts)
- If FCP is good but user complains about perceived slowness → Check LCP with webperf-core-web-vitals skill
After Find-render-blocking-resources.js
- If blocking stylesheets found → Run Critical-CSS-Detection.js
- If blocking scripts found → Run:
- Script-Loading.js (loading strategy)
- Validate-Preload-Async-Defer-Scripts.js (check for anti-patterns)
- If fonts blocking → Run Fonts-Preloaded-Loaded-and-used-above-the-fold.js
After Script-Loading.js
- If many blocking/parser-blocking scripts → Run:
- JS-Execution-Time-Breakdown.js (measure execution cost)
- First-And-Third-Party-Script-Info.js (identify third-party culprits)
- If third-party scripts detected → Run First-And-Third-Party-Script-Timings.js
- If large inline scripts → Run Inline-Script-Info-and-Size.js
After Resource-Hints-Validation.js
- If unused preloads found → Recommend removing them
- If missing preloads for critical resources → Run:
- Fonts-Preloaded-Loaded-and-used-above-the-fold.js (fonts)
- Priority-Hints-Audit.js (LCP candidate)
- If preloads on async/defer scripts → Run Validate-Preload-Async-Defer-Scripts.js
After Compression-Audit.js
- If uncompressed CSS/JS found → Run Find-render-blocking-resources.js to see if they block rendering
- If estimated savings > 100KB → Recommend enabling gzip or brotli on the server or CDN
- If corsLimitedAnalysis is true → Report the result as a lower bound and suggest
Timing-Allow-Originon resources you control
After Third-Party-Impact-by-Domain.js
- If a domain is render-blocking → Recommend
async,defer, lazy loading or self-hosting; run Script-Loading.js for the loading strategy - If a domain's main-thread time > 250ms → Run Long-Animation-Frames-Script-Attribution.js (webperf-interaction) to find the functions responsible, and recommend delaying or removing the script
- If many domains with few requests each → Recommend auditing tags and removing unused ones
- If corsLimitedAnalysis is true → Report sizes as a lower bound; use First-And-Third-Party-Script-Timings.js for timings of the hidden resources
After Service-Worker-Analysis.js
- If SW overhead > 100ms → Recommend Navigation Preload API
- If SW caching many resources → Run TTFB-Resources.js to verify cache hits
- If SW not detected but site is SPA/PWA → Recommend implementing SW
After Fonts-Preloaded-Loaded-and-used-above-the-fold.js
- If fonts preloaded but not used above-the-fold → Recommend removing preloads
- If fonts used but not preloaded → Recommend adding preload
- If many font variants loaded → Suggest subsetting or reducing variants, and run Webfont-Usage-Analyzer.js to find the unused ones
After Webfont-Usage-Analyzer.js
- If fonts loaded but not used → Recommend removing the
@font-facedeclaration or the preload - If faces use
font-display: autoorblock→ Recommendswaporoptional, then check Find-render-blocking-resources.js - If font bytes are high → Suggest subsetting with
unicode-rangeand WOFF2 - If the LCP element is text → Run LCP.js with the webperf-core-web-vitals skill
After First-And-Third-Party-Script-Info.js
- If many third-party scripts (>5) → Run:
- First-And-Third-Party-Script-Timings.js (detailed timing)
- JS-Execution-Time-Breakdown.js (execution impact)
- If third-party scripts are slow → Recommend async/defer or removal
After SSR-Hydration-Data-Analysis.js
- If hydration data > 100KB → Recommend optimization strategies
- If multiple hydration scripts → Investigate framework configuration
- If large inline hydration data → Consider streaming or chunking
After Priority-Hints-Audit.js
- If LCP candidate lacks fetchpriority="high" → Recommend adding it
- If conflicting priorities (preload + low) → Recommend resolving conflict
- If fetchpriority on non-critical resources → Review priority strategy
After Prefetch-Resource-Validation.js
- If >10 prefetch hints → Recommend reducing to critical resources
- If individual prefetch > 500KB → Question necessity
- If total prefetch > 2MB → Flag as mobile bandwidth concern
- If few or no prefetch hints for likely next navigations → Run Speculation-Rules-Inspector.js to check for prefetch/prerender rules
After Speculation-Rules-Inspector.js
- If no speculation rules found but the site has predictable navigations → Recommend adding prefetch or prerender rules
- If invalid JSON or wasteful rules (eager prerender of many URLs) → Recommend fixing or lowering eagerness to
moderateorconservative - If the page was prerendered (
activationStart> 0) → SubtractactivationStartwhen interpreting TTFB.js, FCP.js and LCP results
After Critical-CSS-Detection.js
- If render-blocking CSS > 14KB → Recommend inlining critical CSS
- If no inline CSS but has blocking stylesheets → Suggest critical CSS extraction
- If CSS > 50KB total → Run CSS-Media-Queries-Analysis.js to find savings
After Back-Forward-Cache.js
- If bfcache blocked → Provide specific remediation based on blocking reasons
- If bfcache eligible → Confirm optimization is working
After Client-Side-Redirect-Detection.js
- If client-side redirects detected → Recommend server-side redirects
- If redirect chain found → Suggest eliminating intermediate hops
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-interactionSkill
- 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.

