performance-optimization

Diagnose and fix frontend and backend performance bottlenecks through measurement-driven optimization workflows.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/Qiuyi-Hong/addyosmani-skills --skill performance-optimization-qiuyi-hong
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/Qiuyi-Hong/addyosmani-skills/tree/main/skills/performance-optimization
Command: npx skills add https://github.com/Qiuyi-Hong/addyosmani-skills --skill performance-optimization-qiuyi-hong

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams often optimize blindly, adding complexity without improving what users actually feel. This Skill enforces a measure-first workflow so every performance change targets a real, profiled bottleneck and is verified against a baseline before it ships. ## Core Features & Use Cases - Measure-Identify-Fix-Verify-Guard Workflow: A five-step loop covering baseline measurement, bottleneck identification, targeted fixes, re-measurement with keep-or-revert decisions, and regression guards via CI budgets and RUM monitoring. - Frontend Optimization: Core Web Vitals targets (LCP, INP, CLS), responsive image markup with art direction, bundle splitting with lazy loading, and React re-render elimination using memo and useMemo. - Backend Optimization: N+1 query elimination, pagination, EXPLAIN ANALYZE-driven indexing, connection pool sizing, and layered caching with key design, invalidation strategies, and stampede protection. - Use Case: Your API's p95 latency spikes after a release. Use this Skill to profile query logs, find an N+1 pattern, fix it with a single joined query, re-measure against the baseline, and add a CI performance budget to prevent regression. ## Quick Start Ask the agent to profile the slow endpoint or page, identify the bottleneck, and apply a verified fix with before-and-after measurements.

Frequently Asked Questions about performance-optimization

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

FAQPage Schema
How do I fix N+1 queries in my backend API?

Replace per-record queries with a single query using a join or include clause, such as Prisma's findMany with include. Confirm the fix by checking the database query log before and after the change.

How to improve Core Web Vitals scores like LCP and INP?

Measure first with Lighthouse and the web-vitals library, then target the specific bottleneck: optimize hero images with responsive srcset for LCP, break up long main-thread tasks for INP, and set explicit image dimensions for CLS.

When should I add a database index for a slow query?

Run EXPLAIN ANALYZE first and only add an index when the plan shows a sequential scan on a large table or a sort node the index could cover. Index for the query shape with equality columns first, and re-run the plan to confirm it is used.

Why is my connection pool exhausted and should I increase its size?

Pool exhaustion usually means connections are held too long, not that the pool is too small. Find what holds connections first; for serverless or autoscaling environments, use a proxy like pgbouncer instead of raising the pool maximum.

When should I not optimize performance?

Do not optimize without profiling evidence of a real problem. Premature optimization adds complexity that costs more than the performance it gains, and changes that show no measurable improvement over baseline should be reverted.