performance-optimization

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

2|Updated Jul 11, 2026
One-click install
npx skills add https://github.com/MoofonLi/dev-ready --skill performance-optimization-moofonli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/MoofonLi/dev-ready/tree/main/src/dev_ready/templates/claude/skills/performance-optimization
Command: npx skills add https://github.com/MoofonLi/dev-ready --skill performance-optimization-moofonli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow applications lose users, but optimizing without measurement wastes effort on the wrong bottlenecks. This Skill enforces a measure-first workflow that identifies the actual cause of slowness—whether N+1 queries, oversized bundles, missing indexes, or connection pool exhaustion—and verifies every fix with before-and-after numbers. ## Core Features & Use Cases - Five-Step Optimization Workflow: Measure, identify, fix, verify, and guard against regression, with strict rules for reverting changes that don't beat the baseline. - Anti-Pattern Fixes: Concrete code examples for N+1 queries, unbounded fetching, connection pool exhaustion, unoptimized images, unnecessary React re-renders, large bundles, and missing caching. - Core Web Vitals Targets: Threshold tables for LCP, INP, and CLS plus CI enforcement via bundlesize and Lighthouse CI. - Use Case: Your API's p95 latency spikes after a release. Use this Skill to profile database queries with EXPLAIN ANALYZE, find a sequential scan caused by a missing composite index, add the right index, and re-measure to confirm the fix. ## Quick Start Ask the agent to profile the slow endpoint or page, identify the bottleneck using the measurement workflow, and apply a verified 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 my backend API?

Replace per-record queries 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 do I improve Core Web Vitals scores like LCP and INP?

Measure first with Lighthouse for synthetic data and the web-vitals library for real user data. Then target the specific bottleneck: optimize hero images and render-blocking resources for LCP, and reduce long main-thread tasks for INP.

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

Run EXPLAIN ANALYZE first and add an index only when the plan shows a sequential scan where an index should apply. Match the index to 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. Raising the size just moves the queue to the database; find what holds connections, and use a proxy like pgbouncer for serverless workloads.

When should I not optimize performance?

Do not optimize without measurement evidence of a problem. Premature optimization adds complexity and maintenance cost without improving what users actually experience, so profile first and fix only proven bottlenecks.