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.
npx skills add aj-geddes/useful-ai-prompts --skill web-performance-optimization -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/web-performance-optimization/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/web-performance-optimization/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill web-performance-optimization -a codex2Manually: put the files in place
.agents/skills/web-performance-optimization/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill web-performance-optimization -a cursor2Manually: put the files in place
.cursor/skills/web-performance-optimization/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts web-performance-optimization2Manually: put the files in place
.github/skills/web-performance-optimization/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill web-performance-optimization -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/web-performance-optimizationManually: put the files in place
.devin/skills/web-performance-optimization/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill web-performance-optimization -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.