# web-performance-optimization

A Claude skill that walks through why a site loads slowly and fixes the bottlenecks step by step.

- skill · `type=skill` · Claude Code · 3490 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/web-development/web-performance-optimization
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/web-performance-optimization

## What it does

The skill runs the agent through five stages: capture a baseline (Lighthouse, LCP, FID, CLS, bundle sizes, network waterfall), find the problems, rank them, apply fixes, then re-measure. The examples cover the usual suspects — a 2.5MB hero image, an 850KB JavaScript bundle blocking the main thread, render-blocking scripts, images without dimensions that shift the layout.

Fixes are concrete. Serve images as AVIF and WebP with `width` and `height` set, split code with `lazy` and `dynamic`, swap moment for date-fns, import single lodash functions instead of the whole library, add `defer` to analytics. For CLS there is a skeleton loader that reserves space before content arrives.

Verification loops back: re-run Lighthouse, compare before and after, check real user metrics, test on different devices and networks. The skill will not hand you a bundler config — it works out what is slow and proposes the steps. Without access to production metrics, some conclusions stay at the level of local measurements.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill web-development/web-performance-optimization
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill web-performance-optimization -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/web-performance-optimization/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/web-performance-optimization/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/web-performance-optimization/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/web-performance-optimization/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates web-performance-optimization
```

2. **Manually: put the files in place**
- File: `.github/skills/web-performance-optimization/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/web-development/web-performance-optimization
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/web-performance-optimization/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/web-development/web-performance-optimization

## When to use it
- find out why a page loads slowly
- bring LCP, FID and CLS into the green
- shrink a JavaScript bundle
- stop layout shifts from images without dimensions
- get ready for a performance audit

## Example prompts
- run a performance audit on my site and show me what's slow
- why is my LCP 4.2s — break it down and suggest fixes
- cut my bundle size: check the dependencies and tell me what to replace

## Similar
- [performance-optimization](https://affpapa.org/en/nevibecode/skills/performance-optimization.md) — skill · 65200 installs
- [web-performance-audit](https://affpapa.org/en/nevibecode/skills/secondsky-web-performance-audit.md) — skill · 526 installs
- [auditing-performance](https://affpapa.org/en/nevibecode/skills/auditing-performance.md) — skill · 476 installs
- [web-perf](https://affpapa.org/en/nevibecode/skills/web-perf.md) — skill · 5 installs
- [performance-and-web-vitals](https://affpapa.org/en/nevibecode/skills/performance-and-web-vitals.md) — skill · 975 installs
- [Frontend Performance Investigator](https://affpapa.org/en/nevibecode/agents/frontend-performance-investigator.md) — subagent · ★ 40418

## Other versions with the same name
- [web-performance-optimization · aj-geddes](https://affpapa.org/en/nevibecode/skills/aj-geddes-web-performance-optimization.md) — 482 installs
- [web-performance-optimization · secondsky](https://affpapa.org/en/nevibecode/skills/secondsky-web-performance-optimization.md) — 557 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 205 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
