V
vite-react-best-practices
About vite-react-best-practices
vite-react-best-practices is a senior-level guide for building production-ready React single-page applications with Vite. It covers deployment, performance, project structure, and troubleshooting, with expanded rules in AGENTS.md.
Key features
- 01SPA rewrite and caching guidance
- 02Build validation and environment variable rules
- 03React route splitting and state guidance
- 04Component performance and image optimization
- 05Feature-based organization and troubleshooting
Use cases
- 01Set up a Vite and React project
- 02Configure SPA deployment and CI/CD
- 03Troubleshoot builds or caching
- 04Refactor components for performance
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ claudiocebpaz/ vite-react-best-practices --skill vite-react-best-practicesAfter installing, type/vite-react-best-practicesin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
README.mdmetadata.jsonAGENTS.mdmarketplace.jsonrules/react-image-optimization.mdreact-colocation.mdanti-import-dist.mdreact-memoization.mdreact-route-splitting.mdreact-server-state.mdvite-build-validation.mdvite-caching-strategy.mdvite-env-vars.mdvite-troubleshooting.mdvite-spa-rewrites.mdDetails
From the project READMEVite React Best Practices
A senior-level guide for building production-ready React Single Page Applications (SPAs) with Vite.
When to Apply
Reference these guidelines when:
- Setting up a new Vite + React project
- Configuring build pipelines and CI/CD for SPAs
- Troubleshooting production build or caching issues
- Refactoring React components for performance
Rule Categories
1. Vite SPA Deployment (CRITICAL)
- Static Rewrites - Mandatory for client-side routing.
- Caching Strategy - Immutable assets, no-cache index.html.
- Build Validation - Preview before push.
- Environment Variables -
VITE_prefix and security.
2. React Core Performance
- Route Splitting - Lazy load pages.
- Server State - Use React Query/SWR.
- Memoization - When to use useMemo/useCallback.
- Image Optimization - CLS prevention.
3. Architecture & Cleanup
- Colocation - Feature-based structure.
- Anti-Patterns: Import from Dist - Avoid bundling twice.
- Troubleshooting - Common Vite fixes.
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
Comments
Markdown supported