performance-optimization

Diagnoses and fixes frontend and backend performance bottlenecks through measurement-driven optimization workflows.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/sasidhar4444/ai-receptionist --skill performance-optimization-sasidhar4444
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/sasidhar4444/ai-receptionist/tree/main/agent-skills/skills/performance-optimization
Command: npx skills add https://github.com/sasidhar4444/ai-receptionist --skill performance-optimization-sasidhar4444

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Slow applications lose users, but optimizing without measurement wastes effort on the wrong bottlenecks. This Skill enforces a disciplined measure-identify-fix-verify-guard workflow so every performance change is justified by real data and regressions are caught before they ship. ## Core Features & Use Cases - Measurement-First Workflow: Establishes baselines with synthetic tools (Lighthouse, DevTools) and real-user monitoring (web-vitals, CrUX) before touching any code. - Anti-Pattern Fixes: Provides concrete before/after code for N+1 queries, unbounded fetching, connection pool exhaustion, missing image optimization, unnecessary React re-renders, large bundles, and missing caching. - Database Query Analysis: Guides reading EXPLAIN ANALYZE output to decide when indexes help, when they don't, and how to shape composite indexes for the query. - Use Case: Your API's p95 latency spikes after a release. Use this Skill to profile the slow endpoint, discover an N+1 query pattern, fix it with a single joined query, verify the improvement exceeds run-to-run variance, and add a CI performance budget to prevent regression. ## Quick Start Ask the AI to analyze why your page or API endpoint is slow and propose a measured optimization plan following the performance workflow.

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

N+1 queries are fixed by replacing per-record lookups with a single query using a join or include clause. For example, replace looping findUnique calls with one findMany that includes the related records, then verify with query logging that only one query executes.

How do I improve Core Web Vitals scores like LCP and INP?▼

Improve LCP by optimizing hero images with responsive srcset, fetchpriority, and proper dimensions; improve INP by reducing main-thread long tasks and unnecessary React re-renders. Measure first with Lighthouse and the web-vitals library to confirm which metric is actually failing.

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 would be used. Indexes fail to help with low-selectivity filters, leading wildcards, or functions on the column, and every index adds write cost.

Why are all my API endpoints slow at the same time?▼

Simultaneous slowness across all endpoints typically indicates connection pool exhaustion, where requests wait for connections rather than execute queries. Fix it with one properly sized pool per process, or a connection proxy like pgbouncer for serverless environments.

When should I not optimize performance?▼

Do not optimize without 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 over baseline should be reverted rather than kept.