optimize

Diagnose and fix UI performance issues in web applications using Lighthouse and bundle analyzers.

Updated Apr 17, 2026
One-click install
npx skills add https://github.com/djkloop/n --skill optimize-djkloop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize
Source: https://github.com/djkloop/n/tree/main/.trae/skills/optimize
Command: npx skills add https://github.com/djkloop/n --skill optimize-djkloop

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Diagnoses and fixes front-end performance problems that cause slow loading, janky rendering, long input delays, and excessive bundle size to create faster, smoother user experiences.

Core Features & Use Cases

  • Performance Assessment: Measure Core Web Vitals (LCP, FID/INP, CLS), Time to Interactive, FCP, TTI, and runtime CPU/memory usage to identify bottlenecks.
  • Loading & Network Optimization: Reduce bundle size via code splitting and tree shaking, optimize images with modern formats and responsive loading, and apply caching and CDN strategies to lower payloads and request counts.
  • Rendering & Animation Improvements: Eliminate layout thrashing, use GPU-accelerated transforms and requestAnimationFrame, employ content-visibility and virtualization for long lists, and tune CSS and font loading to reduce paint and composite costs.
  • Framework Guidance: Practical React and framework-agnostic recommendations such as memoization, lazy loading, web workers for heavy tasks, and profiling with DevTools and bundle analyzers.
  • Monitoring & Validation: Use Lighthouse, WebPageTest, Core Web Vitals, and real-device testing to measure before-and-after impact and avoid regressions.

Quick Start

Run an audit with Lighthouse and prioritize fixes for LCP, JS bundle reduction, and image optimization, then measure improvements on a throttled mobile profile.

Frequently Asked Questions about optimize

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

FAQPage Schema
How do I diagnose and fix Core Web Vitals issues like LCP and CLS?

Diagnose Core Web Vitals issues by measuring LCP, FID/INP, and CLS using Lighthouse. Fix slow LCP by optimizing images and reducing bundle size, and prevent CLS by reserving space for dynamically loaded page elements.

What's the best way to reduce web app bundle size and optimize network payloads?

Reduce web app bundle size by applying code splitting and tree shaking to eliminate unused JavaScript. Optimize network payloads further by converting images to modern formats and implementing responsive loading techniques.

How do I eliminate layout thrashing and smooth janky rendering in single-page apps?

Eliminate layout thrashing and smooth rendering by using GPU-accelerated transforms and requestAnimationFrame. Employ content-visibility and virtualization for long lists to reduce paint and composite costs.

How do I optimize images for faster web page loading on mobile networks?

Optimize images for faster loading by converting to modern formats and applying responsive loading strategies. Measure before-and-after impacts using WebPageTest on a throttled mobile profile to validate improvements.

Do I need to use bundle analyzers and DevTools profiling to improve web performance?

You need bundle analyzers and DevTools profiling to identify specific bottlenecks in your JavaScript bundles and runtime execution. These tools provide measurable before-and-after metrics required to ensure optimizations effectively prevent regressions.

Can I use React memoization and web workers to improve front-end performance?

You can use React memoization to prevent unnecessary component re-renders and web workers to offload heavy CPU tasks. Combine these with lazy loading and runtime profiling to achieve smoother single-page app animations and interactions.