| name | react-performance-audit |
|---|---|
| description | Comprehensive performance audit for React/Next.js projects with monorepo support. Analyzes architecture, build config, bundle size, code splitting, first-screen performance, React optimization, and overseas deployment. Use when: (1) auditing React project performance, (2) optimizing bundle size and loading speed, (3) improving first-screen metrics (FCP/LCP), (4) reviewing code-splitting strategy, (5) checking build configuration. |
Comprehensive performance analysis for React/Next.js projects, especially monorepo setups.
# Run full audit
bash scripts/audit.sh /path/to/project
# Or use Claude Code for deep analysis
cd /path/to/project && claude --permission-mode bypassPermissions --print "Run the react-performance-audit analysis following references/audit-checklist.md. Generate performance-analysis-report.md with findings."The script or agent will:
- Analyze project structure and dependencies
- Check build configuration
- Measure bundle sizes
- Evaluate code-splitting strategy
- Audit first-screen performance
- Check React optimizations
- Assess overseas deployment readiness
- Review PWA configuration (optional)
Report file: performance-analysis-report.md
Contains:
- Architecture overview
- Bundle size breakdown
- Performance metrics (FCP/LCP/TTI)
- Optimization recommendations (prioritized)
- Risk warnings
- Implementation examples
See references/audit-checklist.md for the complete audit framework.
scripts/audit.sh- Main audit orchestration scriptscripts/bundle-analyzer.js- Bundle size analysis helper
For monorepo structures, specify the target package:
bash scripts/audit.sh /path/to/monorepo --package apps/webIf using non-standard build tools:
bash scripts/audit.sh /path/to/project --bundler rspackGenerate JSON output for CI pipelines:
bash scripts/audit.sh /path/to/project --format json > audit-results.jsonBundle size issues:
- Large vendor chunks (>500KB)
- Duplicate dependencies in monorepo
- Missing tree-shaking
First-screen bottlenecks:
- Blocking scripts in
<head> - Missing critical CSS inlining
- Unoptimized images
Code-splitting gaps:
- No route-level splitting
- Missing lazy imports for heavy components
- Vendor chunk not split properly
React performance:
- Unnecessary re-renders
- Missing React.memo/useCallback
- Large components without optimization
Overseas deployment:
- No CDN for static assets
- Missing polyfill strategy
- Single-region hosting
- Lighthouse CI: Run alongside for automated scoring
- webpack-bundle-analyzer: Visual bundle inspection
- React DevTools Profiler: Component-level analysis
Note: This skill works best with Claude Code's deep file exploration. For quick checks, use the bash scripts. For comprehensive audits, delegate to Claude Code.