Use this skill when: Create forms, add validation, use react-hook-form. Focus on user intent. Trigger keywords: form-builder.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Prefer FormBuilder + useFormBuilder for new forms instead of hand-wiring react-hook-form.
Validation is Zod-first (Zod v4): schema type is z.ZodType<TValues, TValues>.
Errors are per-field (via shadcn FormMessage); don’t add global error summaries unless explicitly requested.
Actions:
If children is provided to FormBuilder, render it as the action area.
Otherwise render default Cancel + Save buttons.
UI Schema rules
UI schema is array-based (FormBuilderUiSchema).
section and separator items MUST have stable id values (no array-index keys).
Labels/descriptions/placeholders are plain strings (no i18n objects).
Field behavior conventions
Keep each field renderer in its own file in fields/ and export from fields/index.ts.
richtext now uses RichtextField (Plate.js) with markdown round-trip serialization (string in/out).
date uses input[type=datetime-local] with seconds support (step=1 by default).
checkbox list must remain accessible (id + label htmlFor).
media returns File[] (not FileList); uploading/persistence is handled by the feature layer.
mediaLibrary is a URL-based picker field: user can choose an existing file from Media Library or upload through the Media Library upload flow, then insert a URL string into the form value.