skills/frontend/performance/SKILL.md
Frontend performance optimization patterns for Core Web Vitals. Use when building UI.
npx skillsauth add devjarus/coding-agent performanceInstall 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.
| Metric | Target | Description | |---|---|---| | LCP (Largest Contentful Paint) | < 2.5s | Time until the largest visible content is rendered | | INP (Interaction to Next Paint) | < 200ms | Latency from user interaction to visual response | | CLS (Cumulative Layout Shift) | < 0.1 | Visual stability — elements should not shift unexpectedly |
React.lazy + Suspense.width and height to prevent layout shift.<link rel="preload">.React.memo only when props are stable (primitives or memoized references).useMemo to memoize expensive computed values and useCallback to stabilize callback references passed to memoized children.react-window or react-virtual — never render thousands of DOM nodes.import { debounce } from 'lodash-es', not import _ from 'lodash'.webpack-bundle-analyzer or vite-bundle-visualizer.import() so they are not in the initial bundle.<link rel="prefetch"> or router-level prefetching.testing
Multi-source research method — decompose a question, fan out parallel investigators, interleaved-think each result, verify claims adversarially, synthesize a cited answer. Use for breadth-heavy research, stack comparisons, "which approach wins" questions.
testing
Decide when to use unit vs integration vs e2e tests, and when to mock vs use the real thing per dependency. Dependency injection is the enabler — without it you end up monkey-patching imports. Apply when writing tests of any kind.
development
Test-driven development process — write failing test, implement to pass, refactor. Use when implementing any feature or fixing bugs.
development
Patterns for sharing types, API contracts, and validation schemas between frontend and backend. Use when multiple domains consume the same data shapes to prevent contract drift.