performance-optimization

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

Updated Aug 11, 2026
One-click install
npx skills add https://github.com/Kunj-Sharma03/agent-contextify --skill performance-optimization-kunj-sharma03
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/Kunj-Sharma03/agent-contextify/tree/main/templates/skills/performance-optimization
Command: npx skills add https://github.com/Kunj-Sharma03/agent-contextify --skill performance-optimization-kunj-sharma03

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow applications lose users, but optimizing without measurement wastes effort on the wrong things. This Skill provides a disciplined measure-identify-fix-verify workflow for improving Core Web Vitals, API response times, database queries, and bundle sizes with evidence instead of guesswork. ## Core Features & Use Cases - Measurement-First Workflow: Establishes baselines with synthetic tools (Lighthouse, DevTools) and real-user monitoring (web-vitals, CrUX) before changing any code. - Anti-Pattern Fixes: Provides concrete before/after code for N+1 queries, unbounded data fetching, unoptimized images, unnecessary React re-renders, large bundles, and missing caching. - Regression Guardrails: Enforces re-measurement against variance, reverts neutral changes, logs failed experiments, and sets performance budgets checked in CI. - Use Case: Your product page has a 4.5s LCP and users report sluggish interactions. Use this Skill to profile the network waterfall, identify render-blocking resources and an N+1 query, fix them, and verify the improvement exceeds run-to-run noise. ## Quick Start Ask the agent to profile the slow page load on the product listing page and fix the identified bottlenecks while verifying improvements against the baseline 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 inside loops with a single query using a join or include clause, such as passing include: { owner: true } to an ORM findMany call. 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?

Start by measuring with Lighthouse and the web-vitals library to find the actual bottleneck. For LCP, optimize hero images with responsive srcset and fetchpriority; for INP, profile long tasks on the main thread and reduce heavy JavaScript work.

What is a good performance budget for a web application?

A typical budget keeps initial JavaScript under 200KB gzipped, CSS under 50KB, above-the-fold images under 200KB, and API p95 response times under 200ms. Enforce the budget in CI with bundlesize and Lighthouse CI.

When should I not optimize performance?

Do not optimize before you have measurement evidence of a real problem. Premature optimization adds complexity that costs more than the performance it gains, and changes that show no measurable improvement should be reverted rather than kept.

Why did my optimization not improve the measured metric?

The change may have targeted the wrong bottleneck, or the gain is smaller than run-to-run variance. Re-measure under identical conditions as the baseline, compare against variance rather than the mean, and revert changes that fall within noise.

Does React.memo always improve rendering performance?

No. Overusing React.memo and useMemo adds comparison overhead and complexity without benefit. Apply them only to expensive components or computations identified through profiling, and stabilize object references passed as props first.