Skip to content
Back to skills

Performance Tuning

ASecurity

Tunes frontend performance through re-render prevention, code splitting, image optimization, and bundle analysis; use when optimizing Core Web Vitals, reducing bundle size, diagnosing render performance, or reviewing images and fonts.

  • 19 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 19, 2026
ai-agentsbashreactfrontendperformance

Works with

  • cli

Security analysis

A100/100

Scanned October 19, 2026

npx -y skills add sawrus/agent-guides --skill performance-tuning --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Performance Tuning?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Performance Tuning
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sawrus-performance-tuning/badge)](https://www.skillsdirectory.com/skills/sawrus-performance-tuning)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: performance-tuning
description: "Tunes frontend performance through re-render prevention, code splitting, image optimization, and bundle analysis; use when optimizing Core Web Vitals, reducing bundle size, diagnosing render performance, or reviewing images and fonts."
---

# 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 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} />
```

## Code Splitting (Mandatory)

```tsx
const UserDashboard = lazy(() => import('./features/users/UserDashboard'));

<Suspense fallback={<PageSkeleton />}>
  <UserDashboard />
</Suspense>
```

## Image Optimization Checklist

- [ ] Explicit `width` and `height` to prevent CLS
- [ ] WebP/AVIF via `<picture>` with JPG fallback
- [ ] `loading="lazy"` for below-fold images
- [ ] `loading="eager"` + `fetchpriority="high"` for LCP image

## Bundle Analysis

```bash
npx 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` |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.