asyrafhussin avatar

React Vite Best Practices

A solid reference for keeping your React and Vite setup fast. It covers the essentials: manual chunk splitting to separate vendor code, route-based lazy loading with Suspense boundaries, HMR configuration, and asset optimization strategies. The 23 rules are organized by impact (build optimization and code splitting flagged as critical), which helps you prioritize. Includes ready-to-use vite.config.ts snippets and patterns for dynamic imports. Most useful during initial project setup or when your bundle size creeps up and you need a systematic audit. The rules assume you understand React and Vite basics but need specific guidance on what actually moves the performance needle versus cargo cult optimization.

skills.sh installs
3K
GitHub stars
102
last updated
Aug 21, 2026

Install

$ npx -y skills add asyrafhussin/agent-skills --skill react-vite-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Files

React + Vite Best Practices

Comprehensive performance optimization guide for React applications built with Vite. Contains 23 rules across 6 categories for build optimization, code splitting, development performance, asset handling, environment configuration, and bundle analysis.

Metadata

  • Version: 2.0.0
  • Framework: React + Vite
  • Rule Count: 23 rules across 6 categories
  • License: MIT

When to Apply

Reference these guidelines when:

  • Configuring Vite for React projects
  • Implementing code splitting and lazy loading
  • Optimizing build output and bundle size
  • Setting up development environment and HMR
  • Handling images, fonts, SVGs, and static assets
  • Managing environment variables across environments
  • Analyzing bundle size and dependencies

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Build OptimizationCRITICALbuild-
2Code SplittingCRITICALsplit-
3DevelopmentHIGHdev-
4Asset HandlingHIGHasset-
5Environment ConfigMEDIUMenv-
6Bundle AnalysisMEDIUMbundle-

Quick Reference

Sponsors

Details

Repository
github.com/asyrafhussin/agent-skills
Categories
Frontend Development, DevOps & CI/CD, Documentation, AI & Agent Building, Debugging

More from asyrafhussin/agent-skills

All 14
1mastra-ai avatarreact-best-practicesmastra-ai/mastraReact performance optimization guidelines from Mastra Engineering. This skill should be used when writing, reviewing, or refactoring React code to ensure optima2.8Kskills.sh installs
2nexu-io avatardesign-taste-frontendnexu-io/open-designAnti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that d2.8Kskills.sh installs
3hyf0 avatarvue-pinia-best-practiceshyf0/vue-skillsvue pinia best practices2.8Kskills.sh installs
4owl-listener avatarresponsive-designowl-listener/designer-skillsDesign adaptive layouts and interactions that work across all screen sizes and input methods.2.5Kskills.sh installs
5chrisbanes avatarcompose-ui-testing-patternschrisbanes/skillsUse when writing or reviewing Jetpack Compose UI tests, screenshot tests, previews, semantics assertions, fake image loading, keyboard input, focus assertions, 2.5Kskills.sh installs
6alinaqi avatarpwa-developmentalinaqi/claude-bootstrappwa development2.4Kskills.sh installs