Skip to main content
skill CX Codex

web-performance-optimization · aj-geddes — Claude Code skill: Core Web Vitals

A skill for speeding up web apps: code splitting, lazy loading, caching, compression and monitoring. Useful when pages load slowly.

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

What web-performance-optimization does

The skill covers frontend performance across five areas: code splitting, lazy loading, image optimization, HTTP caching with service workers, gzip compression and monitoring. Each one gets a reference guide in the references/ directory, plus a minimal React example for lazy-loaded routes.

The Quick Start example wraps React.lazy and builds a route array where components load through dynamic import(). Full implementations live in the separate guide files, so you get direction rather than a drop-in config.

Everything here assumes React: the sample code and the guides are written for it. On Vue, Svelte or a different server-rendering stack you will port the advice by hand. Worth installing once you already know what is slow — a high LCP, a bloated bundle or layout shifts you can point at.

What it helps with

  • split a large bundle into chunks loaded per route
  • bring down Largest Contentful Paint on slow pages
  • set up HTTP caching and a service worker
  • turn on gzip compression for static assets
  • stop layout shifts while images load

Example prompts for the agent

  • figure out why the home page has a high LCP and tell me what to fix first
  • split the bundle by route with lazy loading in React
  • set up static asset caching and a service worker for offline use

How to install web-performance-optimization

1Skills CLI (Vercel)

npx skills add aj-geddes/useful-ai-prompts --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?

Run npx skills add aj-geddes/useful-ai-prompts --skill web-performance-optimization -a claude-code. The skill file then lands at ~/.claude/skills/web-performance-optimization/SKILL.md.

What does web-performance-optimization do?

It guides the agent through web app performance work: code splitting, lazy loading, image optimization, caching, compression and monitoring. It leans on reference guides in the references/ directory.

Which stack does this skill target?

The examples and guides are written for React. On other frameworks you will adapt the code splitting and lazy loading advice yourself.

Source text

SKILL.md · MIT
---
name: web-performance-optimization
description: >
  Optimize web application performance using code splitting, lazy loading,
  caching, compression, and monitoring. Use when improving Core Web Vitals and
  user experience.
---

# Web Performance Optimization

## Table of Contents

- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)

## Overview

Implement performance optimization strategies including lazy loading, code splitting, caching, compression, and monitoring to improve Core Web Vitals and user experience.

## When to Use

- Slow page load times
- High Largest Contentful Paint (LCP)
- Large bundle sizes
- Frequent Cumulative Layout Shift (CLS)
- Mobile performance issues

## Quick Start

Minimal working example:

```typescript
// utils/lazyLoad.ts
import React from 'react';

export const lazyLoad = (importStatement: Promise<any>) => {
  return React.lazy(() =>
    importStatement.then(module => ({
      default: module.default
    }))
  );
};

// routes.tsx
import { lazyLoad } from './utils/lazyLoad';

export const routes = [
  {
    path: '/',
    component: () => import('./pages/Home'),
    lazy: lazyLoad(import('./pages/Home'))
  },
  {
    path: '/dashboard',
    lazy: lazyLoad(import('./pages/Dashboard'))
  },
  {
// ... (see reference guides for full implementation)
```

## Reference Guides

Detailed implementations in the `references/` directory:

| Guide | Contents |
|---|---|
| [Code Splitting and Lazy Loading (React)](references/code-splitting-and-lazy-loading-react.md) | Code Splitting and Lazy Loading (React) |
| [Image Optimization](references/image-optimization.md) | Image Optimization |
| [HTTP Caching and Service Workers](references/http-caching-and-service-workers.md) | HTTP Caching and Service Workers |
| [Gzip Compression and Asset Optimization](references/gzip-compression-and-asset-optimization.md) | Gzip Compression and Asset Optimization |
| [Performance Monitoring](references/performance-monitoring.md) | Performance Monitoring |

## Best Practices

### ✅ DO

- Follow established patterns and conventions
- Write clean, maintainable code
- Add appropriate documentation
- Test thoroughly before deploying

### ❌ DON'T

- Skip testing or validation
- Ignore error handling
- Hard-code configuration values

© aj-geddes · MIT · aj-geddes/useful-ai-prompts

Similar skills

Everything for Frontend and UI →

web-performance-optimization by other authors comes first.

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 nextjs-performance giuseppe-trisciuoglio A Next.js optimization skill: Core Web Vitals, images and fonts, caching, streaming, bundle size. Useful when pages feel slow and you need a starting point. CX Codex +1 4,900installs vite-bundle-optimization patterns.dev A skill with bundle and build optimization patterns for Vite + React. Useful when builds drag or chunks come out larger than expected. CX Codex +1 667installs performance-optimization addyosmani An agent skill that measures before it changes code: Core Web Vitals budgets, N+1 queries, missing indexes and slow endpoints. CX Codex +1 65,200installs web-performance-audit secondsky A skill that audits page speed: pulls Core Web Vitals, finds bottlenecks and points at what to fix. Useful when LCP or CLS drifts out of range. CX Codex +1 526installs auditing-performance spencerpauly A skill that audits app performance: bundle size, rendering, database queries and Core Web Vitals. Useful when pages load slowly or the UI stutters. CX Codex +1 476installs react-performance-optimization NickCrew Guides React rendering optimization, memoization, code splitting, and list virtualization. Useful when diagnosing slow components or trimming initial bundle size. CX Codex +1 1,900installs

From the same set118

nosql-database-design Guides the agent through NoSQL schema work: MongoDB collections, DynamoDB tables, embedding vs referencing, indexes. Useful before the schema hardens in code. CX Codex +1 486installs database-indexing-strategy A skill for planning indexes: picks the type, builds composite and partial ones, covers maintenance. Useful when queries slow down. CX Codex +1 486installs uptime-monitoring A skill that walks your coding agent through uptime checks, a public status page and incident tracking. Useful when you need to know which dependency actually broke. CX Codex +1 484installs api-response-optimization A coding-agent skill that trims payloads, adds caching and compression, and gives you a checklist for slow API endpoints. CX Codex +1 484installs background-job-processing A skill for wiring up background job processing: task queues, workers, scheduling and retries. Useful when emails, reports or large exports should not block the request path. CX Codex +1 483installs accessibility-compliance This skill guides accessibility work for WCAG 2.1/2.2, keyboard navigation, screen readers and a11y checks in web interfaces. CX Codex +1 482installs git-workflow-strategy A skill that helps your agent pick a branching model and walk a feature, release or hotfix through the right steps. Useful when the team has no shared branch rules. CX Codex +1 482installs frontend-state-management A skill that guides your agent through frontend state management: Redux, MobX, Zustand or the Context API. CX Codex +1 480installs

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