mcpField
R
react-forms

react-forms

github.com/fusengineDevelopment3437 installsUpdated 2w ago
Repository

About react-forms

A React skill for implementing TanStack Form v1, covering form state, validation, and common UI patterns. It is intended for agents building React forms and includes guidance from basic fields through SSR and React Native.

Key features

  1. 01Form and field hooks
  2. 02Standard Schema validation
  3. 03Debounced async validation
  4. 04React 19 Server Actions
  5. 05Nested fields and field arrays

Use cases

  1. 01Build validated React forms
  2. 02Add debounced server-side checks
  3. 03Create nested or repeatable fields
  4. 04Connect forms to Server Actions

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/fusengine/agents --skill react-forms

After installing, type/react-formsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
arrays-nested.md
async-validation.md
devtools.md
linked-fields.md
listeners.md
react-native.md
reactivity.md
reset-api.md
server-actions.md
shadcn-integration.md
ssr-hydration.md
standard-schema.md
tanstack-form-basics.md
references/templates/
basic-form.md
conditional-fields.md
devtools-form.md
dynamic-fields.md
file-upload-form.md
form-composition.md
linked-fields-form.md
listeners-form.md
multi-step-form.md
nested-form.md
optimistic-form.md
react-native-form.md
reactivity-form.md
reset-form.md
search-form.md
server-action-form.md
ssr-form.md

Details

From the project README
Implements TanStack Form v1 in React: core hooks (`useForm()`, `useField()`, `form.Field`, `form.Subscribe`), native Standard Schema validation (Zod ~12KB, Yup ~40KB, Valibot ~6KB, ArkType, Effect Schema — no adapter package), debounced async validation, and React 19 Server Actions integration via `useActionState`.

Also covers array/nested fields with dot notation, listeners for side effects (onMount/onChange/onBlur with debouncing), linked/cross-field validation, reactivity via useStore selectors, the Reset API, SSR/hydration (TanStack Start), devtools, and React Native patterns. This is the React skill for TanStack Form — for the Next.js Server Actions-specific variant see nextjs-tanstack-form, and for SOLID file-organization rules see solid-react.

TanStack Form v1 Core Features

Agent Workflow (MANDATORY)

Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:

  1. fuse-ai-pilot:explore-codebase - Analyze existing form components and validation patterns
  2. fuse-ai-pilot:research-expert - Verify latest TanStack Form v1 docs via Context7/Exa
  3. mcp__context7__query-docs - Check Zod validation and React 19 Server Actions patterns

After implementation, run fuse-ai-pilot:sniper for validation.


MANDATORY: SOLID Principles

ALWAYS apply SOLID principles from solid-react skill.

→ See ../solid-react/SKILL.md for complete rules

Key Rules:

  • Source files stay within FUSE_SOLID_MAX_LINES and split by responsibility when cohesion drops
  • Interfaces in modules/[feature]/src/interfaces/
  • JSDoc mandatory on all exports
  • No business logic in components

Core Hooks

HookPurposeGuide
useForm()Initialize form with validationreferences/tanstack-form-basics.md
useField()Subscribe to individual fieldreferences/tanstack-form-basics.md
form.FieldRender prop component for fieldsreferences/tanstack-form-basics.md
form.SubscribeWatch form state changesreferences/tanstack-form-basics.md

→ See references/tanstack-form-basics.md for detailed usage


Validation Adapters

TanStack Form v1 (@tanstack/react-form 1.33.x) supports Standard Schema natively — pass the schema itself to validators (onChange: userSchema). No adapter: validatorAdapter and @tanstack/zod-form-adapter (last release 0.42.1, pre-v1, Zod 3 only) are removed/obsolete.

LibraryUsageMin versionBundle Size
Zodvalidators: { onChange: schema }3.24.0~12KB
Yupvalidators: { onChange: schema }1.7.0~40KB
Valibotvalidators: { onChange: schema }1.0.0~6KB

→ See references/zod-validation.md for Zod patterns → See references/yup-valibot.md for alternatives


Key Features

Async Validation

Server-side checks with debouncing and loading states. → See references/async-validation.md

Server Actions (React 19)

Integration with useActionState and progressive enhancement. → See references/server-actions.md

Arrays & Nested Fields

Dynamic field arrays and dot notation for nested objects. → See references/arrays-nested.md

TypeScript Integration

Full type inference from Zod schemas and defaultValues. → See references/typescript.md

shadcn/ui Integration

Field wrapper components with shadcn styling. → See references/shadcn-integration.md

Listeners (Side Effects)

onMount, onChange, onBlur, onSubmit with debouncing. → See references/listeners.md

Linked Fields

Cross-field validation and dependent dropdowns. → See references/linked-fields.md

Reactivity & Performance

useStore selectors and granular subscriptions. → See references/reactivity.md

Reset API

Form and field reset with custom values. → See references/reset-api.md

SSR & Hydration

TanStack Start integration and server state merge. → See references/ssr-hydration.md

Devtools

Debug form state with @tanstack/react-form-devtools. → See references/devtools.md

React Native

Mobile-specific patterns with TextInput. → See references/react-native.md

Standard Schema

ArkType and Effect Schema support. → See references/standard-schema.md


Templates

TemplateUse Case
templates/basic-form.mdLogin/signup with Zod
templates/multi-step-form.mdWizard with step validation
templates/dynamic-fields.mdAdd/remove field arrays
templates/file-upload-form.mdFile input with preview
templates/server-action-form.mdReact 19 Server Actions
templates/optimistic-form.mduseOptimistic integration
templates/nested-form.mdDot notation nested fields
templates/search-form.mdDebounced search
templates/conditional-fields.mdShow/hide based on values
templates/form-composition.mdReusable field components
templates/listeners-form.mdSide effects & auto-save
templates/linked-fields-form.mdCross-field validation
templates/reactivity-form.mdPerformance optimization
templates/reset-form.mdForm/field reset patterns
templates/ssr-form.mdSSR & hydration
templates/devtools-form.mdDevtools integration
templates/react-native-form.mdReact Native forms

Best Practices

  1. Validation: Use Zod/Yup/Valibot, NOT custom regex
  2. Async: Debounce server validation (300-500ms)
  3. Errors: Display field.state.meta.errors
  4. Nested: Use dot notation (address.street)
  5. Arrays: Use mode="array" with pushValue/removeValue
  6. TypeScript: Infer types with z.infer<typeof schema>

Forbidden (Anti-Patterns)

  • ❌ useState for form state → use useForm()
  • ❌ Regex validation → use Zod/Yup/Valibot
  • ❌ No debounce on async → use onChangeAsyncDebounceMs
  • ❌ Validation in components → move to schema
  • ❌ Direct onChange → use field.handleChange
  • ❌ No TypeScript types → use z.infer<typeof schema>

Comments

Markdown supported