# Performance optimization

> Performance optimization is an open-source agent skill for developer tools. Guides an agent to measure, find and fix web and database performance bottlenecks. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/addyosmani/agent-skills/tree/main/skills/performance-optimization
- **Repository:** https://github.com/addyosmani/agent-skills
- **GitHub stars:** 122,283
- **License:** MIT
- **Skill name:** performance-optimization
- **Collection:** https://github.com/addyosmani/agent-skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill walks an agent through a measure-first performance workflow: establish a baseline, locate the real bottleneck, apply a targeted fix, re-measure, and keep or revert the change. It covers frontend concerns such as Core Web Vitals targets, image handling, re-renders and bundle size, and backend concerns such as N+1 queries, pagination, index selection, connection pools and caching.

The guidance is strict about evidence. It asks the agent to prefer Lighthouse and DevTools traces for controlled tests and web-vitals or CrUX data for real users, to compare changes against run-to-run variance, and to log rejected experiments so they are not repeated. It also lists default budgets for bundle size, CSS, images, fonts, API latency and Lighthouse score, with CI commands for bundlesize and Lighthouse CI.

The skill ships a references folder with worked patterns and a performance checklist. The instructions assume a JavaScript or web stack with access to a profiler, browser developer tools and a database that supports EXPLAIN ANALYZE.

## When your agent uses it

> 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. Use when asked why code is slow or how to make it fast, even when the code is pasted inline and the fix looks obvious.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/addyosmani/agent-skills/tree/HEAD/skills/performance-optimization)
- [License: MIT](https://github.com/addyosmani/agent-skills/tree/HEAD/skills/performance-optimization)

## Features

- **Measure-first workflow:** A five-step loop of measuring, identifying, fixing, verifying and guarding performance changes.
- **Core Web Vitals targets:** Good, needs-improvement and poor thresholds for LCP, INP and CLS.
- **Backend anti-patterns:** Guidance on N+1 queries, unbounded fetches, index use, pool exhaustion and caching mistakes.
- **Frontend fixes:** Covers image sizing and lazy loading, unnecessary re-renders and route-level code splitting.
- **Keep or revert rules:** Criteria for accepting an optimization only when it beats noise and keeps tests green.
- **Performance budgets in CI:** Suggested budgets for bundle size, API latency and Lighthouse scores, enforced with bundlesize and Lighthouse CI.

## Good for

- Find out why an API endpoint is slow under load
- Fix N+1 queries in a list view
- Improve Core Web Vitals on a landing page
- Decide whether a database index is worth adding
- Set up a performance budget for a frontend build
- Track rejected optimization attempts in a PERF.md file

## Install

### Claude Code

This skill ships in the `agent-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add chrisalehman/bionic
/plugin install agent-skills@bionic
```

Or copy only this skill to `~/.claude/skills/performance-optimization`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/performance-optimization &&
cp -R "$tmp/skills/performance-optimization" ~/.claude/skills/performance-optimization &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/performance-optimization` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/performance-optimization` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/performance-optimization &&
cp -R "$tmp/skills/performance-optimization" ~/.agents/skills/performance-optimization &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/performance-optimization` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/performance-optimization` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/performance-optimization &&
cp -R "$tmp/skills/performance-optimization" ~/.cursor/skills/performance-optimization &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/performance-optimization` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/addyosmani/agent-skills.git --path skills/performance-optimization
```

Or copy the folder to `~/.gemini/skills/performance-optimization` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/performance-optimization`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/performance-optimization &&
cp -R "$tmp/skills/performance-optimization" ~/.copilot/skills/performance-optimization &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/performance-optimization` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/addyosmani/agent-skills.git
```

Then copy `agent-skills/skills/performance-optimization` into your agent's skills folder as `performance-optimization`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Performance optimization trigger?

It applies when performance requirements exist, when regressions are suspected, when Core Web Vitals or load times need work, when N+1 query patterns need fixing, when profiling shows bottlenecks, or when someone asks why code is slow, even if the code is pasted inline.

### Does Performance optimization install any scripts or tools?

No scripts are included. It refers to external tools such as Lighthouse, web-vitals, bundlesize and Lighthouse CI, and suggests running them through npx.

### Does Performance optimization need specific tools or languages?

It names browser DevTools, the web-vitals library, EXPLAIN ANALYZE for SQL databases, and Lighthouse CI. Examples use JavaScript, and the guidance covers both frontend and backend code.

### Where are the detailed fixes?

Detailed worked patterns are in references/optimization-patterns.md, and a broader checklist is in references/shared/performance-checklist.md.

### How do I install Performance optimization in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/performance-optimization to use it in all your projects, or to .claude/skills/performance-optimization in one project. Or install the agent-skills plugin, which includes it: /plugin marketplace add chrisalehman/bionic, then /plugin install agent-skills@bionic.

### Does Performance optimization run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Performance optimization?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Performance optimization?

The closest alternatives to Performance optimization are Performance audit edho ferdian, Performance, Frontend perf, Performance reasoning and Optimize.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Performance audit edho ferdian](https://ai-powered.com/skills/performance-audit-edho-ferdian): Performance audit edho ferdian is an open-source agent skill for developer tools.
- [Performance](https://ai-powered.com/skills/performance): Performance is an open-source agent skill for developer tools.
- [Frontend perf](https://ai-powered.com/skills/frontend-perf): Frontend perf is an open-source agent skill for developer tools.
- [Performance reasoning](https://ai-powered.com/skills/performance-reasoning): Performance reasoning is an open-source agent skill for developer tools.
- [Optimize](https://ai-powered.com/skills/optimize-jasgujral): Optimize is an open-source agent skill for developer tools.
- [Web perf](https://ai-powered.com/skills/web-perf): Web perf is an open-source agent skill for developer tools.
- [Benchmark checklist](https://ai-powered.com/skills/benchmark-checklist): Benchmark checklist is an open-source agent skill for developer tools.
- [Go performance review](https://ai-powered.com/skills/go-performance-review): Go performance review is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/performance-optimization
