addyosmani avatar

Performance Optimization

This is the performance optimization workflow distilled: measure first, identify the actual bottleneck, fix it, verify the improvement, then add guards against regression. The guide is opinionated about avoiding premature optimization and pairs synthetic testing (Lighthouse, DevTools) with real user monitoring. It includes Core Web Vitals thresholds, a decision tree for diagnosing what's slow (first load vs interaction vs backend), and fixes for common anti-patterns like N+1 queries, missing image optimization, and unnecessary React re-renders. The picture element example alone is worth having around. Use this when you have evidence of a performance problem, not when you're guessing one might exist someday.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
5
skills.sh installs
75.2K
GitHub stars
114.6K
last updated
Aug 21, 2026

Install

$ npx -y skills add addyosmani/agent-skills --skill performance-optimization --agent claude-code

Installs into .claude/skills of the current project.

Files

Performance Optimization

Overview

Measure before optimizing. Performance work without measurement is guessing — and guessing leads to premature optimization that adds complexity without improving what matters. Profile first, identify the actual bottleneck, fix it, measure again. Optimize only what measurements prove matters.

When to Use

  • Performance requirements exist in the spec (load time budgets, response time SLAs)
  • Users or monitoring report slow behavior
  • Core Web Vitals scores are below thresholds
  • You suspect a change introduced a regression
  • Building features that handle large datasets or high traffic

When NOT to use: Don't optimize before you have evidence of a problem. Premature optimization adds complexity that costs more than the performance it gains.

Core Web Vitals Targets

MetricGoodNeeds ImprovementPoor
LCP (Largest Contentful Paint)≤ 2.5s≤ 4.0s> 4.0s
INP (Interaction to Next Paint)≤ 200ms≤ 500ms> 500ms
CLS (Cumulative Layout Shift)≤ 0.1≤ 0.25> 0.25

The Optimization Workflow

Sponsors

Details

Repository
github.com/addyosmani/agent-skills
Categories
Frontend Development, Backend & APIs, AI & Agent Building, Debugging
First seen
May 16, 2026

More from addyosmani/agent-skills

All 25
1addyosmani avatarapi-and-interface-designaddyosmani/agent-skillsGuides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defini72.4Kskills.sh installs
2heygen-com avataranimejsheygen-com/hyperframesAnime.js adapter patterns for HyperFrames. Use when writing Anime.js animations or timelines inside HyperFrames compositions, registering animations on window._70Kskills.sh installs
3heygen-com avatarcontribute-catalogheygen-com/hyperframesAuthor a new HyperFrames registry block (caption style, VFX block, transition, lower third) or component (text effect, overlay, snippet) and ship it as an upstr55.5Kskills.sh installs
4jakubkrehel avatarbetter-uijakubkrehel/skillsDesign engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover stat45.8Kskills.sh installs
5antfu avatarviteantfu/skillsVite build tool configuration, plugin API, SSR, and Vite 8 Rolldown migration. Use when working with Vite projects, vite.config.ts, Vite plugins, or building li41.7Kskills.sh installs
6jakubkrehel avatarbetter-typographyjakubkrehel/skillsWeb typography from choosing fonts to spacing, wrapping and accessibility. Use when picking or pairing typefaces, configuring variable fonts or OpenType feature40.5Kskills.sh installs