Saarthi-AI react-vite
Guidelines for building React + Vite web apps in the pnpm monorepo with design subagent delegation.
git clone https://github.com/SAARTHII-AI/Saarthi-AI
T=$(mktemp -d) && git clone --depth=1 https://github.com/SAARTHII-AI/Saarthi-AI "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.local/skills/react-vite" ~/.claude/skills/saarthii-ai-saarthi-ai-react-vite && rm -rf "$T"
.local/skills/react-vite/SKILL.mdAlways follow these guidelines when building a React + Vite web application:
Architecture
- Follow modern web application patterns and best-practices.
- Put as much of the app in the frontend as possible. The backend should only be responsible for data persistence and making API calls.
- Minimize the number of files. Collapse similar components into a single file.
- If the app is complex and requires functionality that can't be done in a single request, it is okay to stub out the backend and implement the frontend first.
Frontend
- Load the
skill and calldesign
via thegenerateFrontend()
to build the frontend. Do not pass any design-specific recommendations (colors, fonts, layout). Only pass feature descriptions and backend context. The frontend generator has much better taste than youcode_execution_tool
Approach
Use the
pnpm-workspace skill as the source of truth for shared monorepo rules. When you touch backend code, follow the pnpm-workspace skill's references:
for contract-first OpenAPI + codegenreferences/openapi.md
forreferences/server.md
conventionsartifacts/api-server/src/routes/
forreferences/db.md
and Drizzle guidancelib/db/src/schema/
-
Create the artifact and read the
skilldesign -
Define the OpenAPI contract in
, then runlib/api-spec/openapi.yaml
.pnpm --filter @workspace/api-spec run codegen -
Call
immediately after codegen, following thegenerateFrontend()
skill'sdesign
rules:generateFrontend()- Pass only product features and backend context via
.implementationNotes - Pass a short abstract mood via
when it helps (for example "clean minimal" or "dark mode professional"). Do not reference specific products or brands.designStyle - Pass generated API files via
, plus existing theme/UI files when they are relevant.relevantFiles - Do not describe colors, fonts, layout, or other visual implementation details.
- Do not spend time reading the codegen output before calling
; start the frontend job first, then do the remaining backend work while it runs.generateFrontend()
- Pass only product features and backend context via
-
While the frontend generates, do backend work in parallel:
- First, run
to see the exact Zod schema export names. Never assume or guess generated names — they are derived from OpenAPI operation IDs and are not predictable.grep "^export const" lib/api-zod/src/generated/api.ts - Add DB schema in
when needed, then runlib/db/src/schema/
.pnpm --filter @workspace/db run push - Implement API routes in
.artifacts/api-server/src/routes/ - Seed example data if the app needs it.
- First, run
-
Wait for the frontend generation to finish — by this point your backend is done too.
-
Fix any integration issues (restart workflow and refresh logs)
-
Present the artifact — show it to the user.
-
Call
— prompt the user to publish their app so it's live and accessible.suggestDeploy()
Important Notes:
-
Frontend generation runs in the background — call
as soon as codegen is completegenerateFrontend() -
Do not waste time reading or exploring the codegen files before calling
— this will lead to a slower build timegenerateFrontend() -
For subsequent design iterations or visual fixes after the initial build, use the design subagent (
)subagent(specialization="DESIGN") -
Do not read unnecessary files. When building this artifact, you are not building the frontend so reading the generated react hooks is a waste of time and context
-
After presenting the artifact, call
so the user knows their app is ready to publishsuggestDeploy() -
Follow the service access and routing rules from the
skill.pnpm-workspace -
If the app is being transitioned from a mockup the user made using the canvas, do not call
. Instead, use what the user created to build the react-vite applicationgenerateFrontend
SEO
- Ensure every page has a unique, descriptive title tag (e.g., "Product Name - Category | Site Name")
- Add meta descriptions that summarize page content concisely
- Implement Open Graph tags for better social media sharing appearance
References
If you are touching the frontend, read these files. If you are launching a design subagent, add the full file path to these files so it reads them before implementing the frontend
- Use this reference when adding or changing hover/active/toggle interaction behavior, elevation effects, or overflow-sensitive interactive styling.references/hover_and_elevation.md
- Use this reference when building or modifying UI with Shadcn components (especially Button, Card, Badge, Avatar, and Textarea).references/shadcn_component_rules.md
- Use this reference when structuring page layouts, sections, spacing rhythm, and component alignment.references/layout_and_spacing.md
- Use this reference when building or modifying a sidebar.references/sidebar_rules.md
- Use this reference when choosing contrast, borders, shadows, pane/panel treatment, and hero image presentation.references/visual_style_and_contrast.md
- Use this reference to learn about frontend setup, best practices, and stylingreferences/frontend_general_rules.md