Skip to main content
skill CX Codex

web-performance-optimization · bobmatnyc — Claude Code skill: what it does

A skill that walks through web performance work: Core Web Vitals, modern browser patterns, and framework-specific fixes. Useful when Lighthouse scores drop or pages load slowly.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add bobmatnyc/claude-mpm-skills --skill web-performance-optimization -a claude-code
Open on GitHub

What web-performance-optimization does

The skill starts with a Lighthouse audit, then moves to quick wins: loading="lazy" on below-fold images, gzip or brotli compression, and rel="preconnect" for critical origins. From there it covers LCP, INP and CLS, modern patterns such as View Transitions and Speculation Rules, and continuous monitoring.

Six reference files sit behind it: quick-wins.md, core-web-vitals.md, optimization-techniques.md, modern-patterns-2025.md, framework-specific.md and monitoring.md. They load on demand, so the skill does not flood the context window up front. One file covers optimizations for Next.js, React, Vue, Vite, Astro and SvelteKit.

The skill is not user-invocable and does not trigger model invocation on its own; it acts as reference material while the agent works on performance. Skip the baseline measurement and it loses its point — run Lighthouse or WebPageTest before touching anything. Guessing at optimizations tends to send you in the wrong direction.

What it helps with

  • push a Lighthouse score past 90
  • cut LCP to 2.5 seconds or less
  • stop layout shifts and lower CLS
  • split bundles to reduce TBT
  • set up continuous performance monitoring

Example prompts for the agent

  • Audit this page against Core Web Vitals and tell me what to fix first
  • LCP is above 2.5 seconds — suggest optimizations for the hero image and critical resources
  • Set up Lighthouse CI and performance budgets for this project

How to install web-performance-optimization

1Skills CLI (Vercel)

npx skills add bobmatnyc/claude-mpm-skills --skill web-performance-optimization -a claude-code

2Manually: put the files in place

~/.claude/skills/web-performance-optimization/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/web-performance-optimization/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about web-performance-optimization

How do I install web-performance-optimization in Claude Code?

Run npx skills add bobmatnyc/claude-mpm-skills --skill web-performance-optimization -a claude-code. The skill file lands at ~/.claude/skills/web-performance-optimization/SKILL.md.

What does web-performance-optimization do?

It guides web performance work: quick wins, Core Web Vitals metrics, modern patterns, and framework-specific techniques. It also covers monitoring setup.

Which frameworks get their own recommendations?

The framework-specific.md reference collects optimizations for Next.js, React, Vue, Vite, Astro and SvelteKit.

Source text

SKILL.md · MIT
---
name: web-performance-optimization
description: "Optimize web performance using Core Web Vitals, modern patterns (View Transitions, Speculation Rules), and framework-specific techniques"
user-invocable: false
disable-model-invocation: true
updated_at: 2025-12-02T00:00:00Z
tags: [performance, optimization, lighthouse, core-web-vitals, frontend]
progressive_disclosure:
  entry_point:
    summary: "Optimize web performance through Core Web Vitals, modern browser APIs, and framework-specific patterns for fast, responsive experiences"
    when_to_use: "When improving Lighthouse scores, reducing load times, implementing modern performance patterns, or debugging bottlenecks"
    quick_start: "1. Audit with Lighthouse 2. Apply Quick Wins (lazy loading, compression, preconnect) 3. Optimize Core Web Vitals (LCP, CLS, INP) 4. Add modern patterns (View Transitions, Speculation Rules) 5. Monitor continuously"
  references:
    - quick-wins.md
    - core-web-vitals.md
    - optimization-techniques.md
    - modern-patterns-2025.md
    - framework-specific.md
    - monitoring.md
---

# Web Performance Optimization

Optimize web performance through Core Web Vitals, modern browser APIs (View Transitions, Speculation Rules), and framework-specific techniques.

## When to Use This Skill

- Improving Lighthouse scores (target: 90+)
- Reducing page load times (target: <2.5s LCP)
- Optimizing Core Web Vitals for SEO rankings
- Implementing modern performance patterns (2025)
- Debugging performance bottlenecks
- Setting up continuous performance monitoring

**Business Impact:** 1 second delay = 7% conversion loss. 0.1s improvement = 8% increase in conversions.

## Start Here: Quick Wins

**High-ROI optimizations by time investment:**

**1 Hour Quick Wins (⭐⭐⭐⭐⭐ ROI):**
- Add `loading="lazy"` to below-fold images (40-60% weight reduction)
- Enable compression (gzip/brotli) (70-80% transfer size reduction)
- Add `rel="preconnect"` for critical origins (100-500ms savings)

**1 Day Investments (⭐⭐⭐⭐ ROI):**
- Implement code splitting (30-50% bundle reduction)
- Optimize LCP image with `fetchpriority="high"` (200-400ms improvement)
- Add basic service worker (instant repeat visits)

**1 Week Comprehensive (⭐⭐⭐⭐⭐ ROI):**
- Full caching strategy (HTTP headers + service workers)
- Bundle optimization (tree shaking, 40-60% reduction)
- Performance monitoring (Lighthouse CI + RUM)

**→ See [quick-wins.md](./references/quick-wins.md) for complete implementation details**

## Core Web Vitals at a Glance

