areas/software/frontend/skills/performance-tuning/SKILL.md
# Skill: Frontend Performance Tuning ## When to load When optimizing Core Web Vitals, reducing bundle size, diagnosing render performance, or reviewing images/fonts. ## Re-render Prevention ```tsx // Memoize expensive computations const sorted = useMemo( () => [...items].sort((a, b) => a.name.localeCompare(b.name)), [items] ); // Stable callback references const handleClick = useCallback(() => doSomething(id), [id]); // Memoize child components receiving object/function props const Exp
npx skillsauth add sawrus/agent-guides areas/software/frontend/skills/performance-tuningInstall 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.
When optimizing Core Web Vitals, reducing bundle size, diagnosing render performance, or reviewing images/fonts.
// Memoize expensive computations
const sorted = useMemo(
() => [...items].sort((a, b) => a.name.localeCompare(b.name)),
[items]
);
// Stable callback references
const handleClick = useCallback(() => doSomething(id), [id]);
// Memoize child components receiving object/function props
const ExpensiveList = React.memo(({ items, onSelect }: ListProps) => (
// rendering
));
// ❌ Inline objects create new references every render
<MyComponent config={{ timeout: 3000 }} />
// ✅ Stable reference
const CONFIG = { timeout: 3000 };
<MyComponent config={CONFIG} />
const UserDashboard = lazy(() => import('./features/users/UserDashboard'));
<Suspense fallback={<PageSkeleton />}>
<UserDashboard />
</Suspense>
width and height to prevent CLS<picture> with JPG fallbackloading="lazy" for below-fold imagesloading="eager" + fetchpriority="high" for LCP imagenpx vite-bundle-visualizer
| Library | Problem | Solution |
|:---|:---|:---|
| moment.js | 300KB+ | Replace with date-fns |
| lodash | Full import | Use lodash-es named imports |
| @mui/material | Full import | Path imports: @mui/material/Button |
testing
QA Expert for writing E2E tests, test scenarios, test plans, and ensuring test coverage quality.
development
Expert UI/UX design intelligence for creating distinctive, high-craft, and mobile-first interfaces. Focuses on premium aesthetics, touch-first ergonomics, and Flutter performance.
development
Code Review Expert for static analysis, security auditing, architecture review, and ensuring code quality standards.
development
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.