Web Feature
Ship UI features with typed contracts and reliable states.
For high-end visual exploration or redesign quality, pair this with $frontend-design.
Core stack
- •Generated API types from
web/src/lib/api/schema.d.ts - •TanStack Query for server state
- •Zustand for local UI state
- •shadcn/ui components + Tailwind
- •React Hook Form + Zod for forms
Procedure
- •Confirm endpoint types exist in generated schema (
make generate-typesif needed). - •Create feature folder under
web/src/features/<module>/. - •Implement
use<Module>.tshooks first:- •
useQueryfor reads - •
useMutationfor writes - •clear query keys + invalidation
- •
- •Build components with explicit states:
- •loading
- •empty
- •error
- •success
- •Add forms with RHF + Zod.
- •Use shadcn/ui primitives; compose, do not fork internals.
- •Add/adjust tests for non-trivial components.
- •Run
cd web && pnpm typecheck && pnpm test && pnpm lint.
Rules
- •Never hand-write API request/response types.
- •Avoid
any; keep strict TypeScript. - •Keep data fetching in hooks, not directly in page components.
- •Keep list views paginated and filterable.