| Metric | Target | Weight | Key Optimization |
|--------|--------|--------|------------------|
| **LCP** (Largest Contentful Paint) | <2.5s | 25% | Optimize images, preload critical resources |
| **INP** (Interaction to Next Paint) | <200ms | 30% | Reduce JavaScript, break up long tasks |
| **CLS** (Cumulative Layout Shift) | <0.1 | 25% | Reserve space, optimize fonts |
| **TBT** (Total Blocking Time) | <200ms | 30% | Code splitting, defer non-critical JS |
| **FCP** (First Contentful Paint) | <1.8s | 10% | Eliminate render-blocking resources |

**→ See [core-web-vitals.md](./references/core-web-vitals.md) for deep dive on each metric**

## Modern Patterns (2025)

**View Transitions API** - Smooth page transitions without JavaScript
```css
@view-transition { navigation: auto; }
```

**Speculation Rules API** - Prerender pages for instant navigation  
**React Server Components** - Zero-bundle server components  
**Priority Hints** - `fetchpriority="high"` for LCP optimization  
**Content Visibility** - CSS-based rendering optimization

**→ See [modern-patterns-2025.md](./references/modern-patterns-2025.md) for cutting-edge techniques**

## Navigation

### Quick Start (Load First)
- **[⚡ Quick Wins](./references/quick-wins.md)** - Time-boxed optimizations (1hr/1day/1week) with ROI ratings. Load FIRST for immediate impact.

### Deep Dives
- **[📊 Core Web Vitals](./references/core-web-vitals.md)** - LCP, INP, CLS optimization strategies with debugging workflows. Load when targeting specific metrics.
- **[🔧 Optimization Techniques](./references/optimization-techniques.md)** - Image, JavaScript, CSS, resource loading, caching patterns. Load when implementing specific optimizations.

### Modern Features
- **[✨ Modern Patterns 2025](./references/modern-patterns-2025.md)** - View Transitions, Speculation Rules, RSC, Islands Architecture. Load when adopting cutting-edge patterns.

### Framework-Specific
- **[⚛️ Framework Patterns](./references/framework-specific.md)** - Next.js, React, Vue, Vite, Astro, SvelteKit optimizations. Load for your framework.

### Measurement & Monitoring
- **[📈 Monitoring](./references/monitoring.md)** - Lighthouse CI, RUM setup, performance budgets, debugging tools. Load when setting up continuous monitoring.

## Key Reminders

- **Measure first, optimize second** - Always baseline with Lighthouse/WebPageTest before changes
- **Focus on user-centric metrics** - Core Web Vitals > vanity metrics
- **Test on real devices** - 53% of mobile users abandon after 3 seconds
- **Monitor continuously** - Performance degrades over time without vigilance
- **Prioritize by ROI** - Start with Quick Wins (high impact, low effort)

## Red Flags

Stop and reconsider if:
- Optimizing without baseline measurement
- Focusing only on Lighthouse score (ignoring field data)
- Ignoring mobile performance (53% abandon rate after 3s)
- Loading all resources eagerly (no lazy loading)
- No caching strategy implemented
- Third-party scripts loaded synchronously
- Missing performance monitoring/budgets

## Integration with Other Skills

- **nextjs-core** - Next.js Image component, font optimization, static generation
- **react** - Component optimization, memoization, code splitting
- **vite** - Build optimization, chunk splitting
- **typescript-core** - Type-safe performance patterns

## Real-World Impact

**Conversion Impact:**
- Pinterest: 40% faster perceived wait = 15% more sign-ups + 15% more SEO traffic
- Zalando: 0.1s improvement = 0.7% revenue increase
- AutoAnything: 50% faster load = 12-13% sales increase

**SEO Impact:**
- Core Web Vitals are ranking factors (June 2021+)
- 75% of users passing Core Web Vitals = ranking boost
- Mobile-first indexing prioritizes mobile performance

---

**Remember:** Performance is a feature, not an afterthought. Every millisecond counts. Start with Quick Wins for immediate impact.

© bobmatnyc · MIT · bobmatnyc/claude-mpm-skills

Similar skills

Everything for Frontend and UI →

web-performance-optimization by other authors comes first.

web-performance-optimization aj-geddes A skill for speeding up web apps: code splitting, lazy loading, caching, compression and monitoring. Useful when pages load slowly. CX Codex +1 482installs web-performance-optimization secondsky A skill that walks your agent through code splitting, lazy loading, caching and Core Web Vitals monitoring for web apps. CX Codex +1 557installs web-performance-optimization davila7 A Claude skill that walks through why a site loads slowly and fixes the bottlenecks step by step. 3,490installs frontend-design official anthropics This skill guides intentional visual design for new interfaces and redesigns. Use it when a generic generated UI is not enough. 1,025,790installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. CX Codex +1 678,700installs prototype Matt Pocock Creates throwaway prototypes for checking state logic or exploring UI before committing the decision to the main codebase. 986,201installs hyperframes heygen-com Instructs coding agents on creating, validating, and rendering HTML-based videos using the HyperFrames framework and CLI. CX Codex +1 1,200,000installs hyperframes-cli heygen-com Controls HyperFrames video workflows from the CLI: audits layouts and contrast, edits timeline clips, captures snapshots, and renders locally or in cloud runtimes. CX Codex +1 1,300,000installs webapp-testing official anthropics This skill tests local web apps with Playwright, helping agents debug UI behavior, capture screenshots, and inspect browser logs. 186,758installs

From the same set73

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor