.agents/skills/react-hook-form/SKILL.md
React Hook Form performance optimization for client-side form validation using useForm, useWatch, useController, and useFieldArray. This skill should be used when building client-side controlled forms with React Hook Form library. This skill does NOT cover React 19 Server Actions, useActionState, or server-side form handling.
npx skillsauth add HuynhSang2005/delivery-app react-hook-formInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive performance optimization guide for React Hook Form applications. Contains 41 rules across 8 categories, prioritized by impact to guide form development, automated refactoring, and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Form Configuration | CRITICAL | formcfg- |
| 2 | Field Subscription | CRITICAL | sub- |
| 3 | Controlled Components | HIGH | ctrl- |
| 4 | Validation Patterns | HIGH | valid- |
| 5 | Field Arrays | MEDIUM-HIGH | array- |
| 6 | State Management | MEDIUM | formstate- |
| 7 | Integration Patterns | MEDIUM | integ- |
| 8 | Advanced Patterns | LOW | adv- |
formcfg-validation-mode - Use onSubmit mode for optimal performanceformcfg-revalidate-mode - Set reValidateMode to onBlur for post-submit performanceformcfg-default-values - Always provide defaultValues for form initializationformcfg-async-default-values - Use async defaultValues for server dataformcfg-should-unregister - Enable shouldUnregister for dynamic form memory efficiencyformcfg-useeffect-dependency - Avoid useForm return object in useEffect dependenciessub-usewatch-over-watch - Use useWatch instead of watch for isolated re-renderssub-watch-specific-fields - Watch specific fields instead of entire formsub-usewatch-with-getvalues - Combine useWatch with getValues for timing safetysub-deep-subscription - Subscribe deep in component tree where data is neededsub-avoid-watch-in-render - Avoid calling watch() in render for one-time readssub-usewatch-default-value - Provide defaultValue to useWatch for initial rendersub-useformcontext-sparingly - Use useFormContext sparingly for deep nestingctrl-usecontroller-isolation - Use useController for re-render isolationctrl-avoid-double-registration - Avoid double registration with useControllerctrl-controller-field-props - Wire Controller field props correctly for UI librariesctrl-single-usecontroller-per-component - Use single useController per componentctrl-local-state-combination - Combine local state with useController for UI-only statevalid-resolver-caching - Define schema outside component for resolver cachingvalid-dynamic-schema-factory - Use schema factory for dynamic validationvalid-error-message-strategy - Access errors via optional chaining or lodash getvalid-inline-vs-resolver - Prefer resolver over inline validation for complex rulesvalid-delay-error - Use delayError to debounce rapid error displayvalid-native-validation - Consider native validation for simple formsarray-use-field-id-as-key - Use field.id as key in useFieldArray mapsarray-complete-default-objects - Provide complete default objects for field array operationsarray-separate-crud-operations - Separate sequential field array operationsarray-unique-fieldarray-per-name - Use single useFieldArray instance per field namearray-virtualization-formprovider - Use FormProvider for virtualized field arraysformstate-destructure-formstate - Destructure formState properties before renderformstate-useformstate-isolation - Use useFormState for isolated state subscriptionsformstate-getfieldstate-for-single-field - Use getFieldState for single field state accessformstate-subscribe-to-specific-fields - Subscribe to specific field names in useFormStateformstate-avoid-isvalid-with-onsubmit - Avoid isValid with onSubmit mode for button stateinteg-shadcn-form-import - Verify shadcn Form component import sourceinteg-shadcn-select-wiring - Wire shadcn Select with onValueChange instead of spreadinteg-mui-controller-pattern - Use Controller for Material-UI componentsinteg-value-transform - Transform values at Controller level for type coercionadv-formprovider-memo - Wrap FormProvider children with React.memoadv-devtools-performance - Disable DevTools in production and during performance testingadv-testing-wrapper - Create test wrapper with QueryClient and AuthProviderRead individual reference files for detailed explanations and code examples:
references/{prefix}-{slug}.mdzod skillplan-workfrontend-design skillFor the complete guide with all rules expanded: AGENTS.md
tools
Build type-safe validated forms using React Hook Form v7 and Zod v4. Single schema works on client and server with full TypeScript inference via z.infer. Use when building forms, multi-step wizards, or fixing uncontrolled warnings, resolver errors, useFieldArray issues, performance problems with large forms.
tools
Prisma Postgres setup and operations guidance across Console, create-db CLI, Management API, and Management API SDK. Use when creating Prisma Postgres databases, working in Prisma Console, provisioning with create-db/create-pg/create-postgres, or integrating programmatic provisioning with service tokens or OAuth.
development
Required reference for Prisma v7 driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter/Transaction interfaces. Contains critical contract details not inferable from code examples — including the transaction lifecycle protocol, error mapping requirements, and verification checklist. Existing implementations do not replace this skill.
development
Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.). Use when setting up a new project, changing databases, or troubleshooting connection issues. Triggers on "configure postgres", "connect to mysql", "setup mongodb", "sqlite setup".