From skills
Builds and modifies React Hook Form forms including controlled widgets, schema validation, fetched edit forms, conditional fields, multi-step wizards, field arrays, submission errors, and dirty-state handling.
How this skill is triggered — by the user, by Claude, or both
Slash command
/skills:react-hook-formThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Build around four decisions: **ownership**, **schema tree**, **adapter**, and **baseline**.
Build around four decisions: ownership, schema tree, adapter, and baseline. RHF evidence is the invocation boundary; an ordinary React form request does not itself justify introducing the library.
Inspect the installed RHF, React, resolver, schema, data-fetching, and UI-library versions before writing code. Identify:
Completion: the value owner, form type, installed versions, and required branches are explicit.
Create one canonical form-value model. Compose section or wizard schemas into the full schema;
when parsing transforms values, distinguish schema input from output types. Supply a complete
non-undefined default for every tracked field and transform API values at the boundary.
Completion: every registered path exists in the typed model and has a valid default; the full submission schema can validate the complete form.
Use register when a component preserves the native input contract. Use Controller or
useController when a widget exposes a controlled or non-native value/change contract. Apply the
accessible field contract to every control.
Completion: every field has one registration path, correct value/event/ref wiring, and an associated label, description when present, and error message.
Load the relevant reference before implementing a branch:
| Priority | Load when | Reference |
|---|---|---|
| 1 — High | Fetched edit data, background refresh, mutation, reset, dirty baseline | references/server-data-and-lifecycle.md |
| 2 — High | UI-library or custom controlled components, accessibility wiring | references/adapters-and-accessibility.md |
| 3 — High | Wizard, step validation, cross-step rule, conditional or hidden field | references/wizards-and-conditionals.md |
| 4 — High | Dynamic or nested rows with useFieldArray | references/field-arrays.md |
| 5 — Medium | Installed project uses or is migrating to RHF v8 | references/version-8.md |
| 6 — Medium | React 19 action or Next.js Server Action appears in the same flow | references/actions-boundary.md |
| 7 — Medium | Tests requested, existing tests affected, or behavior is non-trivial | references/testing.md |
Completion: every detected branch has loaded and applied its reference; no branch is handled from memory alone.
Run the project's TypeScript typecheck. Fix every error caused by the change. Tests are optional: run focused existing tests when present and add tests when requested or when a complex behavior would otherwise remain unverified. Exercise the form manually when runtime tooling is available.
Completion: typecheck passes, or unrelated pre-existing failures are named with evidence; modified paths, submission mapping, and failure behavior have all been checked.
register; design-system component does not
automatically mean Controller.undefined; defaults are the dirty-state comparison baseline.mode and reValidateMode from interaction cost and
feedback needs rather than prescribing one mode globally.useWatch for local reactive UI, useFormState for local form
state, getValues for snapshots, and subscribe for non-render effects.aria-invalid on the
interactive element, and render an associated message. Use root.* for form-wide failures.Report the ownership model, schema/default strategy, adapter choices, lifecycle behavior, version gates, changed files, typecheck command and result, tests run or skipped, and remaining risks.
npx claudepluginhub kriscard/skillsOptimizes React Hook Form client-side form validation with useForm, useWatch, useController, useFieldArray, and subscribe() API. Provides 45 performance rules across 8 categories.
Form patterns for React: react-hook-form (most common), Formik (legacy/stable), TanStack Form (newer). Validation via zod / yup / valibot. Controlled vs uncontrolled inputs, field arrays, multi-step wizards. Use this skill to: - Wire react-hook-form with a validation schema. - Pick between controlled and uncontrolled patterns. - Build multi-step forms with state preservation. - Handle async validation (e.g., username availability). - Integrate forms with TanStack Query mutations. Do NOT use this skill for: - General state management (see react-state-management). - Routing (see react-routing). - Component conventions (see react-conventions). - Testing forms (see react-testing).
41 prioritized performance rules for React Hook Form covering configuration, field subscription, controlled components, validation, and field arrays. Use when writing or reviewing forms to diagnose re-render issues.