performance-optimization

Diagnose and fix frontend and backend performance bottlenecks using measurement-driven profiling workflows.

Updated Jul 10, 2026
One-click install
npx skills add https://github.com/CodeCrafterAdi2006/Ink-and-Code --skill performance-optimization-codecrafteradi2006
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/CodeCrafterAdi2006/Ink-and-Code/tree/main/Skills/performance-optimization
Command: npx skills add https://github.com/CodeCrafterAdi2006/Ink-and-Code --skill performance-optimization-codecrafteradi2006

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires web-vitals, and includes references (resource) components.

What problem does it solve? Slow load times, sluggish interactions, and unoptimized code degrade user experience and hurt Core Web Vitals scores, but optimizing without data wastes effort on the wrong things. This Skill enforces a measure-first workflow so every optimization targets a proven bottleneck. ## Core Features & Use Cases - Measurement-First Workflow: Follows a five-step loop (Measure, Identify, Fix, Verify, Guard) using Lighthouse, DevTools traces, and the web-vitals library for real user monitoring. - Anti-Pattern Fixes: Provides concrete code corrections for N+1 queries, unbounded data fetching, missing image optimization, unnecessary React re-renders, large bundles, and missing caching. - Core Web Vitals Targets: Defines thresholds for LCP, INP, and CLS plus enforceable performance budgets for bundle size, API latency, and Lighthouse scores in CI. - Use Case: When a Next.js page loads slowly, use this Skill to trace the network waterfall, identify render-blocking resources or slow TTFB, apply the targeted fix, and verify improvement with before-and-after metrics. ## Quick Start Profile my application's slow page load and identify the actual bottleneck before suggesting any optimizations.

Frequently Asked Questions about performance-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve Core Web Vitals scores?

Improve Core Web Vitals by first measuring with Lighthouse and the web-vitals library, then targeting the failing metric: optimize images and server response for LCP, reduce main-thread long tasks for INP, and set explicit image dimensions to prevent CLS. Verify fixes with before-and-after measurements.

How to fix N+1 queries in a backend API?

Fix N+1 queries by replacing per-record lookups with a single query using joins or ORM includes, such as Prisma's include option. Detect them by logging database queries per request and watching for repeated identical query patterns.

When should I use React.memo and useMemo?

Use React.memo for expensive components that re-render with unchanged props, and useMemo for costly computations dependent on specific values. Avoid applying them everywhere, since overuse adds complexity and memory overhead without measurable benefit.

Should I optimize performance before measuring?

No, optimizing without profiling data is premature optimization that adds complexity without improving what matters. Establish a baseline with synthetic tools like Lighthouse and real user monitoring first, then fix only the identified bottleneck.

How do I enforce a performance budget in CI?

Enforce performance budgets in CI using bundlesize to check JavaScript payload limits and Lighthouse CI (lhci autorun) to fail builds below score thresholds. Typical budgets include under 200KB gzipped initial JavaScript and a Lighthouse performance score of at least 90.