Agent skill
perf-audit-whatifwedigdeeper-application-tracker
Profile and optimize React application performance
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/perf-audit-whatifwedigdeeper-application-tracker
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:
| Issue | Symptom | Detection |
|---|---|---|
| Large bundles | Slow initial load | Build output size |
| Unnecessary re-renders | Laggy UI | React DevTools Profiler |
| Memory leaks | Growing memory | Chrome DevTools Memory |
| Slow API calls | Loading spinners | Network tab |
| Layout thrashing | Janky scrolling | Performance 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
- Add
loading="lazy"to images below fold - Use
next/dynamicfor heavy components - Add
React.memoto list item components - Move static data outside components
- Use
useMemofor filtered/sorted lists
Tools
- React DevTools Profiler
- Chrome DevTools Performance tab
- Lighthouse (in Chrome DevTools)
@next/bundle-analyzerwhy-did-you-renderlibrary
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?