npx skills add ...
npx skills add pproenca/dot-skills --skill react-hook-form
React Hook Form performance optimization for client-side form validation using useForm, useWatch, useController, useFieldArray, the subscribe() API, and the Watch / FormStateSubscribe / FieldArray render-prop components. Covers RHF 7.82 additions including resetDefaultValues() and the disabled field-array option. 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 (use react-19 skill for those).
npx skills add pproenca/dot-skills --skill react-hook-form
Comprehensive performance optimization guide for React Hook Form applications. Contains 35 rules across 7 categories, each naming a decision that goes wrong by default. Verified against react-hook-form 7.82.0.
Reference these guidelines when:
useActionState — use the react-19 skill instead<form> + FormData is often simpler than pulling in any library| 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 | State Management | MEDIUM-HIGH | formstate- |
| 6 | Field Arrays | MEDIUM-HIGH | array- |
| 7 | Integration Patterns | MEDIUM | integ- |
formcfg-default-values - Always Provide defaultValues for Form Initializationformcfg-useeffect-dependency - Depend on formState Slices, Not on formState Itselfformcfg-validation-mode - Justify Any mode Other Than the Default onSubmitformcfg-revalidate-mode - Keep Default reValidateMode Unless Validation Is Expensiveformcfg-should-unregister - Keep shouldUnregister Off Unless Hidden Fields Must Leave the Payloadformcfg-transformed-values-generic - Pass the Third useForm Generic When the Resolver Transforms Valuesformcfg-async-default-values - Use Async defaultValues for Server Dataformcfg-disabled-prop - Use the HTML disabled Attribute for Visual Disabling, Not register's disabled Optionformcfg-values-prop - Use the values Prop to Keep a Form in Sync with Server Datasub-avoid-watch-in-render - Avoid Calling watch() in Render for One-Time Readssub-memo-cannot-beat-context - React.memo Cannot Stop Context-Driven Re-renders Under FormProvidersub-subscribe-outside-react - Use subscribe() to React to Form Changes Outside the React Lifecyclesub-render-prop-components - Use the Render-Prop Components to Isolate Re-renders Without a Child Componentsub-useformcontext-sparingly - Use useFormContext Sparingly for Deep Nestingsub-usewatch-over-watch - Use useWatch Instead of watch for Isolated Re-renderssub-watch-specific-fields - Watch Specific Fields Instead of Entire Formctrl-usecontroller-isolation - Isolate Controlled Inputs in Dedicated Child Componentsctrl-controller-field-props - Wire Controller Field Props Correctly for UI Librariesvalid-resolver-caching - Build the Validation Schema Once, Outside the Render Pathvalid-valueasnumber-empty-nan - Handle the NaN valueAsNumber Produces for an Empty Inputvalid-server-errors - Surface Server Errors via setError('root.serverError', ...)valid-delay-error - Use delayError to Debounce Rapid Error Displayformstate-avoid-isvalid-with-onsubmit - Avoid isValid with onSubmit Mode for Button Stateformstate-destructure-formstate - Read Every formState Property You Depend On During Renderformstate-reset-default-values - Rebase Defaults with resetDefaultValues After a Successful Saveformstate-handlesubmit-oninvalid - Use handleSubmit's Second Argument to Handle a Rejected Submitformstate-useformstate-isolation - Use useFormState for Isolated State Subscriptionsformstate-async-submit-lifecycle - Wrap Async Submit Handlers in try/catch and Reset on isSubmitSuccessfularray-separate-crud-operations - Separate Sequential Field Array Operationsarray-use-field-id-as-key - Use field.id as Key in useFieldArray Mapsarray-unique-fieldarray-per-name - Use Single useFieldArray Instance Per Field Namearray-disabled-silently-noops - useFieldArray's disabled Option Makes Every Mutation a Silent No-opinteg-value-transform - Transform Values at Controller Level for Type Coercioninteg-shadcn-form-import - Verify shadcn Form Component Import Sourceinteg-shadcn-select-wiring - Wire shadcn Select with onValueChange Instead of SpreadRead individual reference files for detailed explanations and code examples:
references/{prefix}-{slug}.mdzod skillreact-19 skillfrontend-design skillFor the complete guide with all rules expanded: AGENTS.md