skills/performance-frontend/SKILL.md
Optimize frontend React performance with code splitting, lazy loading, image preloading, memoization, and virtualization. Use when: reducing bundle size, lazy loading routes, preloading images during data fetching, optimizing re-renders, virtualizing long lists, or improving Core Web Vitals.
npx skillsauth add congiuluc/my-awesome-copilot performance-frontendInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
useMemo / useCallbackReact.lazyWhen data contains image URLs, preload images during loading state so they render instantly when the spinner is dismissed:
const { data, loading } = useProducts();
const imagesReady = useImagePreload(data.map(p => p.imageUrl).filter(Boolean));
if (loading || !imagesReady) return <Spinner />;
See the frontend-react skill for the useImagePreload hook implementation.
Use this checklist when reviewing frontend code for performance issues:
| # | Check | Tool / Method |
|---|-------|---------------|
| 1 | Bundle size < 200 KB gzipped (initial load) | npx vite-bundle-visualizer |
| 2 | No unused dependencies in package.json | npx depcheck |
| 3 | Route-level code splitting with React.lazy | Manual review |
| 4 | Images use loading="lazy" and decoding="async" | Lighthouse |
| 5 | Images preloaded during data fetch | Manual review |
| 6 | Lists > 100 items use virtualization | Manual review |
| 7 | No unnecessary re-renders (React DevTools Profiler) | React DevTools |
| 8 | useMemo/useCallback only for expensive operations | Manual review |
| 9 | LCP < 2.5s, CLS < 0.1, INP < 200ms | Lighthouse / Web Vitals |
| 10 | No layout thrashing (forced synchronous layouts) | Chrome DevTools Performance |
| 11 | Fonts use font-display: swap | CSS review |
| 12 | Third-party scripts loaded async/deferred | HTML review |
npx lighthouse http://localhost:5173 --viewnpx vite-bundle-visualizer to find large chunkstools
Build VS Code extensions with TypeScript. Covers extension anatomy, activation events, commands, tree views, webview panels, language features, testing, and publishing. Use when: creating a new VS Code extension, adding commands/views/providers, building webview UIs, implementing language server features, testing extensions, or packaging for the marketplace.
development
Track implementations, features, bugs, and releases in a versioning document. Use when: adding a commit, completing a feature, fixing a bug, or preparing a release. Automatically updates CHANGELOG.md following Keep a Changelog format and Semantic Versioning.
development
Write frontend tests using Vitest and React Testing Library. Use when: testing React components, hooks, user interactions, form submissions, accessibility assertions, or mocking API services.
development
Write Angular frontend tests using Jasmine, Karma, and Angular TestBed. Use when: testing Angular components, services, pipes, directives, user interactions, form submissions, accessibility assertions, or mocking HTTP services.