# Performance Optimization (performance-optimization)

> Optimizes frontend, backend and database performance via a measure, identify, fix, verify and guard loop, keeping only changes that measure better.

- Category: [Performance](https://www.myskills.tools/en/categories/performance/)
- Source: Community · Addy Osmani
- Repository: https://github.com/addyosmani/agent-skills/tree/main/skills/performance-optimization (commit ee3e850)
- SKILL.md: https://github.com/addyosmani/agent-skills/blob/main/skills/performance-optimization/SKILL.md
- Install command: `npx skills add addyosmani/agent-skills --skill performance-optimization`
- License: MIT
- Compatible with: Claude Code, Codex, Cursor, Copilot, Gemini CLI
- Permissions: read-repo ✓, write-files ✓, shell ✓, network ✗
- Status: Scan passed
- A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.

## Core rule

Measure before optimizing and keep only what re-measurement proves; a neutral change is a revert.

## Execution Phases

1. **Measure** — Establish a baseline with synthetic tools (Lighthouse, DevTools) and RUM (web-vitals, CrUX), using the symptom to decide what to measure first.
2. **Identify the bottleneck** — Match symptoms to likely causes such as N+1 queries, missing indexes, large bundles or long main-thread tasks.
3. **Fix one bottleneck** — Fix only what the previous step found, using the patterns for N+1, pagination, EXPLAIN ANALYZE, caching, images and bundles.
4. **Verify: keep or revert** — Re-measure under the same conditions against run-to-run variance; keep only if past the threshold with tests green, otherwise revert, and log every attempt.
5. **Guard against regression** — Add a synthetic CI budget (bundlesize, Lighthouse CI) and field monitoring for the user-facing metric.

## Permissions (summarised from SKILL.md)

| Capability | Needed | Details |
|---|---|---|
| File writes | Required | Edits application code, queries and config, and logs attempts in PERF.md or the PR description. |
| Command execution | Required | Runs measurement and test commands such as Lighthouse CI, bundlesize, EXPLAIN ANALYZE and the test suite. |
| Network outbound | Not required | The skill does not call external services; measurements target your own app. |

## SKILL.md frontmatter (YAML)

```yaml
---
name: performance-optimization
description: Optimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.
---
```

Home: https://www.myskills.tools/en/ · URL: https://www.myskills.tools/en/skills/performance-optimization/
