frontend/.claude/skills/form-refactorer/SKILL.md
--- name: form-refactorer description: Refactor legacy forms to use modern Redpanda UI Registry Field components with react-hook-form and Zod validation. Use when user requests: (1) Form refactoring or modernization, (2) Converting Chakra UI or @redpanda-data/ui forms, (3) Updating forms to use Field components, (4) Migrating from legacy form patterns, (5) Implementing forms with react-hook-form and Zod validation. --- # Form Refactorer Refactor legacy forms to modern Redpanda UI Registry Fiel
npx skillsauth add redpanda-data/console frontend/.claude/skills/form-refactorerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Refactor legacy forms to modern Redpanda UI Registry Field components with react-hook-form and Zod validation.
components/redpanda-ui/components/fieldzodResolverSee no-legacy for prohibited patterns. Also never import Form from components/redpanda-ui/components/form.
FieldSet - Semantic fieldset container for related fields
├─ FieldLegend - Title for the fieldset
├─ FieldDescription - Description for entire fieldset
└─ FieldGroup - Layout wrapper that stacks fields
├─ Field - Individual field wrapper
│ ├─ FieldLabel - Label for input (use htmlFor)
│ ├─ Input/Select/... - Form control
│ ├─ FieldDescription - Helper text
│ └─ FieldError - Error message
├─ FieldSeparator - Visual divider between fields
└─ Field - Another field
Vertical field:
<Field data-invalid={!!errors.fieldName}>
<FieldLabel htmlFor="fieldName">Label</FieldLabel>
<Input id="fieldName" {...register("fieldName")} aria-invalid={!!errors.fieldName} />
{errors.fieldName && <FieldError>{errors.fieldName.message}</FieldError>}
</Field>
Horizontal field (switch/checkbox):
<Field orientation="horizontal">
<Switch id="toggle" {...register("toggle")} />
<FieldContent>
<FieldLabel htmlFor="toggle">Enable Feature</FieldLabel>
<FieldDescription>Description</FieldDescription>
</FieldContent>
</Field>
Before completing refactoring, verify:
htmlFor matching Input iddata-invalid on Field and aria-invalid on Input{errors.field && <FieldError>...handleSubmitdevelopment
Review UI code for Web Interface Guidelines compliance
development
Build UI with Redpanda Registry components, Tailwind v4, and accessibility best practices.
testing
Write and maintain tests with Vitest v4 dual configuration, mock utilities, and Zustand store testing patterns.
development
Migrate React applications from React Router to TanStack Router with file-based routing. Use when user requests: (1) Router migration, (2) TanStack Router setup, (3) File-based routing implementation, (4) React Router replacement, (5) Type-safe routing, or mentions 'migrate router', 'tanstack router', 'file-based routes'.