Scaffold a shadcn/ui Form without API drift
When to use: You want a Form + react-hook-form + Zod, but Claude keeps using outdated shadcn imports.
Prerequisites
- Next.js / Vite app with shadcn/ui initialized —
npx shadcn@latest init
Flow
-
Get current Form sourceshadcn-ui MCP: get the current source for
form(React) plus its dependencies. Show me the install command.✓ Copied→ Latest source returned; deps list includes react-hook-form, zod -
Build my formNow build a SignupForm using these exact APIs. Email + password + terms checkbox; Zod schema with validation messages. No invented imports.✓ Copied→ Component compiles against current shadcn version
-
VerifyRun
tsc --noEmitand report any unresolved imports.✓ Copied→ Clean TS check
Outcome: A working Form against the current shadcn/ui API — no import { ... } from '@/components/ui/old-name' mistakes.
Pitfalls
- Project is on an older shadcn version — Pin via
--registryor accept the upgrade and runshadcn upgrade