performance-optimization

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

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/MSC72m/DevForge --skill performance-optimization-msc72m
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/MSC72m/DevForge/tree/main/skills/performance-optimization
Command: npx skills add https://github.com/MSC72m/DevForge --skill performance-optimization-msc72m

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Slow applications, regressions, and wasted optimization effort: teams often guess at bottlenecks, apply fixes that don't help, and keep changes that never paid for themselves. This Skill enforces a measure-first workflow so every optimization targets a proven bottleneck and survives only if re-measurement confirms it. ## Core Features & Use Cases - Measure-Identify-Fix-Verify-Guard Workflow: Establish baselines with synthetic tools (Lighthouse, DevTools) and RUM data (web-vitals, CrUX), then verify fixes against run-to-run variance before keeping them. - Anti-Pattern Fixes: Concrete remedies for N+1 queries, unbounded fetching, connection pool exhaustion, missing image optimization, unnecessary React re-renders, large bundles, and misused caching. - Core Web Vitals Targets: Threshold tables for LCP, INP, and CLS plus performance budgets enforceable in CI via bundlesize and Lighthouse CI. - Use Case: An API endpoint is slow. Instead of guessing, you check the query log, find an N+1 pattern, replace it with a single include query, re-measure under identical conditions, and add a p95 latency budget to CI to guard against regression. ## Quick Start Ask the agent to profile the slow page or endpoint, identify the actual bottleneck, and propose a measured fix with before-and-after numbers.

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?▼

N+1 queries are fixed by replacing per-record lookups with a single query using a join or include, such as findMany with include: { owner: true } in Prisma-style ORMs. 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 LCP by optimizing hero images with responsive srcset, fetchpriority, and explicit dimensions; improve INP by reducing main-thread long tasks and unnecessary re-renders. Measure with the web-vitals library and validate against the Good thresholds: LCP ≤ 2.5s, INP ≤ 200ms, CLS ≤ 0.1.

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

Add an index only after running EXPLAIN ANALYZE and seeing a sequential scan where an index was expected, stale statistics, or a sort node above the scan. Index for the query shape with equality columns first, and re-run the plan after to confirm it changed.

Does raising the connection pool size fix pool exhaustion?▼

No, a pool larger than the database can serve just moves the queue somewhere less visible. Find what holds connections, size the pool so instances times max stays under max_connections, and use a proxy like pgbouncer for serverless or autoscaling workloads.

Why should a neutral optimization be reverted instead of kept?▼

A change within run-to-run variance bought nothing but adds maintenance cost forever. Re-measure under identical conditions, and if the delta does not beat the noise, revert it and log the attempt so the dead idea is not retried later.

When not to use caching for performance?▼

Do not cache queries that are already fast, data whose staleness is a correctness bug like balances or permissions, or per-user data under a key that does not identify the user. Cache only what is expensive to produce and read far more often than it changes.