react-vite-feature-based

Scaffolds and maintains React + Vite projects with a feature-based src/app, src/features, src/shared architecture.

Updated Jun 28, 2026
One-click install
npx skills add https://github.com/jason23452/my-skill --skill react-vite-feature-based-jason23452
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-vite-feature-based
Source: https://github.com/jason23452/my-skill/tree/main/frontend/react-vite-feature-based
Command: npx skills add https://github.com/jason23452/my-skill --skill react-vite-feature-based-jason23452

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Setting up a React + Vite project often leads to ad-hoc folder structures that become hard to scale. This Skill enforces a consistent feature-based architecture with clear ownership boundaries between app-level composition, feature code, and shared building blocks. ## Core Features & Use Cases - Greenfield Bootstrap: Runs Vite React TypeScript scaffolding, configures the @ import alias, pnpm allow-builds, and seeds the required folder layout with a working home route. - Architecture Contract: Defines fixed rules for src/app, src/features, and src/shared, including index-based route segments, a mandatory features/home/router/index.tsx root route, and a three-layer UI composition flow. - Runtime Smoke Testing: Ships a sandboxed smoke script that copies the project to a temp directory, installs dependencies with the detected package manager, and starts the Vite dev server for health checks. - Use Case: Ask the AI to create a new React dashboard app; it scaffolds the project, wires AppRouter with AppShell and the home route, and verifies the result with pnpm build. ## Quick Start Create a new React Vite TypeScript project with the feature-based folder structure and a working home route.

Frequently Asked Questions about react-vite-feature-based

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a React Vite project with feature-based folders?▼

Use three top-level directories: src/app for application composition like AppRouter, src/features for feature folders each containing router, components, hooks, types, and assets, and src/shared for cross-feature UI, layout, hooks, and types. The root path / maps to features/home/router/index.tsx.

How to set up the @ import alias in a Vite React TypeScript project?▼

Add a resolve alias in vite.config.ts mapping @ to ./src using fileURLToPath and new URL, then add baseUrl and paths with "@/*": ["./src/*"] in tsconfig.app.json compilerOptions. The bootstrap script applies both automatically.

Does this React scaffold support npm or yarn instead of pnpm?▼

Yes, the package manager is detected from the lockfile: pnpm-lock.yaml, package-lock.json, yarn.lock, or bun.lock. Greenfield bootstrap defaults to pnpm, but existing projects keep their detected package manager for install, build, and lint commands.

When should I move a component from features to shared in React?▼

Promote a component to shared only when at least two features use it or it wraps all routes, it has no feature-specific copy or imports from features/, and it accepts data and callbacks through props, slots, or config. Rename it with an app-level name like AppSidebar.

Why run the Vite dev server in a sandbox for smoke testing?▼

Docker bind mounts on paths like /workspace can make dev-server readiness unreliable. The runtime-smoke-sandbox script copies the project to a temp directory, installs dependencies, and serves a static health file so liveness does not depend on app rendering.