From react-ko-form
Generate complete React Hook Form code from natural language field definitions. Use when the user wants to scaffold a typed form with validation and error handling.
How this skill is triggered — by the user, by Claude, or both
Slash command
/react-ko-form:form-builder <form description: e.g., login form with email and password><form description: e.g., login form with email and password>This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate a complete, typed React Hook Form component from a plain-language description.
Generate a complete, typed React Hook Form component from a plain-language description.
Before generating code, always verify API options from local docs:
${CLAUDE_SKILL_DIR}/docs/docs/useform/register.mdx${CLAUDE_SKILL_DIR}/docs/docs/useform.mdx — skip the first 79 lines (SelectNav navigation component, content starts at line 80)<TypeText>T</TypeText> or <TypeText pre>T</TypeText> — inline type annotation. Read the text content as the TypeScript type.<PrettyObject value={{key: 'type', ...}}/> — renders a type shape. Read the value prop as the type definition.<TabGroup buttonLabels={["X", "Y"]}> — tabbed content with alternative views (e.g., TS vs JS). Read all tabs as variants.<Admonition type="note|important|tip" title="..."> — callout block. Always read; contains critical rules or caveats.<SelectNav options={[...]}> — navigation menu. Skip for content purposes.<CodeArea> — code display component. Read the code content within.<Popup message="..."> — tooltip hint. The message prop contains supplementary info.<div style={...}>, import ..., export ... statements.Arguments provided → parse field definitions → follow the Code Generation Workflow below.
No arguments → show the following examples and ask the user to describe their form:
Usage examples:
/react-ko-form:form-builder login form with email and password
/react-ko-form:form-builder registration with name, email, password (min 8), confirm password, and terms checkbox
/react-ko-form:form-builder contact form with name, email, phone (optional), and message (textarea)
Describe your form and I'll generate the complete TypeScript component.
Extract from the natural language description:
Read both files to verify current API options before generating:
${CLAUDE_SKILL_DIR}/docs/docs/useform/register.mdx — validation rule options${CLAUDE_SKILL_DIR}/docs/docs/useform.mdx (from line 80) — useForm optionsProduce all of the following in order:
interface for form field typesuseForm<T>() hook setup with appropriate optionsregister() calls with validation rulesformState.errors error handling for each validated fieldhandleSubmit + onSubmit functionFor forms with more than 8 fields: generate the TypeScript interface and useForm setup first, then ask the user to confirm before generating the full JSX.
| Field Type | Validation Rules |
|---|---|
{ required: "Email is required", pattern: { value: /\S+@\S+\.\S+/, message: "Invalid email" } } | |
| password | { required: "Password is required", minLength: { value: 8, message: "At least 8 characters" } } |
| confirm password | { validate: (value, formValues) => value === formValues.password || "Passwords do not match" } |
| phone | { pattern: { value: /^\+?[0-9\s\-()]{7,15}$/, message: "Invalid phone number" } } |
| number | { min: 0, max: 999, valueAsNumber: true } |
| URL | { pattern: { value: /^https?:\/\/.+/, message: "Invalid URL" } } |
| required checkbox | { required: "You must accept the terms" } |
| textarea | { required: "Message is required", maxLength: { value: 500, message: "Max 500 characters" } } |
useFieldArray has no MDX documentation. When dynamic fields are requested:
${CLAUDE_SKILL_DIR}/examples/useFieldArray.ts and ${CLAUDE_SKILL_DIR}/examples/useFieldArrayArgument.tsuseFieldArray({ control, name }) returns { fields, append, remove, prepend, swap, move, insert, update, replace }field.id as key (not array index)append(): append({ name: "", quantity: 1 })register(`items.${index}.name`)Given: "login form with email and password"
import { useForm } from "react-hook-form";
interface LoginFormValues {
email: string;
password: string;
}
export function LoginForm() {
const {
register,
handleSubmit,
formState: { errors },
} = useForm<LoginFormValues>({ mode: "onBlur" });
const onSubmit = (data: LoginFormValues) => console.log(data);
return (
<form onSubmit={handleSubmit(onSubmit)}>
<div>
<label htmlFor="email">Email</label>
<input
id="email"
type="email"
{...register("email", {
required: "Email is required",
pattern: { value: /\S+@\S+\.\S+/, message: "Invalid email" },
})}
/>
{errors.email && <span>{errors.email.message}</span>}
</div>
{/* Repeat the pattern above for each field */}
<button type="submit">Submit</button>
</form>
);
}
useForm<FormType>)/react-ko-form:recommend/react-ko-form:guide <api-name>Based on react-hook-form v7.x documentation.
npx claudepluginhub hamsurang/react-ko-form --plugin react-ko-formRecommend the right React Hook Form API or pattern for your use case. Use when the user asks which hook, component, or pattern to use for a specific form requirement.
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).
Optimizes React Hook Form client-side form validation with useForm, useWatch, useController, useFieldArray, and subscribe() API. Provides 45 performance rules across 8 categories.