FO

form-refactorer

Modernizes legacy React forms by migrating them to the Redpanda UI Registry Field component pattern.

Install

mkdir -p .claude/skills/form-refactorer && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3461" && unzip -o skill.zip -d .claude/skills/form-refactorer && rm skill.zip

Installs to .claude/skills/form-refactorer

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
379 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Refactor legacy forms to use modern Redpanda UI Registry Field components.
  • Implement react-hook-form for form state management.
  • Integrate Zod for validation schemas via zodResolver.
  • Convert Chakra UI or @redpanda-data/ui forms to the modern pattern.
  • Update forms to use Field, FieldLabel, and Input components.
  • Ensure FieldLabel has `htmlFor` matching Input `id`.

How it works

The skill refactors legacy form code by replacing old components with a specific hierarchy of Redpanda UI Registry Field components, react-hook-form for state, and Zod for validation.

Inputs & outputs

You give it
Legacy form code using Chakra UI or @redpanda-data/ui components.
You get back
Modernized form code utilizing Redpanda UI Registry Field components, react-hook-form, and Zod validation.

When to use form-refactorer

  • Migrate legacy Chakra UI forms
  • Implement react-hook-form with Zod validation
  • Refactor form components to Redpanda UI

About this skill

Form Refactorer

Refactor legacy forms to modern Redpanda UI Registry Field components with react-hook-form and Zod validation.

Core Requirements

MUST USE (Modern Pattern)

  • Field component family from components/redpanda-ui/components/field
  • react-hook-form for form state management
  • Zod for validation schemas via zodResolver

FORBIDDEN (Legacy Patterns)

See no-legacy for prohibited patterns. Also never import Form from components/redpanda-ui/components/form.

Component Hierarchy

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

Key Patterns

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>

Checklist

Before completing refactoring, verify:

  • All legacy form imports removed (Chakra, @redpanda-data/ui, legacy Form)
  • Field components used for all fields
  • FieldLabel has htmlFor matching Input id
  • Errors show data-invalid on Field and aria-invalid on Input
  • Yup replaced with Zod + zodResolver
  • FieldSet + FieldLegend used for semantic grouping
  • FieldError conditionally rendered: {errors.field && <FieldError>...
  • Form submission handled via react-hook-form handleSubmit

References

When not to use it

  • When the form does not require react-hook-form for state management.
  • When validation is not handled by Zod.
  • When the form does not use Redpanda UI Registry Field components.

Limitations

  • Cannot be used with legacy form imports from Chakra or @redpanda-data/ui.
  • Requires the use of Field component family from `components/redpanda-ui/components/field`.
  • Requires Zod for validation schemas via `zodResolver`.

How it compares

This skill automates the migration of forms to a specific component and validation standard, unlike manual refactoring which requires developers to identify and replace each legacy pattern individually.

Compared to similar skills

form-refactorer side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
form-refactorer (this skill)15moNo flagsIntermediate
react-modernization212moNo flagsAdvanced
state-management15moNo flagsBeginner
writing-react-effects13moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by redpanda-data

View all by redpanda-data

react-best-practices

redpanda-data

Client-side React performance optimization patterns.

2244

code-standards

redpanda-data

TypeScript, React, and JavaScript best practices enforced by Ultracite/Biome.

27

bloblang-authoring

redpanda-data

This skill should be used when users need to create or debug Bloblang transformation scripts. Trigger when users ask about transforming data, mapping fields, parsing JSON/CSV/XML, converting timestamps, filtering arrays, or mention "bloblang", "blobl", "mapping processor", or describe any data transformation need like "convert this to that" or "transform my JSON".

12

component-search

redpanda-data

This skill should be used when users need to discover Redpanda Connect components for their streaming pipelines. Trigger when users ask about finding inputs, outputs, processors, or other components, or when they mention specific technologies like "kafka consumer", "postgres output", "http server", or ask "which component should I use for X".

12

e2e-tester

redpanda-data

Write and run Playwright E2E tests for Redpanda Console using testcontainers. Analyzes test failures, adds missing testids, and improves test stability. Use when user requests E2E tests, Playwright tests, integration tests, test failures, missing testids, or mentions 'test workflow', 'browser testing', 'end-to-end', or 'testcontainers'.

13

pipeline-assistant

redpanda-data

This skill should be used when users need to create or fix Redpanda Connect pipeline configurations. Trigger when users mention "config", "pipeline", "YAML", "create a config", "fix my config", "validate my pipeline", or describe a streaming pipeline need like "read from Kafka and write to S3".

13

You might also like

Search skills

Search the agent skills registry