Agent skill

Chakra UI v3 Refactor and Review

by chakra-ui in chakra-ui/chakra-ui

Reviews and converts UI code to Chakra UI v3, producing a critique, rewritten code or both, from plain HTML, Tailwind, CSS Modules or styled-components.

MITAuto-check passedFrontend & Design

Install Chakra UI v3 Refactor and Review

skills CLI
$ npx skills add chakra-ui/chakra-ui --skill chakra-ui-refactor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install chakra-ui/chakra-ui chakra-ui-refactor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/chakra-ui/chakra-ui.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/chakra-ui-refactor .claude/skills/chakra-ui-refactor && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
chakra-ui-refactor
GitHub stars
41k
Token cost
~2.8k tokens
SKILL.md length
1,063 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Reviews and converts UI code to Chakra UI v3, producing a critique, rewritten code or both, from plain HTML, Tailwind, CSS Modules or styled-components.

  • Works in 2 steps: Orient and determine intent → Analyze the code
  • Reviewing Chakra UI code for issues
  • SKILL.md covers Step 1 — Orient and determine…, Step 2 — Analyze the code, Step 3a — Review output and Step 3b — Refactor / convert…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill first orients itself: the Chakra UI version from package.json, defaulting to v3, the framework such as Next.js App Router or Vite, the source type (existing Chakra, plain HTML and CSS, Tailwind, CSS Modules or styled-components) and what you want, which is a review only, a refactor or conversion, or both. It states that reading at the top of its reply and asks for the code if none has been shared.

The analysis covers accessibility, such as labels, keyboard navigation, heading hierarchy and Field.Root with Field.Label and Field.ErrorText, responsiveness across breakpoints and hardcoded pixel values, and Chakra API correctness. It enforces v3 names, for example disabled instead of isDisabled, colorPalette instead of colorScheme, gap instead of spacing and open instead of isOpen, along with correct compound components and correct placement of use client in Next.js App Router.

When your agent uses it

  • Reviewing Chakra UI code for issues
  • Converting Tailwind, CSS Modules or styled-components to Chakra UI
  • Migrating v2 prop names to v3
  • Cleaning up messy Chakra components and layout structure

Example prompts

  • “Convert this Tailwind card component to Chakra UI v3.”
  • “Review my Chakra form: is it using Field.Root correctly?”
  • “Is this component idiomatic Chakra v3? Point out what is wrong.”
  • “Clean up this Chakra layout and replace the hardcoded pixel values with tokens.”

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Orient and determine intent
  2. Analyze the code

What it can do on your machine

Read from SKILL.md and the folder at commit f799e4d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Chakra UI v3 Refactor and Review loads about 2.8k tokens when it runs. Until then it costs about 149 tokens; SKILL.md has 1,063 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~149
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from chakra-ui/chakra-ui at commit f799e4d, republished under its MIT licence (© chakra-ui). 1,063 words, ~2,755 tokens.

