Creator · addyosmani
Last updated · Sep 2, 2026
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".
Creator · addyosmani
Last updated · Sep 2, 2026
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".
Creator · addyosmani
Last updated · Sep 2, 2026
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".
Creator · addyosmani
Last updated · Sep 2, 2026
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".
Sandbox only
Install targets
Codex install prompt
Install the "performance" agent skill from https://github.com/addyosmani/web-quality-skills/tree/main/skills/performance. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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". After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"addyosmani-performance","task":"Install performance","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + Browser agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add addyosmani/web-quality-skills --skill performance
Maintenance
fresh
12d since push
Risk
Risky
Permission surface may require sandboxing
GitHub quality
2.7K
82/100 Quality · 78/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Potential broker, wallet, exchange, or real-money execution surface; sandbox and explicit approval are required
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
RiskyA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
2.7K GitHub stars
Repo activity
2.7K stars, 249 forks
Maintenance
12d since push
License
MIT
Install
npx skills add addyosmani/web-quality-skills --skill performance
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add addyosmani/web-quality-skills --skill performanceDo not use when
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/addyosmani-performance/install
Agent should check
Copy prompt
Task: Use performance in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/addyosmani-performance/install
Install command: npx skills add addyosmani/web-quality-skills --skill performance
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/addyosmani-performance/install
LLM text format
/api/skills/addyosmani-performance/install?format=text
Find alternatives
/api/skills/search?q=performance&limit=3
Agent prompt
Use performance for this task. Review https://www.openagentskill.com/api/skills/addyosmani-performance/install, then install with: npx skills add addyosmani/web-quality-skills --skill performanceRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/addyosmani-performance
LLM text
/api/registry/manifest/addyosmani-performance?format=text
Install alias
/api/registry/install/addyosmani-performance
Recommend
/api/registry/recommend?task=Use%20performance%20in%20an%20agent%20workflow&limit=3
Agent fit
Coding agents
Use-case tags
Platforms
Claude Code, Browser agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Coding agents
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS2.7K GitHub stars
Stars/forks activity
INFO2.7K stars, 249 forks; issue activity unavailable in current metadata
Recent maintenance
PASS12d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Parse messy files
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Workflow fit
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Scrape, clean, and reuse web data
A practical workflow for agents that crawl public pages, extract clean content, normalize data, and hand it to downstream research or RAG workflows.
Alternative shortlist
Similar skills that may fit this task.
Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.
🕵️♂️ Collect a dossier on a person by username from 3000+ sites
Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
Infisical is the open-source platform for secrets, certificates, and privileged access management.
--- name: performance description: 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". license: MIT metadata: author: web-quality-skills version: "2.0" ---
# Performance optimization
Evidence-led performance optimization using real-user signals for prioritization and browser traces for diagnosis. Focuses on loading speed, runtime responsiveness, and resource delivery.
## How it works
1. If a page can run, read [the measurement workflow](references/MEASUREMENT.md) and establish a field-plus-lab baseline before editing. 2. Prioritize poor real-user Core Web Vitals. Use a DevTools performance trace and its focused insights to find the cause. 3. Inspect and change only the code or assets connected to measured bottlenecks. 4. Re-run equivalent lab measurements and report before/after values, conditions, and uncertainty. Field verification remains pending until enough new user data arrives.
When no runnable page exists, perform static inspection but call findings **hypotheses**, not measured regressions. Include the command or browser workflow that can verify each high-impact hypothesis.
Prefer a browser tool that records a performance trace and exposes focused insights. With Chrome DevTools MCP, use `performance_start_trace` and `performance_analyze_insight`; do not route performance through `lighthouse_audit`, which covers non-performance Lighthouse categories.
## Starting performance budget
Budgets must reflect the product's target devices, networks, page types, and user journeys. The values below are initial guardrails for a typical content or commerce page, not universal pass/fail criteria. Preserve an existing project budget when one is already defined.
| Resource | Budget | Rationale | |----------|--------|-----------| | Total page weight | < 1.5 MB | Bounds transfer time and data cost on constrained target networks; calibrate with representative pages | | JavaScript (compressed) | < 300 KB | Protect parse and execution cost | | CSS (compressed) | < 100 KB | Limit render-blocking work | | Images (above-fold) | < 500 KB | Protect likely LCP resources | | Fonts | < 100 KB | Limit critical font transfer | | Third-party | < 200 KB | Bound code outside product control |
## Critical rendering path
### Server response * **TTFB < 800ms.** Time to First Byte should be fast. Use CDN, caching, and efficient backends. * **Enable compression.** Gzip or Brotli for text assets. Brotli preferred (15-20% smaller). * **HTTP/2 or HTTP/3.** Multiplexing reduces connection overhead. * **Edge caching.** Cache HTML at CDN edge when possible. * **Consider Early Hints (HTTP 103) for measured document latency.** If a trace shows slow HTML generation and stable critical subresources, send an interim `103` with `Link` headers before the normal final response from the same request. Use HTTP/2 or later. A CDN may synthesize the `103` from `Link` headers on an earlier `200`, or the origin/edge handler can emit it directly. Unsupported clients continue to the final response, but confirm current browser and infrastructure support. Limit hints to proven critical preloads or preconnects: inaccurate hints waste bandwidth. Cloudflare reported a 20–30% LCP improvement in an artificial, image-heavy test; treat that as a vendor case study, not an expected saving, and measure your result. See [MDN's 103 implementation example](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/103) and [the Cloudflare study](https://blog.cloudflare.com/early-hints-performance/).
### Resource loading
**Preconnect to required origins:** ```html <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://cdn.example.com" crossorigin> ```
**Preload critical resources:**
Preload only resources whose late discovery is visible in the trace. Each preload competes for bandwidth and an unnecessary high-priority request can delay LCP.
```html <!-- LCP image --> <link rel="preload" href="/hero.webp" as="image" fetchpriority="high">
<!-- Critical font --> <link rel="preload" href="/font.woff2" as="font" type="font/woff2" crossorigin> ```
**Prerender likely-next navigations** with the [Speculation Rules API](https://developer.chrome.com/docs/web-platform/prerender-pages): ```html <script type="speculationrules"> { "prerender": [{ "where": { "href_matches": "/*" }, "eagerness": "moderate" }] } </script> ``` `moderate` waits for a stronger intent signal than eager modes. Measure prediction hit rate, transferred bytes, and server cost; a wrong prerender is roughly an unused navigation. See [core-web-vitals → LCP](../core-web-vitals/SKILL.md#lcp-largest-contentful-paint) for the tradeoffs and the `prerenderingchange` gating needed for analytics.
**Defer non-critical CSS:** ```html <!-- Critical CSS inlined --> <style>/* Above-fold styles */</style>
<!-- Non-critical CSS --> <link rel="preload" href="/styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'"> <noscript><link rel="stylesheet" href="/styles.css"></noscript> ```
### JavaScript optimization
**Defer non-essential scripts:** ```html <!-- Parser-blocking (avoid) --> <script src="/critical.js"></script>
<!-- Deferred (preferred) --> <script defer src="/app.js"></script>
<!-- Async (for independent scripts) --> <script async src="/analytics.js"></script>
<!-- Module (deferred by default) --> <script type="module" src="/app.mjs"></script> ```
**Code splitting patterns:** ```javascript // Route-based splitting const Dashboard = lazy(() => import('./Dashboard'));
// Component-based splitting const HeavyChart = lazy(() => import('./HeavyChart'));
// Feature-based splitting if (user.isPremium) { const PremiumFeatures = await import('./PremiumFeatures'); } ```
**Tree shaking best practices:** ```javascript // ❌ Imports entire library import _ from 'lodash'; _.debounce(fn, 300);
// ✅ Imports only what's needed import debounce from 'lodash/debounce'; debounce(fn, 300); ```
## Image optimization
### Format selection | Format | Use case | Browser support | |--------|----------|-----------------| | AVIF | Photos, best compression | 92%+ | | WebP | Photos, good fallback | 97%+ | | PNG | Graphics with transparency | Universal | | SVG | Icons, logos, illustrations | Universal |
### Responsive images ```html <picture> <!-- AVIF for modern browsers --> <source type="image/avif" srcset="hero-400.avif 400w, hero-800.avif 800w, hero-1200.avif 1200w" sizes="(max-width: 600px) 100vw, 50vw"> <!-- WebP fallback --> <source type="image/webp" srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w" sizes="(max-width: 600px) 100vw, 50vw"> <!-- JPEG fallback --> <img src="hero-800.jpg" srcset="hero-400.jpg 400w, hero-800.jpg 800w, hero-1200.jpg 1200w" sizes="(max-width: 600px) 100vw, 50vw" width="1200" height="600" alt="Hero image" loading="lazy" decoding="async"> </picture> ```
### LCP image priority ```html <!-- Above-fold LCP image: eager loading, high priority --> <img src="hero.webp" fetchpriority="high" loading="eager" decoding="sync" alt="Hero">
<!-- Below-fold images: lazy loading --> <img src="product.webp" loading="lazy" decoding="async" alt="Product"> ```
## Font optimization
### Loading strategy ```css /* System font stack as fallback */ body { font-family: 'Custom Font', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
/* Prevent invisible text */ @font-face { font-family: 'Custom Font'; src: url('/fonts/custom.woff2') format('woff2'); font-display: swap; /* or optional for non-critical */ font-weight: 400; font-style: normal; unicode-range: U+0000-00FF; /* Subset to Latin */ } ```
### Preloading critical fonts ```html <link rel="preload" href="/fonts/heading.woff2" as="font" type="font/woff2" crossorigin> ```
### Variable fonts ```css /* One file instead of multiple weights */ @font-face { font-family: 'Inter'; src: url('/fonts/Inter-Variable.woff2') format('woff2-variations'); font-weight: 100 900; font-display: swap; } ```
## Caching strategy
### Cache-Control headers ``` # HTML (short or no cache) Cache-Control: no-cache, must-revalidate
# Static assets with hash (immutable) Cache-Control: public, max-age=31536000, immutable
# Static assets without hash Cache-Control: public, max-age=86400, stale-while-revalidate=604800
# API responses Cache-Control: private, max-age=0, must-revalidate ```
### Service worker caching ```javascript // Cache-first for static assets self.addEventListener('fetch', (event) => { if (event.request.destination === 'image' || event.request.destination === 'style' || event.request.destination === 'script') { event.respondWith( caches.match(event.request).then((cached) => { return cached || fetch(event.request).then((response) => { const clone = response.clone(); caches.open('static-v1').then((cache) => cache.put(event.request, clone)); return response; }); }) ); } }); ```
## Runtime performance
### Avoid layout thrashing ```javascript // ❌ Forces multiple reflows elements.forEach(el => { const height = el.offsetHeight; // Read el.style.height = height + 10 + 'px'; // Write });
// ✅ Batch reads, then batch writes const heights = elements.map(el => el.offsetHeight); // All reads elements.forEach((el, i) => { el.style.height = heights[i] + 10 + 'px'; // All writes }); ```
### Debounce expensive operations ```javascript function debounce(fn, delay) { let timeout; return (...args) => { clearTimeout(timeout); timeout = setTimeout(() => fn(...args), delay); }; }
// Debounce scroll/resize handlers window.addEventListener('scroll', debounce(handleScroll, 100)); ```
### Use requestAnimationFrame ```javascript // ❌ May cause jank setInterval(animate, 16);
// ✅ Synced with display refresh function animate() { // Animation logic requestAnimationFrame(animate); } requestAnimationFrame(animate); ```
### Virtualize long lists ```javascript // For lists > 100 items, render only visible items // Use libraries like react-window, vue-virtual-scroller, or native CSS: .virtual-list { content-visibility: auto; contain-intrinsic-size: 0 50px; /* Estimated item height */ } ```
### Smooth navigations with View Transitions
The [View Transitions API](https://developer.chrome.com/docs/web-platform/view-transitions) lets the browser cross-fade (or custom-animate) between two DOM states using a single GPU-composited snapshot — no double-render, no layout thrash, and the snapshot doesn't count toward CLS.
**Same-document (SPA-style) — Baseline 2026:** ```javascript // Wrap the DOM mutation that swaps the view function navigate(newView) { if (!document.startViewTransition) return swapDOM(newView); document.startViewTransition(() => swapDOM(newView)); } ```
**Cross-document (MPA-style) — Chromium-stable, progressive enhancement elsewhere:** ```css /* On both source and destination pages */ @view-transition { navigation: auto; } ``` That's the entire integration — same-origin navigations now fade automatically. To opt specific elements into shared-element transitions (e.g. a thumbnail expanding into a hero), give them a matching `view-transition-name`: ```css .product-thumb[data-id="42"], .product-hero { view-transition-name: product-42; } ```
Pair this with Speculation Rules (above) for instant + animated navigations.
## Third-party scripts
### Load strategies ```javascript // ❌ Blocks main thread <script src="https://analytics.example.com/script.js"></script>
// ✅ Async loading <script async src="https://analytics.example.com/script.js"></script>
Source provenance
Decision snapshot
2,741 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for performance, ready for a manual X post.
performance: Optimize web performance for faster loading and better user experience. Use when asked to "sp... 2.7K stars https://www.openagentskill.com/skills/addyosmani-performance?ref=x
Listing + install path for performance: https://www.openagentskill.com/skills/addyosmani-performance?ref=x Install: npx skills add addyosmani/web-quality-skills --skill performance
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to addyosmani but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance/audit)
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)addyosmani
@addyosmani
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Wazuh
Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.
16.3K StarsMaigret
🕵️♂️ Collect a dossier on a person by username from 3000+ sites
32.9K StarsNuclei
Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
29.2K StarsInfisical
Infisical is the open-source platform for secrets, certificates, and privileged access management.
27.4K StarsSandbox only
Install targets
Codex install prompt
Install the "performance" agent skill from https://github.com/addyosmani/web-quality-skills/tree/main/skills/performance. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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". After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"addyosmani-performance","task":"Install performance","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + Browser agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add addyosmani/web-quality-skills --skill performance
Maintenance
fresh
12d since push
Risk
Risky
Permission surface may require sandboxing
GitHub quality
2.7K
82/100 Quality · 78/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Potential broker, wallet, exchange, or real-money execution surface; sandbox and explicit approval are required
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
RiskyA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
2.7K GitHub stars
Repo activity
2.7K stars, 249 forks
Maintenance
12d since push
License
MIT
Install
npx skills add addyosmani/web-quality-skills --skill performance
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add addyosmani/web-quality-skills --skill performanceDo not use when
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/addyosmani-performance/install
Agent should check
Copy prompt
Task: Use performance in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/addyosmani-performance/install
Install command: npx skills add addyosmani/web-quality-skills --skill performance
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/addyosmani-performance/install
LLM text format
/api/skills/addyosmani-performance/install?format=text
Find alternatives
/api/skills/search?q=performance&limit=3
Agent prompt
Use performance for this task. Review https://www.openagentskill.com/api/skills/addyosmani-performance/install, then install with: npx skills add addyosmani/web-quality-skills --skill performanceRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/addyosmani-performance
LLM text
/api/registry/manifest/addyosmani-performance?format=text
Install alias
/api/registry/install/addyosmani-performance
Recommend
/api/registry/recommend?task=Use%20performance%20in%20an%20agent%20workflow&limit=3
Agent fit
Coding agents
Use-case tags
Platforms
Claude Code, Browser agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Coding agents
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS2.7K GitHub stars
Stars/forks activity
INFO2.7K stars, 249 forks; issue activity unavailable in current metadata
Recent maintenance
PASS12d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Parse messy files
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Workflow fit
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Scrape, clean, and reuse web data
A practical workflow for agents that crawl public pages, extract clean content, normalize data, and hand it to downstream research or RAG workflows.
Alternative shortlist
Similar skills that may fit this task.
Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.
🕵️♂️ Collect a dossier on a person by username from 3000+ sites
Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
Infisical is the open-source platform for secrets, certificates, and privileged access management.
--- name: performance description: 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". license: MIT metadata: author: web-quality-skills version: "2.0" ---
# Performance optimization
Evidence-led performance optimization using real-user signals for prioritization and browser traces for diagnosis. Focuses on loading speed, runtime responsiveness, and resource delivery.
## How it works
1. If a page can run, read [the measurement workflow](references/MEASUREMENT.md) and establish a field-plus-lab baseline before editing. 2. Prioritize poor real-user Core Web Vitals. Use a DevTools performance trace and its focused insights to find the cause. 3. Inspect and change only the code or assets connected to measured bottlenecks. 4. Re-run equivalent lab measurements and report before/after values, conditions, and uncertainty. Field verification remains pending until enough new user data arrives.
When no runnable page exists, perform static inspection but call findings **hypotheses**, not measured regressions. Include the command or browser workflow that can verify each high-impact hypothesis.
Prefer a browser tool that records a performance trace and exposes focused insights. With Chrome DevTools MCP, use `performance_start_trace` and `performance_analyze_insight`; do not route performance through `lighthouse_audit`, which covers non-performance Lighthouse categories.
## Starting performance budget
Budgets must reflect the product's target devices, networks, page types, and user journeys. The values below are initial guardrails for a typical content or commerce page, not universal pass/fail criteria. Preserve an existing project budget when one is already defined.
| Resource | Budget | Rationale | |----------|--------|-----------| | Total page weight | < 1.5 MB | Bounds transfer time and data cost on constrained target networks; calibrate with representative pages | | JavaScript (compressed) | < 300 KB | Protect parse and execution cost | | CSS (compressed) | < 100 KB | Limit render-blocking work | | Images (above-fold) | < 500 KB | Protect likely LCP resources | | Fonts | < 100 KB | Limit critical font transfer | | Third-party | < 200 KB | Bound code outside product control |
## Critical rendering path
### Server response * **TTFB < 800ms.** Time to First Byte should be fast. Use CDN, caching, and efficient backends. * **Enable compression.** Gzip or Brotli for text assets. Brotli preferred (15-20% smaller). * **HTTP/2 or HTTP/3.** Multiplexing reduces connection overhead. * **Edge caching.** Cache HTML at CDN edge when possible. * **Consider Early Hints (HTTP 103) for measured document latency.** If a trace shows slow HTML generation and stable critical subresources, send an interim `103` with `Link` headers before the normal final response from the same request. Use HTTP/2 or later. A CDN may synthesize the `103` from `Link` headers on an earlier `200`, or the origin/edge handler can emit it directly. Unsupported clients continue to the final response, but confirm current browser and infrastructure support. Limit hints to proven critical preloads or preconnects: inaccurate hints waste bandwidth. Cloudflare reported a 20–30% LCP improvement in an artificial, image-heavy test; treat that as a vendor case study, not an expected saving, and measure your result. See [MDN's 103 implementation example](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/103) and [the Cloudflare study](https://blog.cloudflare.com/early-hints-performance/).
### Resource loading
**Preconnect to required origins:** ```html <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://cdn.example.com" crossorigin> ```
**Preload critical resources:**
Preload only resources whose late discovery is visible in the trace. Each preload competes for bandwidth and an unnecessary high-priority request can delay LCP.
```html <!-- LCP image --> <link rel="preload" href="/hero.webp" as="image" fetchpriority="high">
<!-- Critical font --> <link rel="preload" href="/font.woff2" as="font" type="font/woff2" crossorigin> ```
**Prerender likely-next navigations** with the [Speculation Rules API](https://developer.chrome.com/docs/web-platform/prerender-pages): ```html <script type="speculationrules"> { "prerender": [{ "where": { "href_matches": "/*" }, "eagerness": "moderate" }] } </script> ``` `moderate` waits for a stronger intent signal than eager modes. Measure prediction hit rate, transferred bytes, and server cost; a wrong prerender is roughly an unused navigation. See [core-web-vitals → LCP](../core-web-vitals/SKILL.md#lcp-largest-contentful-paint) for the tradeoffs and the `prerenderingchange` gating needed for analytics.
**Defer non-critical CSS:** ```html <!-- Critical CSS inlined --> <style>/* Above-fold styles */</style>
<!-- Non-critical CSS --> <link rel="preload" href="/styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'"> <noscript><link rel="stylesheet" href="/styles.css"></noscript> ```
### JavaScript optimization
**Defer non-essential scripts:** ```html <!-- Parser-blocking (avoid) --> <script src="/critical.js"></script>
<!-- Deferred (preferred) --> <script defer src="/app.js"></script>
<!-- Async (for independent scripts) --> <script async src="/analytics.js"></script>
<!-- Module (deferred by default) --> <script type="module" src="/app.mjs"></script> ```
**Code splitting patterns:** ```javascript // Route-based splitting const Dashboard = lazy(() => import('./Dashboard'));
// Component-based splitting const HeavyChart = lazy(() => import('./HeavyChart'));
// Feature-based splitting if (user.isPremium) { const PremiumFeatures = await import('./PremiumFeatures'); } ```
**Tree shaking best practices:** ```javascript // ❌ Imports entire library import _ from 'lodash'; _.debounce(fn, 300);
// ✅ Imports only what's needed import debounce from 'lodash/debounce'; debounce(fn, 300); ```
## Image optimization
### Format selection | Format | Use case | Browser support | |--------|----------|-----------------| | AVIF | Photos, best compression | 92%+ | | WebP | Photos, good fallback | 97%+ | | PNG | Graphics with transparency | Universal | | SVG | Icons, logos, illustrations | Universal |
### Responsive images ```html <picture> <!-- AVIF for modern browsers --> <source type="image/avif" srcset="hero-400.avif 400w, hero-800.avif 800w, hero-1200.avif 1200w" sizes="(max-width: 600px) 100vw, 50vw"> <!-- WebP fallback --> <source type="image/webp" srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w" sizes="(max-width: 600px) 100vw, 50vw"> <!-- JPEG fallback --> <img src="hero-800.jpg" srcset="hero-400.jpg 400w, hero-800.jpg 800w, hero-1200.jpg 1200w" sizes="(max-width: 600px) 100vw, 50vw" width="1200" height="600" alt="Hero image" loading="lazy" decoding="async"> </picture> ```
### LCP image priority ```html <!-- Above-fold LCP image: eager loading, high priority --> <img src="hero.webp" fetchpriority="high" loading="eager" decoding="sync" alt="Hero">
<!-- Below-fold images: lazy loading --> <img src="product.webp" loading="lazy" decoding="async" alt="Product"> ```
## Font optimization
### Loading strategy ```css /* System font stack as fallback */ body { font-family: 'Custom Font', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
/* Prevent invisible text */ @font-face { font-family: 'Custom Font'; src: url('/fonts/custom.woff2') format('woff2'); font-display: swap; /* or optional for non-critical */ font-weight: 400; font-style: normal; unicode-range: U+0000-00FF; /* Subset to Latin */ } ```
### Preloading critical fonts ```html <link rel="preload" href="/fonts/heading.woff2" as="font" type="font/woff2" crossorigin> ```
### Variable fonts ```css /* One file instead of multiple weights */ @font-face { font-family: 'Inter'; src: url('/fonts/Inter-Variable.woff2') format('woff2-variations'); font-weight: 100 900; font-display: swap; } ```
## Caching strategy
### Cache-Control headers ``` # HTML (short or no cache) Cache-Control: no-cache, must-revalidate
# Static assets with hash (immutable) Cache-Control: public, max-age=31536000, immutable
# Static assets without hash Cache-Control: public, max-age=86400, stale-while-revalidate=604800
# API responses Cache-Control: private, max-age=0, must-revalidate ```
### Service worker caching ```javascript // Cache-first for static assets self.addEventListener('fetch', (event) => { if (event.request.destination === 'image' || event.request.destination === 'style' || event.request.destination === 'script') { event.respondWith( caches.match(event.request).then((cached) => { return cached || fetch(event.request).then((response) => { const clone = response.clone(); caches.open('static-v1').then((cache) => cache.put(event.request, clone)); return response; }); }) ); } }); ```
## Runtime performance
### Avoid layout thrashing ```javascript // ❌ Forces multiple reflows elements.forEach(el => { const height = el.offsetHeight; // Read el.style.height = height + 10 + 'px'; // Write });
// ✅ Batch reads, then batch writes const heights = elements.map(el => el.offsetHeight); // All reads elements.forEach((el, i) => { el.style.height = heights[i] + 10 + 'px'; // All writes }); ```
### Debounce expensive operations ```javascript function debounce(fn, delay) { let timeout; return (...args) => { clearTimeout(timeout); timeout = setTimeout(() => fn(...args), delay); }; }
// Debounce scroll/resize handlers window.addEventListener('scroll', debounce(handleScroll, 100)); ```
### Use requestAnimationFrame ```javascript // ❌ May cause jank setInterval(animate, 16);
// ✅ Synced with display refresh function animate() { // Animation logic requestAnimationFrame(animate); } requestAnimationFrame(animate); ```
### Virtualize long lists ```javascript // For lists > 100 items, render only visible items // Use libraries like react-window, vue-virtual-scroller, or native CSS: .virtual-list { content-visibility: auto; contain-intrinsic-size: 0 50px; /* Estimated item height */ } ```
### Smooth navigations with View Transitions
The [View Transitions API](https://developer.chrome.com/docs/web-platform/view-transitions) lets the browser cross-fade (or custom-animate) between two DOM states using a single GPU-composited snapshot — no double-render, no layout thrash, and the snapshot doesn't count toward CLS.
**Same-document (SPA-style) — Baseline 2026:** ```javascript // Wrap the DOM mutation that swaps the view function navigate(newView) { if (!document.startViewTransition) return swapDOM(newView); document.startViewTransition(() => swapDOM(newView)); } ```
**Cross-document (MPA-style) — Chromium-stable, progressive enhancement elsewhere:** ```css /* On both source and destination pages */ @view-transition { navigation: auto; } ``` That's the entire integration — same-origin navigations now fade automatically. To opt specific elements into shared-element transitions (e.g. a thumbnail expanding into a hero), give them a matching `view-transition-name`: ```css .product-thumb[data-id="42"], .product-hero { view-transition-name: product-42; } ```
Pair this with Speculation Rules (above) for instant + animated navigations.
## Third-party scripts
### Load strategies ```javascript // ❌ Blocks main thread <script src="https://analytics.example.com/script.js"></script>
// ✅ Async loading <script async src="https://analytics.example.com/script.js"></script>
Source provenance
Decision snapshot
2,741 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for performance, ready for a manual X post.
performance: Optimize web performance for faster loading and better user experience. Use when asked to "sp... 2.7K stars https://www.openagentskill.com/skills/addyosmani-performance?ref=x
Listing + install path for performance: https://www.openagentskill.com/skills/addyosmani-performance?ref=x Install: npx skills add addyosmani/web-quality-skills --skill performance
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to addyosmani but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance/audit)
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)addyosmani
@addyosmani
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Wazuh
Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.
16.3K StarsMaigret
🕵️♂️ Collect a dossier on a person by username from 3000+ sites
32.9K StarsNuclei
Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
29.2K StarsInfisical
Infisical is the open-source platform for secrets, certificates, and privileged access management.
27.4K StarsSandbox only
Install targets
Codex install prompt
Install the "performance" agent skill from https://github.com/addyosmani/web-quality-skills/tree/main/skills/performance. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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". After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"addyosmani-performance","task":"Install performance","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + Browser agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add addyosmani/web-quality-skills --skill performance
Maintenance
fresh
12d since push
Risk
Risky
Permission surface may require sandboxing
GitHub quality
2.7K
82/100 Quality · 78/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Potential broker, wallet, exchange, or real-money execution surface; sandbox and explicit approval are required
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
RiskyA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
2.7K GitHub stars
Repo activity
2.7K stars, 249 forks
Maintenance
12d since push
License
MIT
Install
npx skills add addyosmani/web-quality-skills --skill performance
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add addyosmani/web-quality-skills --skill performanceDo not use when
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/addyosmani-performance/install
Agent should check
Copy prompt
Task: Use performance in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/addyosmani-performance/install
Install command: npx skills add addyosmani/web-quality-skills --skill performance
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/addyosmani-performance/install
LLM text format
/api/skills/addyosmani-performance/install?format=text
Find alternatives
/api/skills/search?q=performance&limit=3
Agent prompt
Use performance for this task. Review https://www.openagentskill.com/api/skills/addyosmani-performance/install, then install with: npx skills add addyosmani/web-quality-skills --skill performanceRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/addyosmani-performance
LLM text
/api/registry/manifest/addyosmani-performance?format=text
Install alias
/api/registry/install/addyosmani-performance
Recommend
/api/registry/recommend?task=Use%20performance%20in%20an%20agent%20workflow&limit=3
Agent fit
Coding agents
Use-case tags
Platforms
Claude Code, Browser agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Coding agents
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS2.7K GitHub stars
Stars/forks activity
INFO2.7K stars, 249 forks; issue activity unavailable in current metadata
Recent maintenance
PASS12d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Parse messy files
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Workflow fit
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Scrape, clean, and reuse web data
A practical workflow for agents that crawl public pages, extract clean content, normalize data, and hand it to downstream research or RAG workflows.
Alternative shortlist
Similar skills that may fit this task.
Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.
🕵️♂️ Collect a dossier on a person by username from 3000+ sites
Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
Infisical is the open-source platform for secrets, certificates, and privileged access management.
--- name: performance description: 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". license: MIT metadata: author: web-quality-skills version: "2.0" ---
# Performance optimization
Evidence-led performance optimization using real-user signals for prioritization and browser traces for diagnosis. Focuses on loading speed, runtime responsiveness, and resource delivery.
## How it works
1. If a page can run, read [the measurement workflow](references/MEASUREMENT.md) and establish a field-plus-lab baseline before editing. 2. Prioritize poor real-user Core Web Vitals. Use a DevTools performance trace and its focused insights to find the cause. 3. Inspect and change only the code or assets connected to measured bottlenecks. 4. Re-run equivalent lab measurements and report before/after values, conditions, and uncertainty. Field verification remains pending until enough new user data arrives.
When no runnable page exists, perform static inspection but call findings **hypotheses**, not measured regressions. Include the command or browser workflow that can verify each high-impact hypothesis.
Prefer a browser tool that records a performance trace and exposes focused insights. With Chrome DevTools MCP, use `performance_start_trace` and `performance_analyze_insight`; do not route performance through `lighthouse_audit`, which covers non-performance Lighthouse categories.
## Starting performance budget
Budgets must reflect the product's target devices, networks, page types, and user journeys. The values below are initial guardrails for a typical content or commerce page, not universal pass/fail criteria. Preserve an existing project budget when one is already defined.
| Resource | Budget | Rationale | |----------|--------|-----------| | Total page weight | < 1.5 MB | Bounds transfer time and data cost on constrained target networks; calibrate with representative pages | | JavaScript (compressed) | < 300 KB | Protect parse and execution cost | | CSS (compressed) | < 100 KB | Limit render-blocking work | | Images (above-fold) | < 500 KB | Protect likely LCP resources | | Fonts | < 100 KB | Limit critical font transfer | | Third-party | < 200 KB | Bound code outside product control |
## Critical rendering path
### Server response * **TTFB < 800ms.** Time to First Byte should be fast. Use CDN, caching, and efficient backends. * **Enable compression.** Gzip or Brotli for text assets. Brotli preferred (15-20% smaller). * **HTTP/2 or HTTP/3.** Multiplexing reduces connection overhead. * **Edge caching.** Cache HTML at CDN edge when possible. * **Consider Early Hints (HTTP 103) for measured document latency.** If a trace shows slow HTML generation and stable critical subresources, send an interim `103` with `Link` headers before the normal final response from the same request. Use HTTP/2 or later. A CDN may synthesize the `103` from `Link` headers on an earlier `200`, or the origin/edge handler can emit it directly. Unsupported clients continue to the final response, but confirm current browser and infrastructure support. Limit hints to proven critical preloads or preconnects: inaccurate hints waste bandwidth. Cloudflare reported a 20–30% LCP improvement in an artificial, image-heavy test; treat that as a vendor case study, not an expected saving, and measure your result. See [MDN's 103 implementation example](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/103) and [the Cloudflare study](https://blog.cloudflare.com/early-hints-performance/).
### Resource loading
**Preconnect to required origins:** ```html <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://cdn.example.com" crossorigin> ```
**Preload critical resources:**
Preload only resources whose late discovery is visible in the trace. Each preload competes for bandwidth and an unnecessary high-priority request can delay LCP.
```html <!-- LCP image --> <link rel="preload" href="/hero.webp" as="image" fetchpriority="high">
<!-- Critical font --> <link rel="preload" href="/font.woff2" as="font" type="font/woff2" crossorigin> ```
**Prerender likely-next navigations** with the [Speculation Rules API](https://developer.chrome.com/docs/web-platform/prerender-pages): ```html <script type="speculationrules"> { "prerender": [{ "where": { "href_matches": "/*" }, "eagerness": "moderate" }] } </script> ``` `moderate` waits for a stronger intent signal than eager modes. Measure prediction hit rate, transferred bytes, and server cost; a wrong prerender is roughly an unused navigation. See [core-web-vitals → LCP](../core-web-vitals/SKILL.md#lcp-largest-contentful-paint) for the tradeoffs and the `prerenderingchange` gating needed for analytics.
**Defer non-critical CSS:** ```html <!-- Critical CSS inlined --> <style>/* Above-fold styles */</style>
<!-- Non-critical CSS --> <link rel="preload" href="/styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'"> <noscript><link rel="stylesheet" href="/styles.css"></noscript> ```
### JavaScript optimization
**Defer non-essential scripts:** ```html <!-- Parser-blocking (avoid) --> <script src="/critical.js"></script>
<!-- Deferred (preferred) --> <script defer src="/app.js"></script>
<!-- Async (for independent scripts) --> <script async src="/analytics.js"></script>
<!-- Module (deferred by default) --> <script type="module" src="/app.mjs"></script> ```
**Code splitting patterns:** ```javascript // Route-based splitting const Dashboard = lazy(() => import('./Dashboard'));
// Component-based splitting const HeavyChart = lazy(() => import('./HeavyChart'));
// Feature-based splitting if (user.isPremium) { const PremiumFeatures = await import('./PremiumFeatures'); } ```
**Tree shaking best practices:** ```javascript // ❌ Imports entire library import _ from 'lodash'; _.debounce(fn, 300);
// ✅ Imports only what's needed import debounce from 'lodash/debounce'; debounce(fn, 300); ```
## Image optimization
### Format selection | Format | Use case | Browser support | |--------|----------|-----------------| | AVIF | Photos, best compression | 92%+ | | WebP | Photos, good fallback | 97%+ | | PNG | Graphics with transparency | Universal | | SVG | Icons, logos, illustrations | Universal |
### Responsive images ```html <picture> <!-- AVIF for modern browsers --> <source type="image/avif" srcset="hero-400.avif 400w, hero-800.avif 800w, hero-1200.avif 1200w" sizes="(max-width: 600px) 100vw, 50vw"> <!-- WebP fallback --> <source type="image/webp" srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w" sizes="(max-width: 600px) 100vw, 50vw"> <!-- JPEG fallback --> <img src="hero-800.jpg" srcset="hero-400.jpg 400w, hero-800.jpg 800w, hero-1200.jpg 1200w" sizes="(max-width: 600px) 100vw, 50vw" width="1200" height="600" alt="Hero image" loading="lazy" decoding="async"> </picture> ```
### LCP image priority ```html <!-- Above-fold LCP image: eager loading, high priority --> <img src="hero.webp" fetchpriority="high" loading="eager" decoding="sync" alt="Hero">
<!-- Below-fold images: lazy loading --> <img src="product.webp" loading="lazy" decoding="async" alt="Product"> ```
## Font optimization
### Loading strategy ```css /* System font stack as fallback */ body { font-family: 'Custom Font', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
/* Prevent invisible text */ @font-face { font-family: 'Custom Font'; src: url('/fonts/custom.woff2') format('woff2'); font-display: swap; /* or optional for non-critical */ font-weight: 400; font-style: normal; unicode-range: U+0000-00FF; /* Subset to Latin */ } ```
### Preloading critical fonts ```html <link rel="preload" href="/fonts/heading.woff2" as="font" type="font/woff2" crossorigin> ```
### Variable fonts ```css /* One file instead of multiple weights */ @font-face { font-family: 'Inter'; src: url('/fonts/Inter-Variable.woff2') format('woff2-variations'); font-weight: 100 900; font-display: swap; } ```
## Caching strategy
### Cache-Control headers ``` # HTML (short or no cache) Cache-Control: no-cache, must-revalidate
# Static assets with hash (immutable) Cache-Control: public, max-age=31536000, immutable
# Static assets without hash Cache-Control: public, max-age=86400, stale-while-revalidate=604800
# API responses Cache-Control: private, max-age=0, must-revalidate ```
### Service worker caching ```javascript // Cache-first for static assets self.addEventListener('fetch', (event) => { if (event.request.destination === 'image' || event.request.destination === 'style' || event.request.destination === 'script') { event.respondWith( caches.match(event.request).then((cached) => { return cached || fetch(event.request).then((response) => { const clone = response.clone(); caches.open('static-v1').then((cache) => cache.put(event.request, clone)); return response; }); }) ); } }); ```
## Runtime performance
### Avoid layout thrashing ```javascript // ❌ Forces multiple reflows elements.forEach(el => { const height = el.offsetHeight; // Read el.style.height = height + 10 + 'px'; // Write });
// ✅ Batch reads, then batch writes const heights = elements.map(el => el.offsetHeight); // All reads elements.forEach((el, i) => { el.style.height = heights[i] + 10 + 'px'; // All writes }); ```
### Debounce expensive operations ```javascript function debounce(fn, delay) { let timeout; return (...args) => { clearTimeout(timeout); timeout = setTimeout(() => fn(...args), delay); }; }
// Debounce scroll/resize handlers window.addEventListener('scroll', debounce(handleScroll, 100)); ```
### Use requestAnimationFrame ```javascript // ❌ May cause jank setInterval(animate, 16);
// ✅ Synced with display refresh function animate() { // Animation logic requestAnimationFrame(animate); } requestAnimationFrame(animate); ```
### Virtualize long lists ```javascript // For lists > 100 items, render only visible items // Use libraries like react-window, vue-virtual-scroller, or native CSS: .virtual-list { content-visibility: auto; contain-intrinsic-size: 0 50px; /* Estimated item height */ } ```
### Smooth navigations with View Transitions
The [View Transitions API](https://developer.chrome.com/docs/web-platform/view-transitions) lets the browser cross-fade (or custom-animate) between two DOM states using a single GPU-composited snapshot — no double-render, no layout thrash, and the snapshot doesn't count toward CLS.
**Same-document (SPA-style) — Baseline 2026:** ```javascript // Wrap the DOM mutation that swaps the view function navigate(newView) { if (!document.startViewTransition) return swapDOM(newView); document.startViewTransition(() => swapDOM(newView)); } ```
**Cross-document (MPA-style) — Chromium-stable, progressive enhancement elsewhere:** ```css /* On both source and destination pages */ @view-transition { navigation: auto; } ``` That's the entire integration — same-origin navigations now fade automatically. To opt specific elements into shared-element transitions (e.g. a thumbnail expanding into a hero), give them a matching `view-transition-name`: ```css .product-thumb[data-id="42"], .product-hero { view-transition-name: product-42; } ```
Pair this with Speculation Rules (above) for instant + animated navigations.
## Third-party scripts
### Load strategies ```javascript // ❌ Blocks main thread <script src="https://analytics.example.com/script.js"></script>
// ✅ Async loading <script async src="https://analytics.example.com/script.js"></script>
Source provenance
Decision snapshot
2,741 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for performance, ready for a manual X post.
performance: Optimize web performance for faster loading and better user experience. Use when asked to "sp... 2.7K stars https://www.openagentskill.com/skills/addyosmani-performance?ref=x
Listing + install path for performance: https://www.openagentskill.com/skills/addyosmani-performance?ref=x Install: npx skills add addyosmani/web-quality-skills --skill performance
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to addyosmani but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance/audit)
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)addyosmani
@addyosmani
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Wazuh
Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.
16.3K StarsMaigret
🕵️♂️ Collect a dossier on a person by username from 3000+ sites
32.9K StarsNuclei
Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
29.2K StarsInfisical
Infisical is the open-source platform for secrets, certificates, and privileged access management.
27.4K StarsSandbox only
Install targets
Codex install prompt
Install the "performance" agent skill from https://github.com/addyosmani/web-quality-skills/tree/main/skills/performance. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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". After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"addyosmani-performance","task":"Install performance","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + Browser agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add addyosmani/web-quality-skills --skill performance
Maintenance
fresh
12d since push
Risk
Risky
Permission surface may require sandboxing
GitHub quality
2.7K
82/100 Quality · 78/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Potential broker, wallet, exchange, or real-money execution surface; sandbox and explicit approval are required
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
RiskyA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
2.7K GitHub stars
Repo activity
2.7K stars, 249 forks
Maintenance
12d since push
License
MIT
Install
npx skills add addyosmani/web-quality-skills --skill performance
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add addyosmani/web-quality-skills --skill performanceDo not use when
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/addyosmani-performance/install
Agent should check
Copy prompt
Task: Use performance in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20performance%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/addyosmani-performance/install
Install command: npx skills add addyosmani/web-quality-skills --skill performance
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/addyosmani-performance/install
LLM text format
/api/skills/addyosmani-performance/install?format=text
Find alternatives
/api/skills/search?q=performance&limit=3
Agent prompt
Use performance for this task. Review https://www.openagentskill.com/api/skills/addyosmani-performance/install, then install with: npx skills add addyosmani/web-quality-skills --skill performanceRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/addyosmani-performance
LLM text
/api/registry/manifest/addyosmani-performance?format=text
Install alias
/api/registry/install/addyosmani-performance
Recommend
/api/registry/recommend?task=Use%20performance%20in%20an%20agent%20workflow&limit=3
Agent fit
Coding agents
Use-case tags
Platforms
Claude Code, Browser agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Coding agents
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS2.7K GitHub stars
Stars/forks activity
INFO2.7K stars, 249 forks; issue activity unavailable in current metadata
Recent maintenance
PASS12d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Parse messy files
I need my agent to read PDFs, extract tables, and turn documents into structured data.
Workflow fit
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Scrape, clean, and reuse web data
A practical workflow for agents that crawl public pages, extract clean content, normalize data, and hand it to downstream research or RAG workflows.
Alternative shortlist
Similar skills that may fit this task.
Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.
🕵️♂️ Collect a dossier on a person by username from 3000+ sites
Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
Infisical is the open-source platform for secrets, certificates, and privileged access management.
--- name: performance description: 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". license: MIT metadata: author: web-quality-skills version: "2.0" ---
# Performance optimization
Evidence-led performance optimization using real-user signals for prioritization and browser traces for diagnosis. Focuses on loading speed, runtime responsiveness, and resource delivery.
## How it works
1. If a page can run, read [the measurement workflow](references/MEASUREMENT.md) and establish a field-plus-lab baseline before editing. 2. Prioritize poor real-user Core Web Vitals. Use a DevTools performance trace and its focused insights to find the cause. 3. Inspect and change only the code or assets connected to measured bottlenecks. 4. Re-run equivalent lab measurements and report before/after values, conditions, and uncertainty. Field verification remains pending until enough new user data arrives.
When no runnable page exists, perform static inspection but call findings **hypotheses**, not measured regressions. Include the command or browser workflow that can verify each high-impact hypothesis.
Prefer a browser tool that records a performance trace and exposes focused insights. With Chrome DevTools MCP, use `performance_start_trace` and `performance_analyze_insight`; do not route performance through `lighthouse_audit`, which covers non-performance Lighthouse categories.
## Starting performance budget
Budgets must reflect the product's target devices, networks, page types, and user journeys. The values below are initial guardrails for a typical content or commerce page, not universal pass/fail criteria. Preserve an existing project budget when one is already defined.
| Resource | Budget | Rationale | |----------|--------|-----------| | Total page weight | < 1.5 MB | Bounds transfer time and data cost on constrained target networks; calibrate with representative pages | | JavaScript (compressed) | < 300 KB | Protect parse and execution cost | | CSS (compressed) | < 100 KB | Limit render-blocking work | | Images (above-fold) | < 500 KB | Protect likely LCP resources | | Fonts | < 100 KB | Limit critical font transfer | | Third-party | < 200 KB | Bound code outside product control |
## Critical rendering path
### Server response * **TTFB < 800ms.** Time to First Byte should be fast. Use CDN, caching, and efficient backends. * **Enable compression.** Gzip or Brotli for text assets. Brotli preferred (15-20% smaller). * **HTTP/2 or HTTP/3.** Multiplexing reduces connection overhead. * **Edge caching.** Cache HTML at CDN edge when possible. * **Consider Early Hints (HTTP 103) for measured document latency.** If a trace shows slow HTML generation and stable critical subresources, send an interim `103` with `Link` headers before the normal final response from the same request. Use HTTP/2 or later. A CDN may synthesize the `103` from `Link` headers on an earlier `200`, or the origin/edge handler can emit it directly. Unsupported clients continue to the final response, but confirm current browser and infrastructure support. Limit hints to proven critical preloads or preconnects: inaccurate hints waste bandwidth. Cloudflare reported a 20–30% LCP improvement in an artificial, image-heavy test; treat that as a vendor case study, not an expected saving, and measure your result. See [MDN's 103 implementation example](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/103) and [the Cloudflare study](https://blog.cloudflare.com/early-hints-performance/).
### Resource loading
**Preconnect to required origins:** ```html <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://cdn.example.com" crossorigin> ```
**Preload critical resources:**
Preload only resources whose late discovery is visible in the trace. Each preload competes for bandwidth and an unnecessary high-priority request can delay LCP.
```html <!-- LCP image --> <link rel="preload" href="/hero.webp" as="image" fetchpriority="high">
<!-- Critical font --> <link rel="preload" href="/font.woff2" as="font" type="font/woff2" crossorigin> ```
**Prerender likely-next navigations** with the [Speculation Rules API](https://developer.chrome.com/docs/web-platform/prerender-pages): ```html <script type="speculationrules"> { "prerender": [{ "where": { "href_matches": "/*" }, "eagerness": "moderate" }] } </script> ``` `moderate` waits for a stronger intent signal than eager modes. Measure prediction hit rate, transferred bytes, and server cost; a wrong prerender is roughly an unused navigation. See [core-web-vitals → LCP](../core-web-vitals/SKILL.md#lcp-largest-contentful-paint) for the tradeoffs and the `prerenderingchange` gating needed for analytics.
**Defer non-critical CSS:** ```html <!-- Critical CSS inlined --> <style>/* Above-fold styles */</style>
<!-- Non-critical CSS --> <link rel="preload" href="/styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'"> <noscript><link rel="stylesheet" href="/styles.css"></noscript> ```
### JavaScript optimization
**Defer non-essential scripts:** ```html <!-- Parser-blocking (avoid) --> <script src="/critical.js"></script>
<!-- Deferred (preferred) --> <script defer src="/app.js"></script>
<!-- Async (for independent scripts) --> <script async src="/analytics.js"></script>
<!-- Module (deferred by default) --> <script type="module" src="/app.mjs"></script> ```
**Code splitting patterns:** ```javascript // Route-based splitting const Dashboard = lazy(() => import('./Dashboard'));
// Component-based splitting const HeavyChart = lazy(() => import('./HeavyChart'));
// Feature-based splitting if (user.isPremium) { const PremiumFeatures = await import('./PremiumFeatures'); } ```
**Tree shaking best practices:** ```javascript // ❌ Imports entire library import _ from 'lodash'; _.debounce(fn, 300);
// ✅ Imports only what's needed import debounce from 'lodash/debounce'; debounce(fn, 300); ```
## Image optimization
### Format selection | Format | Use case | Browser support | |--------|----------|-----------------| | AVIF | Photos, best compression | 92%+ | | WebP | Photos, good fallback | 97%+ | | PNG | Graphics with transparency | Universal | | SVG | Icons, logos, illustrations | Universal |
### Responsive images ```html <picture> <!-- AVIF for modern browsers --> <source type="image/avif" srcset="hero-400.avif 400w, hero-800.avif 800w, hero-1200.avif 1200w" sizes="(max-width: 600px) 100vw, 50vw"> <!-- WebP fallback --> <source type="image/webp" srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w" sizes="(max-width: 600px) 100vw, 50vw"> <!-- JPEG fallback --> <img src="hero-800.jpg" srcset="hero-400.jpg 400w, hero-800.jpg 800w, hero-1200.jpg 1200w" sizes="(max-width: 600px) 100vw, 50vw" width="1200" height="600" alt="Hero image" loading="lazy" decoding="async"> </picture> ```
### LCP image priority ```html <!-- Above-fold LCP image: eager loading, high priority --> <img src="hero.webp" fetchpriority="high" loading="eager" decoding="sync" alt="Hero">
<!-- Below-fold images: lazy loading --> <img src="product.webp" loading="lazy" decoding="async" alt="Product"> ```
## Font optimization
### Loading strategy ```css /* System font stack as fallback */ body { font-family: 'Custom Font', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
/* Prevent invisible text */ @font-face { font-family: 'Custom Font'; src: url('/fonts/custom.woff2') format('woff2'); font-display: swap; /* or optional for non-critical */ font-weight: 400; font-style: normal; unicode-range: U+0000-00FF; /* Subset to Latin */ } ```
### Preloading critical fonts ```html <link rel="preload" href="/fonts/heading.woff2" as="font" type="font/woff2" crossorigin> ```
### Variable fonts ```css /* One file instead of multiple weights */ @font-face { font-family: 'Inter'; src: url('/fonts/Inter-Variable.woff2') format('woff2-variations'); font-weight: 100 900; font-display: swap; } ```
## Caching strategy
### Cache-Control headers ``` # HTML (short or no cache) Cache-Control: no-cache, must-revalidate
# Static assets with hash (immutable) Cache-Control: public, max-age=31536000, immutable
# Static assets without hash Cache-Control: public, max-age=86400, stale-while-revalidate=604800
# API responses Cache-Control: private, max-age=0, must-revalidate ```
### Service worker caching ```javascript // Cache-first for static assets self.addEventListener('fetch', (event) => { if (event.request.destination === 'image' || event.request.destination === 'style' || event.request.destination === 'script') { event.respondWith( caches.match(event.request).then((cached) => { return cached || fetch(event.request).then((response) => { const clone = response.clone(); caches.open('static-v1').then((cache) => cache.put(event.request, clone)); return response; }); }) ); } }); ```
## Runtime performance
### Avoid layout thrashing ```javascript // ❌ Forces multiple reflows elements.forEach(el => { const height = el.offsetHeight; // Read el.style.height = height + 10 + 'px'; // Write });
// ✅ Batch reads, then batch writes const heights = elements.map(el => el.offsetHeight); // All reads elements.forEach((el, i) => { el.style.height = heights[i] + 10 + 'px'; // All writes }); ```
### Debounce expensive operations ```javascript function debounce(fn, delay) { let timeout; return (...args) => { clearTimeout(timeout); timeout = setTimeout(() => fn(...args), delay); }; }
// Debounce scroll/resize handlers window.addEventListener('scroll', debounce(handleScroll, 100)); ```
### Use requestAnimationFrame ```javascript // ❌ May cause jank setInterval(animate, 16);
// ✅ Synced with display refresh function animate() { // Animation logic requestAnimationFrame(animate); } requestAnimationFrame(animate); ```
### Virtualize long lists ```javascript // For lists > 100 items, render only visible items // Use libraries like react-window, vue-virtual-scroller, or native CSS: .virtual-list { content-visibility: auto; contain-intrinsic-size: 0 50px; /* Estimated item height */ } ```
### Smooth navigations with View Transitions
The [View Transitions API](https://developer.chrome.com/docs/web-platform/view-transitions) lets the browser cross-fade (or custom-animate) between two DOM states using a single GPU-composited snapshot — no double-render, no layout thrash, and the snapshot doesn't count toward CLS.
**Same-document (SPA-style) — Baseline 2026:** ```javascript // Wrap the DOM mutation that swaps the view function navigate(newView) { if (!document.startViewTransition) return swapDOM(newView); document.startViewTransition(() => swapDOM(newView)); } ```
**Cross-document (MPA-style) — Chromium-stable, progressive enhancement elsewhere:** ```css /* On both source and destination pages */ @view-transition { navigation: auto; } ``` That's the entire integration — same-origin navigations now fade automatically. To opt specific elements into shared-element transitions (e.g. a thumbnail expanding into a hero), give them a matching `view-transition-name`: ```css .product-thumb[data-id="42"], .product-hero { view-transition-name: product-42; } ```
Pair this with Speculation Rules (above) for instant + animated navigations.
## Third-party scripts
### Load strategies ```javascript // ❌ Blocks main thread <script src="https://analytics.example.com/script.js"></script>
// ✅ Async loading <script async src="https://analytics.example.com/script.js"></script>
Source provenance
Decision snapshot
2,741 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for performance, ready for a manual X post.
performance: Optimize web performance for faster loading and better user experience. Use when asked to "sp... 2.7K stars https://www.openagentskill.com/skills/addyosmani-performance?ref=x
Listing + install path for performance: https://www.openagentskill.com/skills/addyosmani-performance?ref=x Install: npx skills add addyosmani/web-quality-skills --skill performance
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to addyosmani but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance/audit)
[](https://www.openagentskill.com/skills/addyosmani-performance?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)addyosmani
@addyosmani
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Wazuh
Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.
16.3K StarsMaigret
🕵️♂️ Collect a dossier on a person by username from 3000+ sites
32.9K StarsNuclei
Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
29.2K StarsInfisical
Infisical is the open-source platform for secrets, certificates, and privileged access management.
27.4K StarsPermission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness