react-hook-form
Skill14 starsChanged 4 months agoMITView on GitHub
Build and modify React Hook Form forms. Use when React Hook Form is mentioned, imported, installed, or established by project conventions, including controlled widget integration, schema validation, fetched edit forms, conditional fields, multi-step wizards, field arrays, submission errors, and dirty-state handling. Use the react-hook-form-audit skill when the job is review rather than implementation.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- supabase/supabasetheir own version, first seen Sep 28, 2026
- krivoox/agent-stack-templatetheir own version, first seen Aug 14, 2026
- flpbalada/fb-skillstheir own version, first seen Aug 3, 2026
- Aver005/agent-skillstheir own version, first seen Feb 14, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- supabase/supabase★ 111ksame name
- krivoox/agent-stack-template★ 31same name
- flpbalada/fb-skills★ 8same name
- Aver005/agent-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository46 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- analyze-repoSkill
- architectSkill
- commitSkill
- debugSkill
- frontendSkill
- pr-reviewSkill
- react-hook-form-auditSkill
- reactSkill
- refactorSkill
- researchSkill
- reviewSkill
- specSkill
- testSkill
- auditSkill
- neovimSkill
- shell-envSkill
- learnSkill
- tilSkill
- audit-paraSkill
- capture-receiptSkill
- close-daySkill
- dailySkill
- goalsSkill
- ideasSkill
- ingestSkill
- maintainSkill
- memory-recallSkill
- moneySkill
- process-inboxSkill
- projectSkill
- save-noteSkill
- spot-driftSkill
- vaultSkill
- weekly-reviewSkill
- careerSkill
- check-communicationSkill
- deslopifySkill
- ideationSkill
- prototypeSkill
- standupSkill
- blogSkill
- docsSkill
- talkSkill
- tutorialSkill
- tweet-todaySkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
create or edit form;
- Distinctive: line 35
Create one canonical form-value model.
- Very specific: line 44
Use register when a component preserves the native input contract.
- Distinctive: line 70
Run the project's TypeScript typecheck.
- Very specific: line 82
Complete defaults: Avoid undefined; defaults are the dirty-state comparison baseline.
- Very specific: line 85
Narrow observation: Use useWatch for local reactive UI, useFormState for local form state, getValues for snapshots, and subscribe for …
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React Hook Form
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.
Process
1. Establish the form contract
Inspect the installed RHF, React, resolver, schema, data-fetching, and UI-library versions before writing code. Identify:
- create or edit form;
- submitted value shape and API payload shape;
- client snapshot or live server-data ownership;
- native input contracts versus controlled adapters;
- conditional, array, or wizard branches;
- stable v7 APIs versus installed v8 APIs.
Completion: the value owner, form type, installed versions, and required branches are explicit.
2. Define the schema tree and defaults
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.
3. Build the field boundary
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.
4. Implement lifecycle and branches
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.
5. Verify
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.
Universal rules
- Uncontrolled first. Native contract means
register; design-system component does not automatically meanController. - One registration path. A controlled field is never also registered.
- Complete defaults. Avoid
undefined; defaults are the dirty-state comparison baseline. - Validation is a UX choice. Select
modeandreValidateModefrom interaction cost and feedback needs rather than prescribing one mode globally. - Narrow observation. Use
useWatchfor local reactive UI,useFormStatefor local form state,getValuesfor snapshots, andsubscribefor non-render effects. - Visible and semantic errors. Connect labels and descriptions, put
aria-invalidon the interactive element, and render an associated message. Useroot.*for form-wide failures. - Caught submission. Catch transport failures, preserve edits on failure, and prevent duplicate submissions while work is pending.
- Serialization is a boundary. Hidden-field policy, disabled-field omission, coercion, and dirty-only PATCH behavior are explicit domain decisions.
- Server validation remains authoritative. Client validation improves interaction; it never replaces server validation, authorization, or conflict handling.
Handoff
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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

