
- Installs
- 482
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/pymodel/react-frontend-skills --skill react-hook-form- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads react-hook-form automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
React Hook Form Best Practices
Comprehensive performance optimization guide for React Hook Form applications. Contains 45 rules across 8 categories, prioritized by impact to guide form development, automated refactoring, and code generation.
When to Apply
Reference these guidelines when:
- Writing new forms with React Hook Form
- Configuring useForm options (mode, defaultValues, validation)
- Subscribing to form values with watch/useWatch
- Integrating controlled UI components (MUI, shadcn, Ant Design)
- Managing dynamic field arrays with useFieldArray
- Reviewing forms for performance issues
Rule Categories by Priority
| 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- |
Quick Reference
1. Form Configuration (CRITICAL)
formcfg-validation-mode- Choose validation mode from UX and validation costformcfg-revalidate-mode- Choose post-submit revalidation deliberatelyformcfg-default-values- Always provide defaultValues for form initializationformcfg-async-default-values- Use async defaultValues for server dataformcfg-should-unregister- Choose shouldUnregister from submission semanticsformcfg-useeffect-dependency- Avoid useForm return object in useEffect dependencies
2. Field Subscription (CRITICAL)
sub-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 nesting
3. Controlled Components (HIGH)
ctrl-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- Split controlled fields when isolation helpsctrl-local-state-combination- Combine local state with useController for UI-only state
4. Validation Patterns (HIGH)
valid-resolver-caching- Define schema outside component for resolver cachingvalid-dynamic-schema-factory- Use schema factory for dynamic validationvalid-error-message-strategy- Render field errors with ErrorMessage (7.88+) or optional chainingvalid-trigger-should-touch- Mark fields touched when triggering validation (7.87+)valid-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 formsvalid-form-level-validate- Validate cross-fields with the form-level validate option (7.72+)
5. Field Arrays (MEDIUM-HIGH)
array-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 arrays
6. State Management (MEDIUM)
formstate-destructure-formstate- Destructure formState properties before renderformstate-useformstate-isolation- Use useFormState for isolated state subscriptionsformstate-getfieldstate-for-single-field- Use getFieldState and getErrors for single-field readsformstate-subscribe-to-specific-fields- Subscribe to specific field names in useFormStateformstate-avoid-isvalid-with-onsubmit- Align submit gating with validation mode
7. Integration Patterns (MEDIUM)
integ-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 coercioninteg-typed-submit-server-action- Submit with a typed handleSubmit result or Server Action (7.84+)
8. Advanced Patterns (LOW)
adv-formprovider-memo- Memoize FormProvider children only after profilingadv-devtools-performance- Disable DevTools in production and during performance testingadv-testing-wrapper- Create test wrapper with QueryClient and AuthProvideradv-opaque-types- Register value classes in OpaqueTypes (7.87+)
How to Use
Run in the project root first:
npx -y @pymodel/react-frontend-skills detect # installed vs. targeted versions
npx -y @pymodel/react-frontend-skills scan --skill react-hook-form # deprecated APIs → rule IDs
Read references/<rule-id>.md for each rule above that matches the task and for each scan hit: why it matters, then incorrect vs. correct code.
Related Skills
- For schema validation with Zod resolver, see
zodskill - For React 19 server actions, see
reactskill - For UI/UX form design, see
ui-designskill
FAQ
What does the react-hook-form skill do?
React Hook Form 7 forms and validation.
How do I install react-hook-form?
Run npx skills add https://github.com/pymodel/react-frontend-skills --skill react-hook-form in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/react-hook-form/ (personal) or .claude/skills/react-hook-form/ (project).
Which AI agents can use react-hook-form?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is react-hook-form safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains react-hook-form?
It is published by pymodel in pymodel/react-frontend-skills. It has 482 recorded installs.
More from pymodel/react-frontend-skills
ui-design
pymodel/react-frontend-skills
Accessible, responsive frontend UI and UX design.
typescript
pymodel/react-frontend-skills
TypeScript types, tsconfig and TypeScript 7 migration.
tailwind
pymodel/react-frontend-skills
Tailwind CSS v4 styling and configuration.
zod
pymodel/react-frontend-skills
Zod 4 schema validation and type inference.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.