All skills
addyosmani avatar

/performance

@c6b06ad official

Optimize web performance for faster loading and better user experience. Use when asked to "speed up my site", "optimize performance", "reduce load time", "fix slow loading", "improve page speed", or "performance audit".

Use this Skill: https://skilld.dev/gh/addyosmani/web-quality-skills/performance

This session only. Nothing lands on disk.

referencesRUM.md

≈784 tokens on demand. Your agent reads this file only when SKILL.md points to it.

First-party real-user monitoring

Read this only when the user wants to add, review, or improve production RUM.

Before changing the site

Telemetry changes affect production data collection and privacy. Reuse an existing analytics or RUM pipeline when possible. If adding a new endpoint, vendor, cookie, or consent behavior was not requested, propose the change and get authorization before implementing it.

Prefer the web-vitals library over hand-written PerformanceObserver code. It follows the metric lifecycle and browser edge cases used by Google's tooling. Switch to the attribution build only when the extra diagnostic context will be reviewed and deliberately allowlisted.

Minimal collection pattern

import {onCLS, onINP, onLCP} from 'web-vitals';

function sendToRum({name, value, rating, id, navigationType}) {
  const body = JSON.stringify({
    name,
    value,
    rating,
    id,
    navigationType,
    path: location.pathname,
    release: window.APP_RELEASE
  });

  if (!navigator.sendBeacon?.('/rum', body)) {
    fetch('/rum', {method: 'POST', body, keepalive: true});
  }
}

onCLS(sendToRum);
onINP(sendToRum);
onLCP(sendToRum);

Adapt the payload to the existing backend. Do not include query strings, user-entered text, full DOM fragments, or other personal data. The web-vitals/attribution build can add element or script details; review them and send only explicit, low-cardinality fields that fit the site's privacy model.

Collection rules

  • Record a stable release or experiment identifier so regressions can be attributed to a change.
  • Group by route template rather than creating a high-cardinality bucket for every URL.
  • Retain device/form factor, navigation type, and coarse connection context when the privacy model allows it.
  • Sample deliberately and record the sampling rate. Do not compare cohorts collected with different sampling rules as if they were equal.
  • Let the library report final metric values. reportAllChanges is useful for local debugging but usually creates noisy production telemetry.
  • Handle consent and regional privacy requirements through the site's existing policy.

Aggregation and reporting

For each route or product journey, report:

  • p75 for LCP, INP, and CLS
  • percentage of visits in good, needs-improvement, and poor buckets
  • sample count and time window
  • important segments such as form factor, release, and navigation type

Do not use an average as the pass/fail signal. Assess each Core Web Vital at p75; all three p75 values must meet their good thresholds for the route or origin to pass the combined assessment.

CrUX and first-party RUM can disagree because they cover different users, browsers, routes, sampling rules, and time windows. Document those differences before treating either source as wrong.

Sources

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The performance skill provides technical guidance and code examples for optimizing web application performance. It relies on standard browser APIs, well-known performance measurement tools from Google, and established best practices for resource delivery and runtime efficiency. No malicious patterns or security risks were identified.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    1 file scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at c6b06ad. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated last month
metadata
{
  "author": "web-quality-skills",
  "version": "2.0"
}
  • Performance
  • lighthouse
  • core-web-vitals
  • optimization
  • image-optimization
  • caching
  • critical-rendering-path
  • font-loading
  • bundling

README badge

README badge for addyosmani/web-quality-skills/performance

Optimizes web performance by identifying bottlenecks from Lighthouse audits and applying specific fixes for loading speed, runtime efficiency, and Core Web Vitals targets. Covers critical rendering path optimization, image and font loading strategies, caching, layout thrashing prevention, and third-party script management with concrete code examples.

Generated from the current SKILL.md.

Does this skill cover Core Web Vitals optimization?
It provides guidance on LCP, FCP, and CLS as part of performance optimization. For detailed Core Web Vitals-specific strategies, the skill references a separate Core Web Vitals skill.
What performance budgets does this skill recommend?
Total page weight under 1.5 MB, JavaScript under 300 KB, CSS under 100 KB, above-fold images under 500 KB, fonts under 100 KB, and third-party scripts under 200 KB.
Does this cover image optimization?
Yes. It includes format selection (AVIF, WebP, PNG, SVG), responsive image patterns with `srcset`, lazy loading strategies, and LCP image prioritization with `fetchpriority` and `loading` attributes.
What runtime performance techniques are covered?
The skill covers layout thrashing prevention, debouncing expensive operations, requestAnimationFrame for animations, list virtualization, and the View Transitions API for smooth navigations.
Does this include third-party script optimization?
Yes. It covers async loading, delayed loading until interaction, and the facade pattern to defer expensive third-party embeds like YouTube videos.

Generated from the current SKILL.md. These answers refresh after source changes.