performance-optimization

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

3|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/marcmarti9/agentit --skill performance-optimization-marcmarti9
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/marcmarti9/agentit/tree/main/skills/performance-optimization
Command: npx skills add https://github.com/marcmarti9/agentit --skill performance-optimization-marcmarti9

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Slow applications, regressions, and wasted optimization effort. This Skill enforces a measure-first workflow so you fix the actual bottleneck instead of guessing, and revert changes that do not measurably help. ## Core Features & Use Cases - Measurement-First Workflow: A five-step loop (measure, identify, fix, verify, guard) covering synthetic tools like Lighthouse and real-user monitoring via the web-vitals library. - Anti-Pattern Fixes: Concrete before/after code for N+1 queries, unbounded fetching, connection pool exhaustion, missing image optimization, React re-renders, large bundles, and caching design. - Core Web Vitals Targets: Threshold tables for LCP, INP, and CLS plus CI enforcement with bundlesize and Lighthouse CI. - Use Case: Your API endpoint is slow. Use this Skill to profile the database query log, find an N+1 pattern, fix it with a single join query, verify with EXPLAIN ANALYZE, and add a p95 latency budget to CI. ## Quick Start Use the performance-optimization skill to profile this slow page load and identify the actual bottleneck before changing any code.

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 a backend API?▼

Fix N+1 queries by replacing per-record lookups with a single query using a join or include clause, such as findMany with include in an ORM. 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?▼

Improve Core Web Vitals by measuring with Lighthouse and the web-vitals library, then targeting the specific bottleneck: optimize hero images and render-blocking resources for LCP, reduce main-thread long tasks for INP, and set explicit image dimensions for CLS.

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

Add an index only after running EXPLAIN ANALYZE to confirm the query plan lacks a usable index. Index for the query shape with equality columns first, and re-run the plan after, since indexes that do not change the plan still tax every write.

Why does raising the connection pool size not fix slowness?▼

Raising pool size fails because a pool larger than the database can serve just moves the queue somewhere less visible. Find what holds connections first, and for serverless or autoscaling workloads use a multiplexing proxy like pgbouncer instead.

When should I not optimize application performance?▼

Do not optimize without measurement evidence of a problem. Premature optimization adds complexity that costs more than the performance it gains, and changes that land within run-to-run variance should be reverted rather than kept.