Creator · addyosmani
Last updated · Sep 1, 2026
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 revea
Creator · addyosmani
Last updated · Sep 1, 2026
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 revea
Creator · addyosmani
Last updated · Sep 1, 2026
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 revea
Creator · addyosmani
Last updated · Sep 1, 2026
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 revea
Sandbox only
Install targets
Codex install prompt
Install the "performance-optimization" agent skill from https://github.com/addyosmani/agent-skills/tree/main/skills/performance-optimization. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"addyosmani-performance-optimization","task":"Install performance-optimization","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add addyosmani/agent-skills --skill performance-optimization
Maintenance
fresh
8d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
91K
95/100 Quality · 81/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
ExcellentHigh-confidence pick with strong adoption and healthy maintenance signals.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
91K GitHub stars
Repo activity
91K stars, 9.8K forks
Maintenance
8d since push
License
MIT
Install
npx skills add addyosmani/agent-skills --skill performance-optimization
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add addyosmani/agent-skills --skill performance-optimizationDo not use when
Alternative
1.9K Stars
npx skills add yanliudesign/mono-color-skill --skill mono-color
Alternative
61.0K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
28.0K Stars
npx skills add assafelovic/gpt-researcher
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/addyosmani-performance-optimization/install
Agent should check
Copy prompt
Task: Use performance-optimization in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/addyosmani-performance-optimization/install
Install command: npx skills add addyosmani/agent-skills --skill performance-optimization
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/addyosmani-performance-optimization/install
LLM text format
/api/skills/addyosmani-performance-optimization/install?format=text
Find alternatives
/api/skills/search?q=performance-optimization&limit=3
Agent prompt
Use performance-optimization for this task. Review https://www.openagentskill.com/api/skills/addyosmani-performance-optimization/install, then install with: npx skills add addyosmani/agent-skills --skill performance-optimizationRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/addyosmani-performance-optimization
LLM text
/api/registry/manifest/addyosmani-performance-optimization?format=text
Install alias
/api/registry/install/addyosmani-performance-optimization
Recommend
/api/registry/recommend?task=Use%20performance-optimization%20in%20an%20agent%20workflow&limit=3
Agent fit
Research agents
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Research agents
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS91K GitHub stars
Stars/forks activity
PASS91K stars, 9.8K forks; issue activity unavailable in current metadata
Recent maintenance
PASS8d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
High-confidence pick with strong adoption and healthy maintenance signals.
Workflow fit
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Workflow fit
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills for Claude Code: research → write → review → revise → finalize
Run autonomous deep research over web and local sources
--- 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. ---
# 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
| Metric | Good | Needs Improvement | Poor | |--------|------|-------------------|------| | **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
``` 1. MEASURE → Establish baseline with real data 2. IDENTIFY → Find the actual bottleneck (not assumed) 3. FIX → Address the specific bottleneck 4. VERIFY → Measure again; keep or revert 5. GUARD → Add monitoring or tests to prevent regression ```
### Step 1: Measure
Two complementary approaches — use both:
- **Synthetic (Lighthouse, DevTools Performance tab):** Controlled conditions, reproducible. Best for CI regression detection and isolating specific issues. - **RUM (web-vitals library, CrUX):** Real user data in real conditions. Required to validate that a fix actually improved user experience.
**Frontend:** ```bash # Synthetic: Lighthouse in Chrome DevTools (or CI) # Chrome DevTools → Performance tab → Record # Chrome DevTools MCP → Performance trace
# RUM: Web Vitals library in code import { onLCP, onINP, onCLS } from 'web-vitals';
onLCP(console.log); onINP(console.log); onCLS(console.log); ```
**Backend:** ```bash # Response time logging # Application Performance Monitoring (APM) # Database query logging with timing
# Simple timing console.time('db-query'); const result = await db.query(...); console.timeEnd('db-query'); ```
### Where to Start Measuring
Use the symptom to decide what to measure first:
``` What is slow? ├── First page load │ ├── Large bundle? --> Measure bundle size, check code splitting │ ├── Slow server response? --> Measure TTFB in DevTools Network waterfall │ │ ├── DNS long? --> Add dns-prefetch / preconnect for known origins │ │ ├── TCP/TLS long? --> Enable HTTP/2, check edge deployment, keep-alive │ │ └── Waiting (server) long? --> Profile backend, check queries and caching │ └── Render-blocking resources? --> Check network waterfall for CSS/JS blocking ├── Interaction feels sluggish │ ├── UI freezes on click? --> Profile main thread, look for long tasks (>50ms) │ ├── Form input lag? --> Check re-renders, controlled component overhead │ └── Animation jank? --> Check layout thrashing, forced reflows ├── Page after navigation │ ├── Data loading? --> Measure API response times, check for waterfalls │ └── Client rendering? --> Profile component render time, check for N+1 fetches └── Backend / API ├── Single endpoint slow? --> Profile database queries, check indexes ├── All endpoints slow? --> Check connection pool, memory, CPU └── Intermittent slowness? --> Check for lock contention, GC pauses, external deps ```
### Step 2: Identify the Bottleneck
Common bottlenecks by category:
**Frontend:**
| Symptom | Likely Cause | Investigation | |---------|-------------|---------------| | Slow LCP | Large images, render-blocking resources, slow server | Check network waterfall, image sizes | | High CLS | Images without dimensions, late-loading content, font shifts | Check layout shift attribution | | Poor INP | Heavy JavaScript on main thread, large DOM updates | Check long tasks in Performance trace | | Slow initial load | Large bundle, many network requests | Check bundle size, code splitting |
**Backend:**
| Symptom | Likely Cause | Investigation | |---------|-------------|---------------| | Slow API responses | N+1 queries, missing indexes, unoptimized queries | Check database query log | | Memory growth | Leaked references, unbounded caches, large payloads | Heap snapshot analysis | | CPU spikes | Synchronous heavy computation, regex backtracking | CPU profiling | | High latency | Missing caching, redundant computation, network hops | Trace requests through the stack |
### Step 3: Fix Common Anti-Patterns
#### N+1 Queries (Backend)
```typescript // BAD: N+1 — one query per task for the owner const tasks = await db.tasks.findMany(); for (const task of tasks) { task.owner = await db.users.findUnique({ where: { id: task.ownerId } }); }
// GOOD: Single query with join/include const tasks = await db.tasks.findMany({ include: { owner: true }, }); ```
#### Unbounded Data Fetching
```typescript // BAD: Fetching all records const allTasks = await db.tasks.findMany();
// GOOD: Paginated with limits const tasks = await db.tasks.findMany({ take: 20, skip: (page - 1) * 20, orderBy: { createdAt: 'desc' }, }); ```
#### Queries That Ignore Their Index
"Add an index" is the guess. The query plan is the measurement:
```sql EXPLAIN ANALYZE SELECT id, title FROM tasks WHERE owner_id = 42 ORDER BY created_at DESC LIMIT 20; ```
Three things in the output decide the fix:
| What you see | What it means | |---|---| | `Seq Scan` on a large table where you expected an index | No usable index for this predicate | | Estimated `rows=` off from actual by an order of magnitude | Stale statistics; the planner is choosing on bad information | | A `Sort` node above the scan | The index covers the filter but not the `ORDER BY` |
Index for the **shape of the query**, not the column in isolation. In a composite index, equality columns come first, then the range or sort column:
```sql CREATE INDEX idx_tasks_owner_created ON tasks (owner_id, created_at DESC); ```
**When an index will not help:**
| Situation | Why | |---|---| | Low selectivity, querying the dominant value (a `status` column that is 95% `active`, filtered on `active`) | A sequential scan is genuinely cheaper; the planner will ignore the index. Filtering on the rare value is the opposite case, and a partial index serves it well | | Leading wildcard (`LIKE '%term'`) | A B-tree cannot seek without a prefix; needs trigram or full-text | | Function on the column (`WHERE lower(email) = ?`) | The plain column index is unusable; index the expression instead | | Write-heavy table | Every index is a tax on every `INSERT`/`UPDATE`; measure the write cost, not just the read gain |
Re-run `EXPLAIN ANALYZE` after. An index that did not change the plan is a revert (Step 4), and it is not free: it still costs on every write.
#### Connection Pool Exhaustion
The signature is distinctive: **every** endpoint slows at once, the slow time is spent waiting for a connection rather than executing, and the database reports mostly idle sessions.
```typescript // BAD: a pool per request or per module — under serverless this multiplies // by instance count and exhausts the database's connection limit // GOOD: one pool per process, sized against the database's ceiling const pool = new Pool({ max: 10, // instances × max must stay under max_connections idleTimeoutMillis: 30_000, connectionTimeoutMillis: 5_000, // fail fast instead of queueing forever }); ```
**Bigger is not faster.** A pool larger than what the database can execute concurrently just relocates the queue from your app to the database, where it is harder to see. When instance count is unbounded (serverless, autoscaling), a proxy that multiplexes connections (pgbouncer, RDS Proxy) is the fix, not a higher `max`.
#### Missing Image Optimization (Frontend)
```html <!-- BAD: No dimensions, no format optimization --> <img src="/hero.jpg" />
<!-- GOOD: Hero / LCP image — art direction + resolution switching, high priority --> <!-- Two techniques combined: - Art direction (media): different crop/composition per breakpoint - Resolution switching (srcset + sizes): right file size per screen density --> <picture> <!-- Mobile: portrait crop (8:10) --> <source media="(max-width: 767px)" srcset="/hero-mobile-400.avif 400w, /hero-mobile-800.avif 800w" sizes="100vw" width="800" height="1000" type="image/avif" /> <source media="(max-width: 767px)" srcset="/hero-mobile-400.webp 400w, /hero-mobile-800.webp 800w" sizes="100vw" width="800" height="1000" type="image/webp" /> <!-- Desktop: landscape crop (2:1) --> <source srcset="/hero-800.avif 800w, /hero-1200.avif 1200w, /hero-1600.avif 1600w" sizes="(max-width: 1200px) 100vw, 1200px" width="1200" height="600" type="image/avif" /> <source srcset="/hero-800.webp 800w, /hero-1200.webp 1200w, /hero-1600.webp 1600w" sizes="(max-width: 1200px) 100vw, 1200px" width="1200" height="600" type="image/webp" /> <img src="/hero-desktop.jpg" width="1200" height="600" fetchpriority="high" alt="Hero image description" /> </picture>
<!-- GOOD: Below-the-fold image — lazy loaded + async decoding --> <img src="/content.webp" width="800" height="400" loading="lazy" decoding="async" alt="Content image description" /> ```
#### Unnecessary Re-renders (React)
```tsx // BAD: Creates new object on every render, causing children to re-render function TaskList() { return <TaskFilters options={{ sortBy: 'date', order: 'desc' }} />; }
// GOOD: Stable reference const DEFAULT_OPTIONS = { sortBy: 'date', order: 'desc' } as const; function TaskList() { return <TaskFilters options={DEFAULT_OPTIONS} />; }
// Use React.memo for expensive components const TaskItem = React.memo(function TaskItem({ task }: Props) { return <div>{/* expensive render */}</div>; });
// Use useMemo for expensive computations function TaskStats({ tasks }: Props) { const stats = useMemo(() => calculateStats(tasks), [tasks]); return <div>{stats.completed} / {stats.total}</div>; } ```
#### Large Bundle Size
```typescript // Modern bundlers (Vite, webpack 5+) handle named imports with tree-shaking automatically, // provided the dependency ships ESM and is marked `sideEffects: false` in package.json. // Profile before changing import styles — the real gains come from splitting and lazy loading.
// GOOD: Dynamic import for heavy, rarely-used features const ChartLibrary = lazy(() => import('./ChartLibrary'));
// GOOD: Route-level code splitting wrapped in Suspense const SettingsPage = lazy(() => import('./pages/Settings'));
function App() { return ( <Suspense fallback={<Spinner />}> <SettingsPage /> </Suspense> ); } ```
#### Missing Caching (Backend)
Cache what is expensive to produce and read far more often than it changes. Caching a query that was already fast adds a network hop, a staleness bug, and an eviction policy to maintain, in exchange for nothing.
**Pick the layer deliberately:**
| Layer | Visible to | Use when | Cost | |---|---|---|---| | In-process (`Map`, LRU) | One instance | Small, hot, per-instance staleness is acceptable | Each instance drifts independently; invalidation reaches only one | | Shared (Redis, Memcached) | All instances | Instances must agree, or the value is expensive to recompute | A network hop, and another serv
Source provenance
Decision snapshot
91,373 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for performance-optimization, ready for a manual X post.
performance-optimization: Optimizes application performance across frontend, backend, queries, and databases. Use when... 91.4K stars https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=x
Listing + install path for performance-optimization: https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=x Install: npx skills add addyosmani/agent-skills --skill performance-optimization
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to addyosmani but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization/audit)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)addyosmani
@addyosmani
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
mono-color
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
1.9K StarsLast30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
61.0K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K StarsGPT Researcher
Run autonomous deep research over web and local sources
28.0K StarsSandbox only
Install targets
Codex install prompt
Install the "performance-optimization" agent skill from https://github.com/addyosmani/agent-skills/tree/main/skills/performance-optimization. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"addyosmani-performance-optimization","task":"Install performance-optimization","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add addyosmani/agent-skills --skill performance-optimization
Maintenance
fresh
8d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
91K
95/100 Quality · 81/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
ExcellentHigh-confidence pick with strong adoption and healthy maintenance signals.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
91K GitHub stars
Repo activity
91K stars, 9.8K forks
Maintenance
8d since push
License
MIT
Install
npx skills add addyosmani/agent-skills --skill performance-optimization
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add addyosmani/agent-skills --skill performance-optimizationDo not use when
Alternative
1.9K Stars
npx skills add yanliudesign/mono-color-skill --skill mono-color
Alternative
61.0K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
28.0K Stars
npx skills add assafelovic/gpt-researcher
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/addyosmani-performance-optimization/install
Agent should check
Copy prompt
Task: Use performance-optimization in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/addyosmani-performance-optimization/install
Install command: npx skills add addyosmani/agent-skills --skill performance-optimization
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/addyosmani-performance-optimization/install
LLM text format
/api/skills/addyosmani-performance-optimization/install?format=text
Find alternatives
/api/skills/search?q=performance-optimization&limit=3
Agent prompt
Use performance-optimization for this task. Review https://www.openagentskill.com/api/skills/addyosmani-performance-optimization/install, then install with: npx skills add addyosmani/agent-skills --skill performance-optimizationRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/addyosmani-performance-optimization
LLM text
/api/registry/manifest/addyosmani-performance-optimization?format=text
Install alias
/api/registry/install/addyosmani-performance-optimization
Recommend
/api/registry/recommend?task=Use%20performance-optimization%20in%20an%20agent%20workflow&limit=3
Agent fit
Research agents
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Research agents
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS91K GitHub stars
Stars/forks activity
PASS91K stars, 9.8K forks; issue activity unavailable in current metadata
Recent maintenance
PASS8d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
High-confidence pick with strong adoption and healthy maintenance signals.
Workflow fit
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Workflow fit
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills for Claude Code: research → write → review → revise → finalize
Run autonomous deep research over web and local sources
--- 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. ---
# 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
| Metric | Good | Needs Improvement | Poor | |--------|------|-------------------|------| | **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
``` 1. MEASURE → Establish baseline with real data 2. IDENTIFY → Find the actual bottleneck (not assumed) 3. FIX → Address the specific bottleneck 4. VERIFY → Measure again; keep or revert 5. GUARD → Add monitoring or tests to prevent regression ```
### Step 1: Measure
Two complementary approaches — use both:
- **Synthetic (Lighthouse, DevTools Performance tab):** Controlled conditions, reproducible. Best for CI regression detection and isolating specific issues. - **RUM (web-vitals library, CrUX):** Real user data in real conditions. Required to validate that a fix actually improved user experience.
**Frontend:** ```bash # Synthetic: Lighthouse in Chrome DevTools (or CI) # Chrome DevTools → Performance tab → Record # Chrome DevTools MCP → Performance trace
# RUM: Web Vitals library in code import { onLCP, onINP, onCLS } from 'web-vitals';
onLCP(console.log); onINP(console.log); onCLS(console.log); ```
**Backend:** ```bash # Response time logging # Application Performance Monitoring (APM) # Database query logging with timing
# Simple timing console.time('db-query'); const result = await db.query(...); console.timeEnd('db-query'); ```
### Where to Start Measuring
Use the symptom to decide what to measure first:
``` What is slow? ├── First page load │ ├── Large bundle? --> Measure bundle size, check code splitting │ ├── Slow server response? --> Measure TTFB in DevTools Network waterfall │ │ ├── DNS long? --> Add dns-prefetch / preconnect for known origins │ │ ├── TCP/TLS long? --> Enable HTTP/2, check edge deployment, keep-alive │ │ └── Waiting (server) long? --> Profile backend, check queries and caching │ └── Render-blocking resources? --> Check network waterfall for CSS/JS blocking ├── Interaction feels sluggish │ ├── UI freezes on click? --> Profile main thread, look for long tasks (>50ms) │ ├── Form input lag? --> Check re-renders, controlled component overhead │ └── Animation jank? --> Check layout thrashing, forced reflows ├── Page after navigation │ ├── Data loading? --> Measure API response times, check for waterfalls │ └── Client rendering? --> Profile component render time, check for N+1 fetches └── Backend / API ├── Single endpoint slow? --> Profile database queries, check indexes ├── All endpoints slow? --> Check connection pool, memory, CPU └── Intermittent slowness? --> Check for lock contention, GC pauses, external deps ```
### Step 2: Identify the Bottleneck
Common bottlenecks by category:
**Frontend:**
| Symptom | Likely Cause | Investigation | |---------|-------------|---------------| | Slow LCP | Large images, render-blocking resources, slow server | Check network waterfall, image sizes | | High CLS | Images without dimensions, late-loading content, font shifts | Check layout shift attribution | | Poor INP | Heavy JavaScript on main thread, large DOM updates | Check long tasks in Performance trace | | Slow initial load | Large bundle, many network requests | Check bundle size, code splitting |
**Backend:**
| Symptom | Likely Cause | Investigation | |---------|-------------|---------------| | Slow API responses | N+1 queries, missing indexes, unoptimized queries | Check database query log | | Memory growth | Leaked references, unbounded caches, large payloads | Heap snapshot analysis | | CPU spikes | Synchronous heavy computation, regex backtracking | CPU profiling | | High latency | Missing caching, redundant computation, network hops | Trace requests through the stack |
### Step 3: Fix Common Anti-Patterns
#### N+1 Queries (Backend)
```typescript // BAD: N+1 — one query per task for the owner const tasks = await db.tasks.findMany(); for (const task of tasks) { task.owner = await db.users.findUnique({ where: { id: task.ownerId } }); }
// GOOD: Single query with join/include const tasks = await db.tasks.findMany({ include: { owner: true }, }); ```
#### Unbounded Data Fetching
```typescript // BAD: Fetching all records const allTasks = await db.tasks.findMany();
// GOOD: Paginated with limits const tasks = await db.tasks.findMany({ take: 20, skip: (page - 1) * 20, orderBy: { createdAt: 'desc' }, }); ```
#### Queries That Ignore Their Index
"Add an index" is the guess. The query plan is the measurement:
```sql EXPLAIN ANALYZE SELECT id, title FROM tasks WHERE owner_id = 42 ORDER BY created_at DESC LIMIT 20; ```
Three things in the output decide the fix:
| What you see | What it means | |---|---| | `Seq Scan` on a large table where you expected an index | No usable index for this predicate | | Estimated `rows=` off from actual by an order of magnitude | Stale statistics; the planner is choosing on bad information | | A `Sort` node above the scan | The index covers the filter but not the `ORDER BY` |
Index for the **shape of the query**, not the column in isolation. In a composite index, equality columns come first, then the range or sort column:
```sql CREATE INDEX idx_tasks_owner_created ON tasks (owner_id, created_at DESC); ```
**When an index will not help:**
| Situation | Why | |---|---| | Low selectivity, querying the dominant value (a `status` column that is 95% `active`, filtered on `active`) | A sequential scan is genuinely cheaper; the planner will ignore the index. Filtering on the rare value is the opposite case, and a partial index serves it well | | Leading wildcard (`LIKE '%term'`) | A B-tree cannot seek without a prefix; needs trigram or full-text | | Function on the column (`WHERE lower(email) = ?`) | The plain column index is unusable; index the expression instead | | Write-heavy table | Every index is a tax on every `INSERT`/`UPDATE`; measure the write cost, not just the read gain |
Re-run `EXPLAIN ANALYZE` after. An index that did not change the plan is a revert (Step 4), and it is not free: it still costs on every write.
#### Connection Pool Exhaustion
The signature is distinctive: **every** endpoint slows at once, the slow time is spent waiting for a connection rather than executing, and the database reports mostly idle sessions.
```typescript // BAD: a pool per request or per module — under serverless this multiplies // by instance count and exhausts the database's connection limit // GOOD: one pool per process, sized against the database's ceiling const pool = new Pool({ max: 10, // instances × max must stay under max_connections idleTimeoutMillis: 30_000, connectionTimeoutMillis: 5_000, // fail fast instead of queueing forever }); ```
**Bigger is not faster.** A pool larger than what the database can execute concurrently just relocates the queue from your app to the database, where it is harder to see. When instance count is unbounded (serverless, autoscaling), a proxy that multiplexes connections (pgbouncer, RDS Proxy) is the fix, not a higher `max`.
#### Missing Image Optimization (Frontend)
```html <!-- BAD: No dimensions, no format optimization --> <img src="/hero.jpg" />
<!-- GOOD: Hero / LCP image — art direction + resolution switching, high priority --> <!-- Two techniques combined: - Art direction (media): different crop/composition per breakpoint - Resolution switching (srcset + sizes): right file size per screen density --> <picture> <!-- Mobile: portrait crop (8:10) --> <source media="(max-width: 767px)" srcset="/hero-mobile-400.avif 400w, /hero-mobile-800.avif 800w" sizes="100vw" width="800" height="1000" type="image/avif" /> <source media="(max-width: 767px)" srcset="/hero-mobile-400.webp 400w, /hero-mobile-800.webp 800w" sizes="100vw" width="800" height="1000" type="image/webp" /> <!-- Desktop: landscape crop (2:1) --> <source srcset="/hero-800.avif 800w, /hero-1200.avif 1200w, /hero-1600.avif 1600w" sizes="(max-width: 1200px) 100vw, 1200px" width="1200" height="600" type="image/avif" /> <source srcset="/hero-800.webp 800w, /hero-1200.webp 1200w, /hero-1600.webp 1600w" sizes="(max-width: 1200px) 100vw, 1200px" width="1200" height="600" type="image/webp" /> <img src="/hero-desktop.jpg" width="1200" height="600" fetchpriority="high" alt="Hero image description" /> </picture>
<!-- GOOD: Below-the-fold image — lazy loaded + async decoding --> <img src="/content.webp" width="800" height="400" loading="lazy" decoding="async" alt="Content image description" /> ```
#### Unnecessary Re-renders (React)
```tsx // BAD: Creates new object on every render, causing children to re-render function TaskList() { return <TaskFilters options={{ sortBy: 'date', order: 'desc' }} />; }
// GOOD: Stable reference const DEFAULT_OPTIONS = { sortBy: 'date', order: 'desc' } as const; function TaskList() { return <TaskFilters options={DEFAULT_OPTIONS} />; }
// Use React.memo for expensive components const TaskItem = React.memo(function TaskItem({ task }: Props) { return <div>{/* expensive render */}</div>; });
// Use useMemo for expensive computations function TaskStats({ tasks }: Props) { const stats = useMemo(() => calculateStats(tasks), [tasks]); return <div>{stats.completed} / {stats.total}</div>; } ```
#### Large Bundle Size
```typescript // Modern bundlers (Vite, webpack 5+) handle named imports with tree-shaking automatically, // provided the dependency ships ESM and is marked `sideEffects: false` in package.json. // Profile before changing import styles — the real gains come from splitting and lazy loading.
// GOOD: Dynamic import for heavy, rarely-used features const ChartLibrary = lazy(() => import('./ChartLibrary'));
// GOOD: Route-level code splitting wrapped in Suspense const SettingsPage = lazy(() => import('./pages/Settings'));
function App() { return ( <Suspense fallback={<Spinner />}> <SettingsPage /> </Suspense> ); } ```
#### Missing Caching (Backend)
Cache what is expensive to produce and read far more often than it changes. Caching a query that was already fast adds a network hop, a staleness bug, and an eviction policy to maintain, in exchange for nothing.
**Pick the layer deliberately:**
| Layer | Visible to | Use when | Cost | |---|---|---|---| | In-process (`Map`, LRU) | One instance | Small, hot, per-instance staleness is acceptable | Each instance drifts independently; invalidation reaches only one | | Shared (Redis, Memcached) | All instances | Instances must agree, or the value is expensive to recompute | A network hop, and another serv
Source provenance
Decision snapshot
91,373 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for performance-optimization, ready for a manual X post.
performance-optimization: Optimizes application performance across frontend, backend, queries, and databases. Use when... 91.4K stars https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=x
Listing + install path for performance-optimization: https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=x Install: npx skills add addyosmani/agent-skills --skill performance-optimization
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to addyosmani but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization/audit)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)addyosmani
@addyosmani
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
mono-color
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
1.9K StarsLast30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
61.0K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K StarsGPT Researcher
Run autonomous deep research over web and local sources
28.0K StarsSandbox only
Install targets
Codex install prompt
Install the "performance-optimization" agent skill from https://github.com/addyosmani/agent-skills/tree/main/skills/performance-optimization. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"addyosmani-performance-optimization","task":"Install performance-optimization","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add addyosmani/agent-skills --skill performance-optimization
Maintenance
fresh
8d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
91K
95/100 Quality · 81/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
ExcellentHigh-confidence pick with strong adoption and healthy maintenance signals.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
91K GitHub stars
Repo activity
91K stars, 9.8K forks
Maintenance
8d since push
License
MIT
Install
npx skills add addyosmani/agent-skills --skill performance-optimization
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add addyosmani/agent-skills --skill performance-optimizationDo not use when
Alternative
1.9K Stars
npx skills add yanliudesign/mono-color-skill --skill mono-color
Alternative
61.0K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
28.0K Stars
npx skills add assafelovic/gpt-researcher
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/addyosmani-performance-optimization/install
Agent should check
Copy prompt
Task: Use performance-optimization in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/addyosmani-performance-optimization/install
Install command: npx skills add addyosmani/agent-skills --skill performance-optimization
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/addyosmani-performance-optimization/install
LLM text format
/api/skills/addyosmani-performance-optimization/install?format=text
Find alternatives
/api/skills/search?q=performance-optimization&limit=3
Agent prompt
Use performance-optimization for this task. Review https://www.openagentskill.com/api/skills/addyosmani-performance-optimization/install, then install with: npx skills add addyosmani/agent-skills --skill performance-optimizationRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/addyosmani-performance-optimization
LLM text
/api/registry/manifest/addyosmani-performance-optimization?format=text
Install alias
/api/registry/install/addyosmani-performance-optimization
Recommend
/api/registry/recommend?task=Use%20performance-optimization%20in%20an%20agent%20workflow&limit=3
Agent fit
Research agents
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Research agents
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS91K GitHub stars
Stars/forks activity
PASS91K stars, 9.8K forks; issue activity unavailable in current metadata
Recent maintenance
PASS8d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
High-confidence pick with strong adoption and healthy maintenance signals.
Workflow fit
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Workflow fit
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills for Claude Code: research → write → review → revise → finalize
Run autonomous deep research over web and local sources
--- 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. ---
# 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
| Metric | Good | Needs Improvement | Poor | |--------|------|-------------------|------| | **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
``` 1. MEASURE → Establish baseline with real data 2. IDENTIFY → Find the actual bottleneck (not assumed) 3. FIX → Address the specific bottleneck 4. VERIFY → Measure again; keep or revert 5. GUARD → Add monitoring or tests to prevent regression ```
### Step 1: Measure
Two complementary approaches — use both:
- **Synthetic (Lighthouse, DevTools Performance tab):** Controlled conditions, reproducible. Best for CI regression detection and isolating specific issues. - **RUM (web-vitals library, CrUX):** Real user data in real conditions. Required to validate that a fix actually improved user experience.
**Frontend:** ```bash # Synthetic: Lighthouse in Chrome DevTools (or CI) # Chrome DevTools → Performance tab → Record # Chrome DevTools MCP → Performance trace
# RUM: Web Vitals library in code import { onLCP, onINP, onCLS } from 'web-vitals';
onLCP(console.log); onINP(console.log); onCLS(console.log); ```
**Backend:** ```bash # Response time logging # Application Performance Monitoring (APM) # Database query logging with timing
# Simple timing console.time('db-query'); const result = await db.query(...); console.timeEnd('db-query'); ```
### Where to Start Measuring
Use the symptom to decide what to measure first:
``` What is slow? ├── First page load │ ├── Large bundle? --> Measure bundle size, check code splitting │ ├── Slow server response? --> Measure TTFB in DevTools Network waterfall │ │ ├── DNS long? --> Add dns-prefetch / preconnect for known origins │ │ ├── TCP/TLS long? --> Enable HTTP/2, check edge deployment, keep-alive │ │ └── Waiting (server) long? --> Profile backend, check queries and caching │ └── Render-blocking resources? --> Check network waterfall for CSS/JS blocking ├── Interaction feels sluggish │ ├── UI freezes on click? --> Profile main thread, look for long tasks (>50ms) │ ├── Form input lag? --> Check re-renders, controlled component overhead │ └── Animation jank? --> Check layout thrashing, forced reflows ├── Page after navigation │ ├── Data loading? --> Measure API response times, check for waterfalls │ └── Client rendering? --> Profile component render time, check for N+1 fetches └── Backend / API ├── Single endpoint slow? --> Profile database queries, check indexes ├── All endpoints slow? --> Check connection pool, memory, CPU └── Intermittent slowness? --> Check for lock contention, GC pauses, external deps ```
### Step 2: Identify the Bottleneck
Common bottlenecks by category:
**Frontend:**
| Symptom | Likely Cause | Investigation | |---------|-------------|---------------| | Slow LCP | Large images, render-blocking resources, slow server | Check network waterfall, image sizes | | High CLS | Images without dimensions, late-loading content, font shifts | Check layout shift attribution | | Poor INP | Heavy JavaScript on main thread, large DOM updates | Check long tasks in Performance trace | | Slow initial load | Large bundle, many network requests | Check bundle size, code splitting |
**Backend:**
| Symptom | Likely Cause | Investigation | |---------|-------------|---------------| | Slow API responses | N+1 queries, missing indexes, unoptimized queries | Check database query log | | Memory growth | Leaked references, unbounded caches, large payloads | Heap snapshot analysis | | CPU spikes | Synchronous heavy computation, regex backtracking | CPU profiling | | High latency | Missing caching, redundant computation, network hops | Trace requests through the stack |
### Step 3: Fix Common Anti-Patterns
#### N+1 Queries (Backend)
```typescript // BAD: N+1 — one query per task for the owner const tasks = await db.tasks.findMany(); for (const task of tasks) { task.owner = await db.users.findUnique({ where: { id: task.ownerId } }); }
// GOOD: Single query with join/include const tasks = await db.tasks.findMany({ include: { owner: true }, }); ```
#### Unbounded Data Fetching
```typescript // BAD: Fetching all records const allTasks = await db.tasks.findMany();
// GOOD: Paginated with limits const tasks = await db.tasks.findMany({ take: 20, skip: (page - 1) * 20, orderBy: { createdAt: 'desc' }, }); ```
#### Queries That Ignore Their Index
"Add an index" is the guess. The query plan is the measurement:
```sql EXPLAIN ANALYZE SELECT id, title FROM tasks WHERE owner_id = 42 ORDER BY created_at DESC LIMIT 20; ```
Three things in the output decide the fix:
| What you see | What it means | |---|---| | `Seq Scan` on a large table where you expected an index | No usable index for this predicate | | Estimated `rows=` off from actual by an order of magnitude | Stale statistics; the planner is choosing on bad information | | A `Sort` node above the scan | The index covers the filter but not the `ORDER BY` |
Index for the **shape of the query**, not the column in isolation. In a composite index, equality columns come first, then the range or sort column:
```sql CREATE INDEX idx_tasks_owner_created ON tasks (owner_id, created_at DESC); ```
**When an index will not help:**
| Situation | Why | |---|---| | Low selectivity, querying the dominant value (a `status` column that is 95% `active`, filtered on `active`) | A sequential scan is genuinely cheaper; the planner will ignore the index. Filtering on the rare value is the opposite case, and a partial index serves it well | | Leading wildcard (`LIKE '%term'`) | A B-tree cannot seek without a prefix; needs trigram or full-text | | Function on the column (`WHERE lower(email) = ?`) | The plain column index is unusable; index the expression instead | | Write-heavy table | Every index is a tax on every `INSERT`/`UPDATE`; measure the write cost, not just the read gain |
Re-run `EXPLAIN ANALYZE` after. An index that did not change the plan is a revert (Step 4), and it is not free: it still costs on every write.
#### Connection Pool Exhaustion
The signature is distinctive: **every** endpoint slows at once, the slow time is spent waiting for a connection rather than executing, and the database reports mostly idle sessions.
```typescript // BAD: a pool per request or per module — under serverless this multiplies // by instance count and exhausts the database's connection limit // GOOD: one pool per process, sized against the database's ceiling const pool = new Pool({ max: 10, // instances × max must stay under max_connections idleTimeoutMillis: 30_000, connectionTimeoutMillis: 5_000, // fail fast instead of queueing forever }); ```
**Bigger is not faster.** A pool larger than what the database can execute concurrently just relocates the queue from your app to the database, where it is harder to see. When instance count is unbounded (serverless, autoscaling), a proxy that multiplexes connections (pgbouncer, RDS Proxy) is the fix, not a higher `max`.
#### Missing Image Optimization (Frontend)
```html <!-- BAD: No dimensions, no format optimization --> <img src="/hero.jpg" />
<!-- GOOD: Hero / LCP image — art direction + resolution switching, high priority --> <!-- Two techniques combined: - Art direction (media): different crop/composition per breakpoint - Resolution switching (srcset + sizes): right file size per screen density --> <picture> <!-- Mobile: portrait crop (8:10) --> <source media="(max-width: 767px)" srcset="/hero-mobile-400.avif 400w, /hero-mobile-800.avif 800w" sizes="100vw" width="800" height="1000" type="image/avif" /> <source media="(max-width: 767px)" srcset="/hero-mobile-400.webp 400w, /hero-mobile-800.webp 800w" sizes="100vw" width="800" height="1000" type="image/webp" /> <!-- Desktop: landscape crop (2:1) --> <source srcset="/hero-800.avif 800w, /hero-1200.avif 1200w, /hero-1600.avif 1600w" sizes="(max-width: 1200px) 100vw, 1200px" width="1200" height="600" type="image/avif" /> <source srcset="/hero-800.webp 800w, /hero-1200.webp 1200w, /hero-1600.webp 1600w" sizes="(max-width: 1200px) 100vw, 1200px" width="1200" height="600" type="image/webp" /> <img src="/hero-desktop.jpg" width="1200" height="600" fetchpriority="high" alt="Hero image description" /> </picture>
<!-- GOOD: Below-the-fold image — lazy loaded + async decoding --> <img src="/content.webp" width="800" height="400" loading="lazy" decoding="async" alt="Content image description" /> ```
#### Unnecessary Re-renders (React)
```tsx // BAD: Creates new object on every render, causing children to re-render function TaskList() { return <TaskFilters options={{ sortBy: 'date', order: 'desc' }} />; }
// GOOD: Stable reference const DEFAULT_OPTIONS = { sortBy: 'date', order: 'desc' } as const; function TaskList() { return <TaskFilters options={DEFAULT_OPTIONS} />; }
// Use React.memo for expensive components const TaskItem = React.memo(function TaskItem({ task }: Props) { return <div>{/* expensive render */}</div>; });
// Use useMemo for expensive computations function TaskStats({ tasks }: Props) { const stats = useMemo(() => calculateStats(tasks), [tasks]); return <div>{stats.completed} / {stats.total}</div>; } ```
#### Large Bundle Size
```typescript // Modern bundlers (Vite, webpack 5+) handle named imports with tree-shaking automatically, // provided the dependency ships ESM and is marked `sideEffects: false` in package.json. // Profile before changing import styles — the real gains come from splitting and lazy loading.
// GOOD: Dynamic import for heavy, rarely-used features const ChartLibrary = lazy(() => import('./ChartLibrary'));
// GOOD: Route-level code splitting wrapped in Suspense const SettingsPage = lazy(() => import('./pages/Settings'));
function App() { return ( <Suspense fallback={<Spinner />}> <SettingsPage /> </Suspense> ); } ```
#### Missing Caching (Backend)
Cache what is expensive to produce and read far more often than it changes. Caching a query that was already fast adds a network hop, a staleness bug, and an eviction policy to maintain, in exchange for nothing.
**Pick the layer deliberately:**
| Layer | Visible to | Use when | Cost | |---|---|---|---| | In-process (`Map`, LRU) | One instance | Small, hot, per-instance staleness is acceptable | Each instance drifts independently; invalidation reaches only one | | Shared (Redis, Memcached) | All instances | Instances must agree, or the value is expensive to recompute | A network hop, and another serv
Source provenance
Decision snapshot
91,373 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for performance-optimization, ready for a manual X post.
performance-optimization: Optimizes application performance across frontend, backend, queries, and databases. Use when... 91.4K stars https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=x
Listing + install path for performance-optimization: https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=x Install: npx skills add addyosmani/agent-skills --skill performance-optimization
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to addyosmani but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization/audit)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)addyosmani
@addyosmani
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
mono-color
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
1.9K StarsLast30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
61.0K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K StarsGPT Researcher
Run autonomous deep research over web and local sources
28.0K StarsSandbox only
Install targets
Codex install prompt
Install the "performance-optimization" agent skill from https://github.com/addyosmani/agent-skills/tree/main/skills/performance-optimization. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"addyosmani-performance-optimization","task":"Install performance-optimization","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add addyosmani/agent-skills --skill performance-optimization
Maintenance
fresh
8d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
91K
95/100 Quality · 81/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
ExcellentHigh-confidence pick with strong adoption and healthy maintenance signals.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
91K GitHub stars
Repo activity
91K stars, 9.8K forks
Maintenance
8d since push
License
MIT
Install
npx skills add addyosmani/agent-skills --skill performance-optimization
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add addyosmani/agent-skills --skill performance-optimizationDo not use when
Alternative
1.9K Stars
npx skills add yanliudesign/mono-color-skill --skill mono-color
Alternative
61.0K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
28.0K Stars
npx skills add assafelovic/gpt-researcher
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill may drive a browser or interact with web pages.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/addyosmani-performance-optimization/install
Agent should check
Copy prompt
Task: Use performance-optimization in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20performance-optimization%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/addyosmani-performance-optimization/install
Install command: npx skills add addyosmani/agent-skills --skill performance-optimization
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/addyosmani-performance-optimization/install
LLM text format
/api/skills/addyosmani-performance-optimization/install?format=text
Find alternatives
/api/skills/search?q=performance-optimization&limit=3
Agent prompt
Use performance-optimization for this task. Review https://www.openagentskill.com/api/skills/addyosmani-performance-optimization/install, then install with: npx skills add addyosmani/agent-skills --skill performance-optimizationRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/addyosmani-performance-optimization
LLM text
/api/registry/manifest/addyosmani-performance-optimization?format=text
Install alias
/api/registry/install/addyosmani-performance-optimization
Recommend
/api/registry/recommend?task=Use%20performance-optimization%20in%20an%20agent%20workflow&limit=3
Agent fit
Research agents
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Research agents
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS91K GitHub stars
Stars/forks activity
PASS91K stars, 9.8K forks; issue activity unavailable in current metadata
Recent maintenance
PASS8d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
High-confidence pick with strong adoption and healthy maintenance signals.
Workflow fit
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Workflow fit
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills for Claude Code: research → write → review → revise → finalize
Run autonomous deep research over web and local sources
--- 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. ---
# 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
| Metric | Good | Needs Improvement | Poor | |--------|------|-------------------|------| | **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
``` 1. MEASURE → Establish baseline with real data 2. IDENTIFY → Find the actual bottleneck (not assumed) 3. FIX → Address the specific bottleneck 4. VERIFY → Measure again; keep or revert 5. GUARD → Add monitoring or tests to prevent regression ```
### Step 1: Measure
Two complementary approaches — use both:
- **Synthetic (Lighthouse, DevTools Performance tab):** Controlled conditions, reproducible. Best for CI regression detection and isolating specific issues. - **RUM (web-vitals library, CrUX):** Real user data in real conditions. Required to validate that a fix actually improved user experience.
**Frontend:** ```bash # Synthetic: Lighthouse in Chrome DevTools (or CI) # Chrome DevTools → Performance tab → Record # Chrome DevTools MCP → Performance trace
# RUM: Web Vitals library in code import { onLCP, onINP, onCLS } from 'web-vitals';
onLCP(console.log); onINP(console.log); onCLS(console.log); ```
**Backend:** ```bash # Response time logging # Application Performance Monitoring (APM) # Database query logging with timing
# Simple timing console.time('db-query'); const result = await db.query(...); console.timeEnd('db-query'); ```
### Where to Start Measuring
Use the symptom to decide what to measure first:
``` What is slow? ├── First page load │ ├── Large bundle? --> Measure bundle size, check code splitting │ ├── Slow server response? --> Measure TTFB in DevTools Network waterfall │ │ ├── DNS long? --> Add dns-prefetch / preconnect for known origins │ │ ├── TCP/TLS long? --> Enable HTTP/2, check edge deployment, keep-alive │ │ └── Waiting (server) long? --> Profile backend, check queries and caching │ └── Render-blocking resources? --> Check network waterfall for CSS/JS blocking ├── Interaction feels sluggish │ ├── UI freezes on click? --> Profile main thread, look for long tasks (>50ms) │ ├── Form input lag? --> Check re-renders, controlled component overhead │ └── Animation jank? --> Check layout thrashing, forced reflows ├── Page after navigation │ ├── Data loading? --> Measure API response times, check for waterfalls │ └── Client rendering? --> Profile component render time, check for N+1 fetches └── Backend / API ├── Single endpoint slow? --> Profile database queries, check indexes ├── All endpoints slow? --> Check connection pool, memory, CPU └── Intermittent slowness? --> Check for lock contention, GC pauses, external deps ```
### Step 2: Identify the Bottleneck
Common bottlenecks by category:
**Frontend:**
| Symptom | Likely Cause | Investigation | |---------|-------------|---------------| | Slow LCP | Large images, render-blocking resources, slow server | Check network waterfall, image sizes | | High CLS | Images without dimensions, late-loading content, font shifts | Check layout shift attribution | | Poor INP | Heavy JavaScript on main thread, large DOM updates | Check long tasks in Performance trace | | Slow initial load | Large bundle, many network requests | Check bundle size, code splitting |
**Backend:**
| Symptom | Likely Cause | Investigation | |---------|-------------|---------------| | Slow API responses | N+1 queries, missing indexes, unoptimized queries | Check database query log | | Memory growth | Leaked references, unbounded caches, large payloads | Heap snapshot analysis | | CPU spikes | Synchronous heavy computation, regex backtracking | CPU profiling | | High latency | Missing caching, redundant computation, network hops | Trace requests through the stack |
### Step 3: Fix Common Anti-Patterns
#### N+1 Queries (Backend)
```typescript // BAD: N+1 — one query per task for the owner const tasks = await db.tasks.findMany(); for (const task of tasks) { task.owner = await db.users.findUnique({ where: { id: task.ownerId } }); }
// GOOD: Single query with join/include const tasks = await db.tasks.findMany({ include: { owner: true }, }); ```
#### Unbounded Data Fetching
```typescript // BAD: Fetching all records const allTasks = await db.tasks.findMany();
// GOOD: Paginated with limits const tasks = await db.tasks.findMany({ take: 20, skip: (page - 1) * 20, orderBy: { createdAt: 'desc' }, }); ```
#### Queries That Ignore Their Index
"Add an index" is the guess. The query plan is the measurement:
```sql EXPLAIN ANALYZE SELECT id, title FROM tasks WHERE owner_id = 42 ORDER BY created_at DESC LIMIT 20; ```
Three things in the output decide the fix:
| What you see | What it means | |---|---| | `Seq Scan` on a large table where you expected an index | No usable index for this predicate | | Estimated `rows=` off from actual by an order of magnitude | Stale statistics; the planner is choosing on bad information | | A `Sort` node above the scan | The index covers the filter but not the `ORDER BY` |
Index for the **shape of the query**, not the column in isolation. In a composite index, equality columns come first, then the range or sort column:
```sql CREATE INDEX idx_tasks_owner_created ON tasks (owner_id, created_at DESC); ```
**When an index will not help:**
| Situation | Why | |---|---| | Low selectivity, querying the dominant value (a `status` column that is 95% `active`, filtered on `active`) | A sequential scan is genuinely cheaper; the planner will ignore the index. Filtering on the rare value is the opposite case, and a partial index serves it well | | Leading wildcard (`LIKE '%term'`) | A B-tree cannot seek without a prefix; needs trigram or full-text | | Function on the column (`WHERE lower(email) = ?`) | The plain column index is unusable; index the expression instead | | Write-heavy table | Every index is a tax on every `INSERT`/`UPDATE`; measure the write cost, not just the read gain |
Re-run `EXPLAIN ANALYZE` after. An index that did not change the plan is a revert (Step 4), and it is not free: it still costs on every write.
#### Connection Pool Exhaustion
The signature is distinctive: **every** endpoint slows at once, the slow time is spent waiting for a connection rather than executing, and the database reports mostly idle sessions.
```typescript // BAD: a pool per request or per module — under serverless this multiplies // by instance count and exhausts the database's connection limit // GOOD: one pool per process, sized against the database's ceiling const pool = new Pool({ max: 10, // instances × max must stay under max_connections idleTimeoutMillis: 30_000, connectionTimeoutMillis: 5_000, // fail fast instead of queueing forever }); ```
**Bigger is not faster.** A pool larger than what the database can execute concurrently just relocates the queue from your app to the database, where it is harder to see. When instance count is unbounded (serverless, autoscaling), a proxy that multiplexes connections (pgbouncer, RDS Proxy) is the fix, not a higher `max`.
#### Missing Image Optimization (Frontend)
```html <!-- BAD: No dimensions, no format optimization --> <img src="/hero.jpg" />
<!-- GOOD: Hero / LCP image — art direction + resolution switching, high priority --> <!-- Two techniques combined: - Art direction (media): different crop/composition per breakpoint - Resolution switching (srcset + sizes): right file size per screen density --> <picture> <!-- Mobile: portrait crop (8:10) --> <source media="(max-width: 767px)" srcset="/hero-mobile-400.avif 400w, /hero-mobile-800.avif 800w" sizes="100vw" width="800" height="1000" type="image/avif" /> <source media="(max-width: 767px)" srcset="/hero-mobile-400.webp 400w, /hero-mobile-800.webp 800w" sizes="100vw" width="800" height="1000" type="image/webp" /> <!-- Desktop: landscape crop (2:1) --> <source srcset="/hero-800.avif 800w, /hero-1200.avif 1200w, /hero-1600.avif 1600w" sizes="(max-width: 1200px) 100vw, 1200px" width="1200" height="600" type="image/avif" /> <source srcset="/hero-800.webp 800w, /hero-1200.webp 1200w, /hero-1600.webp 1600w" sizes="(max-width: 1200px) 100vw, 1200px" width="1200" height="600" type="image/webp" /> <img src="/hero-desktop.jpg" width="1200" height="600" fetchpriority="high" alt="Hero image description" /> </picture>
<!-- GOOD: Below-the-fold image — lazy loaded + async decoding --> <img src="/content.webp" width="800" height="400" loading="lazy" decoding="async" alt="Content image description" /> ```
#### Unnecessary Re-renders (React)
```tsx // BAD: Creates new object on every render, causing children to re-render function TaskList() { return <TaskFilters options={{ sortBy: 'date', order: 'desc' }} />; }
// GOOD: Stable reference const DEFAULT_OPTIONS = { sortBy: 'date', order: 'desc' } as const; function TaskList() { return <TaskFilters options={DEFAULT_OPTIONS} />; }
// Use React.memo for expensive components const TaskItem = React.memo(function TaskItem({ task }: Props) { return <div>{/* expensive render */}</div>; });
// Use useMemo for expensive computations function TaskStats({ tasks }: Props) { const stats = useMemo(() => calculateStats(tasks), [tasks]); return <div>{stats.completed} / {stats.total}</div>; } ```
#### Large Bundle Size
```typescript // Modern bundlers (Vite, webpack 5+) handle named imports with tree-shaking automatically, // provided the dependency ships ESM and is marked `sideEffects: false` in package.json. // Profile before changing import styles — the real gains come from splitting and lazy loading.
// GOOD: Dynamic import for heavy, rarely-used features const ChartLibrary = lazy(() => import('./ChartLibrary'));
// GOOD: Route-level code splitting wrapped in Suspense const SettingsPage = lazy(() => import('./pages/Settings'));
function App() { return ( <Suspense fallback={<Spinner />}> <SettingsPage /> </Suspense> ); } ```
#### Missing Caching (Backend)
Cache what is expensive to produce and read far more often than it changes. Caching a query that was already fast adds a network hop, a staleness bug, and an eviction policy to maintain, in exchange for nothing.
**Pick the layer deliberately:**
| Layer | Visible to | Use when | Cost | |---|---|---|---| | In-process (`Map`, LRU) | One instance | Small, hot, per-instance staleness is acceptable | Each instance drifts independently; invalidation reaches only one | | Shared (Redis, Memcached) | All instances | Instances must agree, or the value is expensive to recompute | A network hop, and another serv
Source provenance
Decision snapshot
91,373 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for performance-optimization, ready for a manual X post.
performance-optimization: Optimizes application performance across frontend, backend, queries, and databases. Use when... 91.4K stars https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=x
Listing + install path for performance-optimization: https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=x Install: npx skills add addyosmani/agent-skills --skill performance-optimization
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to addyosmani but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization/audit)
[](https://www.openagentskill.com/skills/addyosmani-performance-optimization?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)addyosmani
@addyosmani
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
mono-color
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
1.9K StarsLast30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
61.0K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K StarsGPT Researcher
Run autonomous deep research over web and local sources
28.0K StarsPermission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness