performance-optimization

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

665|3|Updated Sep 12, 2026
One-click install
npx skills add https://github.com/rizqinrr/viserys-agent --skill performance-optimization-rizqinrr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/rizqinrr/viserys-agent/tree/main/skills/performance-optimization
Command: npx skills add https://github.com/rizqinrr/viserys-agent --skill performance-optimization-rizqinrr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Performance work without measurement is guessing, and unmeasured optimizations add complexity without improving what users feel. This Skill enforces a measure-identify-fix-verify-guard workflow so every optimization is justified by real data and reverted when it does not beat the baseline. ## Core Features & Use Cases - Measurement-First Workflow: Establish baselines with synthetic tools (Lighthouse, DevTools) and real-user monitoring (web-vitals, CrUX) before touching any code. - Anti-Pattern Fixes: Concrete fixes for N+1 queries, unbounded fetching, connection pool exhaustion, missing image optimization, unnecessary React re-renders, large bundles, and missing caching. - Regression Guarding: Set performance budgets, enforce them in CI with bundlesize and Lighthouse CI, and log every attempt so failed ideas are not retried. - Use Case: Your API's p95 latency spikes after a release. Use this Skill to profile the slow endpoint, find an N+1 query via EXPLAIN ANALYZE, fix it with a proper join, re-measure against the baseline, and add a CI budget to prevent regression. ## Quick Start Use the performance-optimization skill to profile my app's slow dashboard page and fix the bottleneck 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?

Fix N+1 queries by replacing per-record lookups with a single query using joins or ORM includes, such as findMany with an include clause. 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 LCP images with responsive srcset and fetchpriority, and reduce INP by breaking up long main-thread tasks.

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

Add an index only after running EXPLAIN ANALYZE shows a sequential scan or stale statistics on the query. Index for the query shape with equality columns first, and skip indexes for low-selectivity filters or leading-wildcard LIKE patterns.

Why is my connection pool exhausted and should I raise the pool size?

Pool exhaustion shows as all endpoints slowing at once while the database sits idle. Raising the pool size just relocates the queue; instead find what holds connections, and use a proxy like pgbouncer for serverless or autoscaling environments.

When should I not optimize performance?

Do not optimize without profiling evidence of an actual problem. Premature optimization adds complexity that costs more than the performance it gains, and changes that measure neutral against the baseline should be reverted, not kept.

How do I prevent performance regressions in CI?

Prevent regressions by setting budgets for bundle size, API latency, and Lighthouse scores, then enforcing them with bundlesize and Lighthouse CI. Complement synthetic gates with RUM alerting on p75 movements in field data.