performance-optimization

Diagnose and fix frontend and backend performance bottlenecks using measurement-driven profiling workflows.

1|Updated May 29, 2026
One-click install
npx skills add https://github.com/memasanz/agent-harness --skill performance-optimization-memasanz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/memasanz/agent-harness/tree/main/.github/skills/performance-optimization
Command: npx skills add https://github.com/memasanz/agent-harness --skill performance-optimization-memasanz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Slow applications lose users, but optimizing without data wastes effort on the wrong things. This Skill enforces a measure-first workflow so you find the real bottleneck, fix it, and verify the improvement with concrete numbers. ## Core Features & Use Cases - Measure-First Workflow: Follows a five-step loop (measure, identify, fix, verify, guard) using Lighthouse, Chrome DevTools, web-vitals RUM data, and backend timing logs. - Anti-Pattern Fixes: Provides concrete code fixes for N+1 queries, unbounded data fetching, missing image optimization, unnecessary React re-renders, large bundles, and missing caching. - Core Web Vitals Targets: Defines thresholds for LCP, INP, and CLS plus enforceable performance budgets for bundle size, API latency, and Lighthouse scores in CI. - Use Case: Your product page has a 5-second LCP. Use this Skill to profile the network waterfall, identify an unoptimized hero image and render-blocking scripts, apply responsive image markup with fetchpriority, and confirm LCP drops below 2.5s. ## Quick Start Use the performance-optimization skill to profile my app's slow page load and fix the identified bottlenecks.

Frequently Asked Questions about performance-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve Core Web Vitals scores?

Improve Core Web Vitals by measuring first with Lighthouse and the web-vitals library, then targeting the failing metric. For LCP, optimize hero images and server response time; for INP, reduce main-thread long tasks; for CLS, set explicit image dimensions.

How to fix N+1 database queries in a backend API?

Fix N+1 queries by replacing per-record lookups with a single query using joins or ORM include statements. For example, use Prisma's include option to fetch related records in one query instead of looping through results with individual findUnique calls.

What is a good performance budget for a web app?

A reasonable budget is under 200KB gzipped JavaScript for initial load, under 50KB CSS, under 200KB per above-the-fold image, API p95 response under 200ms, and a Lighthouse performance score of at least 90. Enforce budgets in CI with bundlesize and Lighthouse CI.

When should I not optimize performance?

Do not optimize before you have profiling evidence of an actual problem. Premature optimization adds complexity that costs more than the performance it gains. Measure first, identify the real bottleneck, and only fix what measurements prove matters.

Why does my React app re-render too often?

Excessive re-renders usually come from unstable object or function references passed as props, creating new values on every render. Hoist static objects outside components, use React.memo for expensive children, and useMemo for expensive computations.