Skill library

Agent skill Frontend

Chakra UI Refactor

Build or refine reusable components for a web interface.

  • UI components
  • Accessibility

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add chakra-ui/chakra-ui --skill chakra-ui-refactor --agent claude-code --yes

Check this file in your project.claude/skills/chakra-ui-refactor/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add chakra-ui/chakra-ui --skill chakra-ui-refactor

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Bring editable Chakra v3 source, its current Provider/system and a local fixture. The browser fixture used @chakra-ui/react 3.38.0.

View operation manual

What this skill helps with

  • Build or refine reusable components for a web interface.

Good for

  • Component implementation
Skill name
chakra-ui-refactor
Scenario
Refactor validation in an existing Chakra v3 field
Deliverable
A targeted field refactor with a working label, error association and keyboard recovery.
Skill name
chakra-ui-refactor

Define a component task with an observable result

A request with an unclear outcome

Rewrite the form as Chakra and replace its validation logic.

A styling or structure refactor can change how the existing form accepts or rejects inputs.

A workflow with observable results

  1. Review the named field and confirm intent
  2. Compose the v3 field without moving validation
  3. Verify invalid and corrected field states

Chakra UI Refactor operation manual

Find an actual form behavior gap and repair the compound field within the current v3 project.

Replace the bracketed details with your own project and target.

  1. Review the named field and confirm intent

    Find the source type, actual version and behavior that must be preserved.

    Prompt · Step 1
    Use chakra-ui-refactor to review [existing v3 account form]. Confirm the framework, locked Chakra version and whether this call is review or edit. Trace the field's label, validation state, error text and submit handler. Give a short evidence-backed review ordered by impact before making changes.
  2. Compose the v3 field without moving validation

    Use Field parts around the project's existing input logic.

    Prompt · Step 2
    Use chakra-ui-refactor to implement [approved email field changes]. Wrap the control with `Field.Root`, `Field.Label` and `Field.ErrorText`, mapping the actual error to `invalid`. Preserve the app's validated value, submission handler and visible focus. Use project semantic styles instead of adding one-off raw colors.
  3. Verify invalid and corrected field states

    Observe label and error link through real keyboard use.

    • Label, error and corrected state are each observable.
    • The existing save logic still works after the refactor.
    Prompt · Step 3
    Use chakra-ui-refactor to verify [local v3 form]. Locate the textbox by its name, trigger a test error, confirm visible text and the associated programmatic description. Correct with the keyboard and confirm the existing save result. Report changed source paths and which states were verified.

Find the relevant rule

Point the assistant to the installed Skill and a specific issue.

The label exists but the input has no accessible nameReference
Command or reference
SKILL.md · Analyze the code
Examples
Inspect the actual `Field` input and label association.
An existing Chakra review is turning into a rewriteReference
Command or reference
SKILL.md · Review output
Examples
Report evidence and targeted changes before editing scope is approved.

Chakra UI Refactor troubleshooting

Do I need a migration before adjusting Field?

Confirm the app already uses Chakra v3. The refactor can then focus on the scoped field while using the current Provider and validation flow.