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.

referencesMEASUREMENT.md

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

Performance measurement workflow

Use this workflow when a runnable URL is available, the user asks for measured performance, or a change needs before/after verification.

Keep the evidence types separate

Evidence What it represents Best use
CrUX field data Aggregated experiences from eligible real Chrome users, normally a rolling 28-day window Decide whether users have a Core Web Vitals problem
First-party RUM Measurements collected and reported from the site's own user sessions Segment and diagnose current production experience
DevTools performance trace One observed browser session under stated local or emulated conditions Find LCP, INP, CLS, network, and main-thread causes
Lighthouse lab run A controlled synthetic navigation Reproduce load problems and prevent regressions
Static code inspection Potential issues inferred from source Form hypotheses when no page can run

A PerformanceObserver result injected into one browser page is a single-session lab observation, not field data. It becomes RUM only when measurements from actual users are reported and aggregated.

Preferred low-friction route

When browser tooling can record a performance trace and run Lighthouse audits, prefer this route. With Chrome DevTools MCP:

  1. Navigate to the exact route and state being audited. Record whether it is public, authenticated, local, or staging.
  2. Record a reload trace with auto-stop for page-load performance (performance_start_trace). Current trace summaries can include both observed lab metrics and CrUX field metrics when CrUX has eligible data. Record whether field scope is URL or origin.
  3. Analyze only the relevant failing or suspicious insights (performance_analyze_insight). Common examples are LCPBreakdown, LCPDiscovery, DocumentLatency, RenderBlocking, and ThirdParties.
  4. Run the Lighthouse audit capability (lighthouse_audit) for Accessibility, SEO, Best Practices, and Agentic Browsing. It deliberately excludes performance; do not treat it as the performance path.
  5. Re-run the same lab measurement after a fix. Field data will not reflect a new deployment immediately.

Use mobile conditions by default for a general public-site audit. Add desktop when the user asks for it, desktop traffic matters, or the product is desktop-oriented. Test authenticated and unauthenticated states separately when they render different pages.

When using emulation, set the viewport, network conditions, and CPU rate explicitly before the trace, confirm the reported conditions, and reset them before testing another profile.

Chrome DevTools MCP's Lighthouse navigation mode reloads the page. Use snapshot mode for the current state when a reload would lose an authenticated or user-created state. Do not run a navigation audit on an unsaved form or destructive workflow.

Token-efficient tool use

  • Start with one trace and one Lighthouse audit rather than broad DOM, network, console, and source dumps.
  • Preserve large reports or traces to temporary files when the tool supports filePath or outputDirPath; summarize only actionable failures.
  • Drill into the few insights tied to a poor field metric or a reproducible lab bottleneck.
  • Filter and paginate network or console requests. Fetch individual request details only when they support a finding.
  • Take a text snapshot before a screenshot unless visual inspection is necessary.

Fallbacks when DevTools tools are unavailable

Use the first available option; do not block the audit on optional setup.

  1. Lighthouse CLI for lab data: run the project's compatible Lighthouse version against the runnable URL. Keep JSON for comparison and avoid installing a permanent dependency unless the user wants one.
  2. PageSpeed Insights web UI for a public URL: it provides a zero-setup view of Lighthouse lab diagnostics and available CrUX field data.
  3. CrUX Vis for history: use it when trend data matters and the URL or origin is eligible.
  4. CrUX API or History API for automation: both are free to use but require a Google Cloud API key. Do not make a key a prerequisite for an ordinary audit.
  5. Static inspection: if nothing can run, label every performance finding as a hypothesis and provide the exact measurement needed to verify it.

The PageSpeed Insights API may be called without a key for occasional use, but a key is recommended for repeated automation. Google has announced that CrUX field data will be removed from that API, so new integrations should query the CrUX API directly.

Reading CrUX correctly

  • Prefer page-level data for the audited URL. If only origin data exists, label it as origin scope; it is context, not proof for that route.
  • Compare the p75 value with the Core Web Vitals threshold and include the percentage of good experiences when available.
  • Keep phone and desktop data separate. Do not combine form factors to answer a device-specific question.
  • Treat missing CrUX data as unavailable, never as passing. Localhost, staging, new, private, and low-traffic pages commonly have no CrUX record.
  • CrUX is aggregated and delayed. Use it to prioritize user outcomes, not to verify a change deployed minutes ago.

Repeatable lab comparisons

Record these conditions with the result:

  • final URL and page state
  • browser and Lighthouse/tool version
  • viewport or form factor
  • CPU and network throttling
  • cold or warm cache
  • authentication, consent, and experiment state

For a decision based on a headline lab metric, run at least three equivalent navigations and report the median plus range. Do not compare a single local trace directly with the CrUX p75 or claim that the two should match.

Use metric values as the evidence. A Lighthouse score is a diagnostic summary whose weighting and implementation can change between versions.

Reconciling lab and field

Field Lab Interpretation
Poor Poor Reproducible user problem; trace and fix the dominant bottleneck
Poor Good Local run missed real-user conditions; segment first-party RUM or test representative devices, routes, cache states, and interactions
Good Poor The synthetic cold/throttled case is fragile, but do not claim users are currently failing
Unavailable Any Use lab data for diagnosis and recommend RUM if production impact matters

Compact audit output

Start reports with an evidence table:

Signal Scope and conditions Baseline After Source
LCP URL, phone, p75/28 days 3.1s Pending field window CrUX
LCP URL, mobile lab, cold cache, median of 3 3.8s 2.6s DevTools trace

Then separate:

  1. measured failures
  2. trace-backed causes
  3. source-code hypotheses
  4. fixes made or recommended
  5. verification status and remaining uncertainty

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.