Download SKILL.mdSave it as .claude/skills/chakra-ui-refactor/SKILL.md (or your agent's skills folder).
name
chakra-ui-refactor
description
Review, convert, and improve UI code using Chakra UI v3. Use this skill whenever a user wants to review Chakra UI code for issues, convert plain HTML/CSS, Tailwind, CSS Modules, or styled-components to Chakra UI, clean up messy Chakra components, fix layout structure or token usage, or asks anything like "is this correct", "what's wrong with this", "review my component", "refactor this", "clean up", "convert", or "chakra-ify this" — even without the words "review" or "refactor". Trigger on any request to check, improve, or convert Chakra UI code, however casually phrased.

Chakra UI Refactor & Review

You are reviewing and improving UI code using Chakra UI v3. Depending on what the developer needs, you produce a structured critique, rewritten code, or both. Read the code and project context fully before producing any output.


Step 1 — Orient and determine intent

Before any output, establish:

  • Chakra UI version — check package.json; use v3 by default
  • Framework — Next.js App Router, Pages Router, Vite, plain React
  • Source type — existing Chakra, plain HTML/CSS, Tailwind, CSS Modules, styled-components
  • What the user is asking:
    • Review only — "check this", "is this correct/idiomatic", "what's wrong", "review my code" → produce a critique with targeted fixes, no full rewrite
    • Refactor / convert — "refactor this", "convert from Tailwind", "clean this up" → produce rewritten code
    • Both — "review and fix" → critique first, then the rewritten code

State your reading at the top of the response (e.g. "Reviewing as existing Chakra v3 code. Assuming Next.js App Router.").

If code isn't shared yet, ask for it. Don't review a description of code.


Step 2 — Analyze the code

Work through the code across these dimensions regardless of output mode. For review, they become findings. For refactor, they become the checklist of what to fix.

Accessibility

  • Do all interactive elements have accessible labels? (aria-label on icon buttons, htmlFor/id on label+input pairs, alt on images)
  • Is keyboard navigation possible? (focus rings not suppressed, interactive elements are actually focusable)
  • Does the heading hierarchy make sense? (no skipped levels, no h1 used as a style shortcut)
  • Are form fields wrapped in Field.Root with Field.Label and Field.ErrorText?
  • Does the component work without color as the only signal?

Responsiveness

  • Do layout components specify behavior at multiple breakpoints?
  • Are there hardcoded pixel values where responsive tokens would work better?
  • Would this break on mobile? (fixed widths, overflow: hidden on small viewports)

Chakra API correctness

  • Are v3 prop names used? (disabled not isDisabled, colorPalette not colorScheme, gap not spacing, open not isOpen)
  • Are compound components used correctly? (Field.Root/Field.Label, Dialog.Root/Dialog.Content, etc.)
  • Is "use client" placed correctly in Next.js App Router?
  • Are there v2 patterns still present? (extendTheme, ColorModeScript, useColorModeValue, sx prop)

Token and style usage

  • Are hardcoded colors used where semantic tokens would work? (bg="#f9fafb" → bg="bg.subtle")
  • Are raw hex or palette values used instead of semantic tokens? These won't respect dark mode.
  • Are there inline style={{}} props that should be Chakra style props?

Component structure

  • Is there unnecessary nesting? (Box > Box > Box when one would do)
  • Is manual spacing (mt={4} on every child) used where Stack gap={4} would be cleaner?
  • Are the right layout primitives used? (Flex vs Stack vs Grid vs SimpleGrid)

Maintainability

  • Does the same visual pattern repeat 3+ times? (candidate for a component or recipe)
  • Are there one-off style overrides that suggest a recipe or slot recipe?
  • Are prop types / TypeScript types present and accurate?

Step 3a — Review output

Use this when the user wants a critique, not a rewrite.

Categorize findings by impact:

Critical — bugs and accessibility failures that break behavior or exclude users

  • Missing aria-label on an icon-only button
  • Form field with no label association
  • Interactive Box with onClick but no keyboard access
  • Wrong v3 prop name that silently does nothing (isDisabled doesn't disable in v3)
  • "use client" missing on a component that uses hooks in App Router

Improvements — correctness and quality issues that aren't urgent

  • Hardcoded colors that break dark mode
  • Missing responsive breakpoints
  • Unnecessary nesting or wrong layout primitive
  • v2 patterns that still work but should be updated

Optional suggestions — non-blocking ideas

  • Extract a repeated pattern into a component
  • Replace a one-off style with a recipe variant
  • Add a missing TypeScript type

For each critical issue and significant improvement, show a minimal fix:

**Missing aria-label on close button** (Critical)
The IconButton for closing the dialog has no accessible label.

// Before
<IconButton icon={<CloseIcon />} onClick={onClose} />
// After
<IconButton aria-label="Close dialog" icon={<CloseIcon />} onClick={onClose} />

Skip sections with nothing to report. Calibrate length to the code — a 20-line component needs a tight review, not an exhaustive one.


Step 3b — Refactor / convert output

Use this when the user wants rewritten code.

Show full SKILL.md (428 more words)Show less
Conversion strategy by source

From plain HTML / CSS

HTMLChakra equivalent
<div> layout wrapperBox, Flex, Stack, Grid
<section>, <article>Box as="section", Box as="article"
<nav>Box as="nav"
<ul> / <li>Box as="ul" / Box as="li", or Stack
<button>Button or IconButton
<a>Link
<img>Image (preserve alt)
<input>, <select>Input, NativeSelect inside Field.Root
CSSChakra style prop
display: flexFlex or display="flex"
flex-direction: columnStack or flexDir="column"
gap: 16pxgap={4} (1 unit = 4px)
padding: 16px 24pxpy={4} px={6}
border-radius: 8pxrounded="md"
color: #6b7280color="fg.muted"
background: #f9fafbbg="bg.subtle"

From Tailwind CSS

TailwindChakra
flex, flex-col, flex-rowFlex, flexDir
gap-4gap={4}
p-4, px-6, py-2p={4}, px={6}, py={2}
text-sm, font-boldfontSize="sm", fontWeight="bold"
rounded-lg, shadow-mdrounded="lg", shadow="md"
w-full, max-w-lgw="full", maxW="lg"
hidden md:flexdisplay={{ base: "none", md: "flex" }}
grid grid-cols-3SimpleGrid columns={3}
text-gray-500, bg-gray-100color="fg.muted", bg="bg.subtle"
hover:bg-gray-100_hover={{ bg: "bg.subtle" }}

Replace Tailwind responsive prefixes with Chakra's breakpoint object syntax:

tsx
// Tailwind: text-sm md:base lg:text-lg
<Text fontSize={{ base: "sm", md: "md", lg: "lg" }} />

From CSS Modules — convert what you can to Chakra props; keep className for styles that can't be expressed as props (animations, complex selectors):

tsx
// Before
<div className={styles.card}>...</div>
// After — converted to props; className kept only for unconvertible styles
<Box p={4} rounded="lg" shadow="sm" className={styles.fadeIn}>...</Box>

Once all class names are eliminated, remove the import entirely.

From styled-components / @emotion/styled — map to Box with equivalent style props, then remove the import and uninstall if no longer used elsewhere:

tsx
// Before
const Card = styled.div`padding: 1rem; &:hover { background: #f3f4f6; }`
// After
<Box p={4} _hover={{ bg: "bg.muted" }} />

From existing Chakra UI (cleanup)

  • Flatten Box > Box > Box nesting; replace mt/mb on every child with Stack gap={N}
  • Replace sx with css (v3 rename); update nested &:hover selectors inside it
  • Replace bg="gray.50" → bg="bg.subtle" and other semantic token equivalents
  • Update v2 prop names: isDisabled→disabled, colorScheme→colorPalette, spacing→gap
  • Update compound components: FormControl→Field.Root, Modal→Dialog, Select→NativeSelect
Preserve behavior — non-negotiable
  • Keep all event handlers, state variables, and conditional rendering exactly as-is
  • Keep aria-* attributes; add missing ones where clearly needed
  • Keep semantic HTML intent (<nav> → Box as="nav", not just Box)
  • Keep "use client" where it exists; add it only when the component genuinely needs it
  • Don't add "use client" just because a component uses Chakra UI
  • A partially-converted component that works is better than a fully-converted one that doesn't
tsx
import NextLink from "next/link"
<ChakraLink asChild><NextLink href="/about">About</NextLink></ChakraLink>

import NextImage from "next/image"
<ChakraImage asChild><NextImage src="/hero.png" alt="Hero" width={800} height={400} /></ChakraImage>
Refactor output format

1. Refactored code — complete, runnable, with correct imports

2. What changed — concise list focused on non-obvious decisions:

- Replaced <div className="flex gap-4"> with <Flex gap={4}>
- Replaced bg="#f9fafb" with bg="bg.subtle" for dark mode compatibility
- Kept form submit handler and validation logic unchanged
- Added aria-label to close icon button (was missing)

3. Suggestions (optional) — meaningful improvements beyond this refactor: extracting a reusable component, adopting a recipe, migrating a v2 pattern.


When to ask vs proceed

Proceed if the code and intent are clear. Ask when:

  • The code isn't shared yet
  • The component is very large and scope is unclear
  • There's context or state you can't see that would change the review
  • There's ambiguous behavior that could be interpreted multiple ways

State assumptions at the top of the response when you proceed without asking.

© chakra-ui, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/chakra-ui-refactor of chakra-ui/chakra-ui.

Open the folder on GitHubat commit f799e4d

Compare with similar skills

Chakra UI v3 Refactor and Review next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Chakra UI v3 Refactor and Review compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Chakra UI v3 Refactor and Review this skillchakra-ui/chakra-ui41k—~2.8kAutomated safety check: PassMIT
Frontend UI FunctionalvictorGPT/vibeusage131—~939Automated safety check: PassMIT
Cosscrafter-station/petdex4.2k—~1.4kAutomated safety check: PassMIT
UI/UX Design System AdvisorGalaxy-Dawn/claude-scholar5.7k1 repos~1.1kAutomated safety check: PassMIT
Design StyleCastor6/tactus3761 repos~2.1kAutomated safety check: PassApache-2.0
Extract DesignManavarya09/design-extract4.2k—~786Automated safety check: NotesMIT

Similar skills

  • Frontend UI Functional

    victorGPT/vibeusage

    A skill your agent uses when building or refactoring functional React/Vite/Tailwind UI pages, templates, or component libraries that need consistent structure, tokenized styling, accessibility…

    131 GitHub stars~939 tokensUpdated 2 mo ago
    Frontend & DesignAuto-check passed
  • Coss

    crafter-station/petdex

    Helps implement coss UI components correctly. An agent skill from crafter-station/petdex.

    4.2k GitHub stars~1.4k tokensUpdated 9 days ago
    Frontend & DesignAuto-check passed
  • UI/UX Design System Advisor

    Galaxy-Dawn/claude-scholar

    Turns a vague UI request into a concrete design system with style, palette, typography and layout guidance from a search script, plus stack-specific implementation advice.

    5.7k GitHub starsUsed in 1 repo~1.1k tokens
    Frontend & DesignAuto-check passed
  • Design Style

    Castor6/tactus

    A skill your agent uses whenever the user asks to build, create, design, develop, improve, or style any frontend interface or visual element.

    376 GitHub starsUsed in 1 repo~2.1k tokens
    Frontend & DesignAuto-check passed
  • Extract Design

    Manavarya09/design-extract

    Extract the full design language from any website URL. An agent skill from Manavarya09/design-extract.

    4.2k GitHub stars~786 tokensUpdated 8 days ago
    Frontend & DesignAuto-check: notes
  • UI UX Pro Max

    sundial-org/awesome-openclaw-skills

    UI/UX design intelligence and implementation guidance for building polished interfaces.

    663 GitHub starsUsed in 2 repos~657 tokens
    Frontend & DesignAuto-check passed

More from chakra-ui/chakra-ui

  • Chakra UI v3 Builder

    chakra-ui/chakra-ui

    Builds responsive, accessible Chakra UI v3 components and layouts, sets up Chakra in new or existing projects, and designs themes with tokens, semantic tokens and recipes.

    41k GitHub stars~3.1k tokensUpdated yesterday
    Auto-check passed
  • Chakra UI v2 to v3 Migration

    chakra-ui/chakra-ui

    Guides an upgrade from Chakra UI v2 to v3: inspect the project, swap packages, run the official codemod, then fix provider, color mode, props, theming and Next.js code.

    41k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed

Questions about Chakra UI v3 Refactor and Review

What does Chakra UI v3 Refactor and Review do?

Reviews and converts UI code to Chakra UI v3, producing a critique, rewritten code or both, from plain HTML, Tailwind, CSS Modules or styled-components. js App Router or Vite, the source type (existing Chakra, plain HTML and CSS, Tailwind, CSS Modules or styled-components) and what you want, which is a review only, a refactor or conversion, or both. It states that reading at the top of its reply and asks for the code if none has been shared.

When should I use Chakra UI v3 Refactor and Review?

Chakra UI v3 Refactor and Review fits situations like: reviewing Chakra UI code for issues; converting Tailwind, CSS Modules or styled-components to Chakra UI; migrating v2 prop names to v3; cleaning up messy Chakra components and layout structure.

How do I install Chakra UI v3 Refactor and Review in Claude Code?

Run `npx skills add chakra-ui/chakra-ui --skill chakra-ui-refactor -a claude-code`. Or copy the skill folder (skills/chakra-ui-refactor in chakra-ui/chakra-ui) into .claude/skills/chakra-ui-refactor in your project. Claude Code loads it when a task matches its description.

How do I install Chakra UI v3 Refactor and Review in Codex?

Run `npx skills add chakra-ui/chakra-ui --skill chakra-ui-refactor -a codex`. Or copy the skill folder (skills/chakra-ui-refactor in chakra-ui/chakra-ui) into .agents/skills/chakra-ui-refactor in your project. Codex loads it when a task matches its description.

Can I use Chakra UI v3 Refactor and Review in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add chakra-ui/chakra-ui --skill chakra-ui-refactor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/chakra-ui-refactor, .gemini/skills/chakra-ui-refactor, .github/skills/chakra-ui-refactor and .opencode/skills/chakra-ui-refactor in your project.

What does Chakra UI v3 Refactor and Review need to run?

SKILL.md names no scripts, command-line tools or credentials: Chakra UI v3 Refactor and Review is instructions for the agent only.

Does Chakra UI v3 Refactor and Review access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Chakra UI v3 Refactor and Review safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Chakra UI v3 Refactor and Review use?

Chakra UI v3 Refactor and Review is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Chakra UI v3 Refactor and Review use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Chakra UI v3 Refactor and Review?

Skills that share tags, products or a category with Chakra UI v3 Refactor and Review: Frontend UI Functional (victorGPT/vibeusage, 131 stars), Coss (crafter-station/petdex, 4.2k stars), UI/UX Design System Advisor (Galaxy-Dawn/claude-scholar, 5.7k stars) and Design Style (Castor6/tactus, 376 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Chakra UI v3 Refactor and Review?

chakra-ui (a GitHub organization) maintains it in chakra-ui/chakra-ui, which has 40,676 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 6, 2026.

Source: chakra-ui/chakra-ui on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.