React SPA Vite
Create a production-ready static React SPA and keep decisions consistent.
Workflow
- •Confirm required inputs:
- •App name
- •Package manager (
pnpmpreferred) - •Need for PWA and offline support
- •Need for SRI hardening
- •Need for image optimization
- •Need for optional testing setup (Vitest, Playwright, both, or none)
- •
Initialize the project with Vite React SWC TypeScript template.
- •
Configure core stack:
- •Tailwind CSS v4 via
@tailwindcss/vite - •TypeScript strict settings
- •Vite aliases when requested
- •Add production features requested by the user:
- •PWA via
vite-plugin-pwa - •SRI via
vite-plugin-sri-gen(must be last in Vite plugin order) - •Image optimization via
vite-imagetools
- •Apply sensible defaults for static deployment:
- •Keep
index.htmlin project root - •Keep source assets in
src/assets/* - •Keep deployable static output in
dist/
- •Validate setup:
- •Install dependencies
- •Run type checks and build
- •Run preview
- •Run tests only if test tooling was added
Reference Map
Load only the reference needed for the current request:
- •
references/quickstart.mdUse for project bootstrap, dependency installation, scripts, and baseline file structure. - •
references/configuration.mdUse for Vite plugin setup, Tailwind v4, PWA, SRI, image optimization, env vars, fonts, and common implementation patterns. - •
references/testing.mdUse only when the user asks for unit/component tests (Vitest) or E2E tests (Playwright). - •
references/troubleshooting.mdUse only when diagnosing build, plugin, PWA, Tailwind, asset, or dev server issues.
Guardrails
- •Keep
SKILL.mdfocused on orchestration; put detailed snippets in references. - •Do not inline large templates in the main skill body.
- •Prefer minimal, working defaults first; add advanced options only when requested.
- •Prefer
pnpmcommands unless the user requests another package manager.