agentleFS
WhatIfWeDigDeeperWhatIfWeDigDeeper/application-tracker/.claude/skills/perf-audit/SKILL.md

perf-audit

Skill1 starsChanged 9 months agoMITView on GitHub

Profile and optimize React application performance

Files
SKILL.md

Performance Audit

Profile the application and identify optimization opportunities.

Process

1. Measure Baseline

Build analysis:

npm run build
# Check output size
ls -la .next/static/chunks/*.js | head -20

Bundle analysis (if available):

ANALYZE=true npm run build

2. Identify Issues

Common performance problems:

IssueSymptomDetection
Large bundlesSlow initial loadBuild output size
Unnecessary re-rendersLaggy UIReact DevTools Profiler
Memory leaksGrowing memoryChrome DevTools Memory
Slow API callsLoading spinnersNetwork tab
Layout thrashingJanky scrollingPerformance tab

3. Analyze Components

Look for:

  • Components re-rendering when they shouldn't
  • Missing memoization
  • Inline function/object creation in render
  • Large lists without virtualization

4. Apply Optimizations

Memoization:

// Memoize expensive components
const MemoizedComponent = React.memo(Component);

// Memoize expensive calculations
const expensiveValue = useMemo(() => compute(data), [data]);

// Memoize callbacks
const handleClick = useCallback(() => { ... }, [deps]);

Code splitting:

// Dynamic imports
const HeavyComponent = dynamic(() => import('./HeavyComponent'), {
  loading: () => <Spinner />,
});

Image optimization:

import Image from 'next/image';
<Image src={src} alt={alt} width={w} height={h} />

List virtualization:

import { FixedSizeList } from 'react-window';

5. Measure Improvement

Re-run baseline measurements and compare.

6. Report

Document:

  • Issues found
  • Optimizations applied
  • Before/after metrics
  • Remaining opportunities

Quick Wins

  1. Add loading="lazy" to images below fold
  2. Use next/dynamic for heavy components
  3. Add React.memo to list item components
  4. Move static data outside components
  5. Use useMemo for filtered/sorted lists

Tools

  • React DevTools Profiler
  • Chrome DevTools Performance tab
  • Lighthouse (in Chrome DevTools)
  • @next/bundle-analyzer
  • why-did-you-render library

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.