Agent skill

Ui4 Review

by payloadcms in payloadcms/payload

Review UI4 CSS migrations for proper token usage. An agent skill from payloadcms/payload.

MITAuto-check passedFrontend & Design

Install Ui4 Review

skills CLI
$ npx skills add payloadcms/payload --skill ui4-review -a claude-code

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

GitHub CLI
$ gh skill install payloadcms/payload ui4-review --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/payloadcms/payload.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/ui4-review .claude/skills/ui4-review && 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
ui4-review
GitHub stars
45k
Token cost
~2.4k tokens
SKILL.md length
684 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Review UI4 CSS migrations for proper token usage. An agent skill from payloadcms/payload.

  • Works in 4 steps: Get Changed CSS Files → Parallel Violation Detection → Auto-Fix by Priority → …
  • Tasks that involve Design tokens
  • SKILL.md covers Important: Palette vs Semantic…, Process, Violation Reference and Behavior, plus 2 more sections
  • Calls git

What it does

Ui4 Review is an agent skill from payloadcms/payload. Review UI4 CSS migrations for proper token usage. Checks that CSS variables are used instead of hardcoded values.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering Design tokens and CSS and styling. It works with Payload CMS. The repository describes itself as: Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a… The licence is MIT.

When your agent uses it

  • Tasks that involve Design tokens
  • Tasks that involve CSS and styling

Example prompts

  • “/ui4-review”

Workflow steps

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

  1. Get Changed CSS Files
  2. Parallel Violation Detection
  3. Auto-Fix by Priority
  4. Report

What it can do on your machine

Read from SKILL.md and the folder at commit c66a7be. 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

    Shell commands in SKILL.md call:

    • git

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Ui4 Review loads about 2.4k tokens when it runs. Until then it costs about 31 tokens; SKILL.md has 684 words of instructions outside code blocks.

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

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 payloadcms/payload at commit c66a7be, republished under its MIT licence (© payloadcms). 684 words, ~2,389 tokens.

Download SKILL.mdSave it as .claude/skills/ui4-review/SKILL.md (or your agent's skills folder).
name
ui4-review
description
Review UI4 CSS migrations for proper token usage. Checks that CSS variables are used instead of hardcoded values.

UI4 Review

Reviews CSS changes and auto-fixes token violations.


Important: Palette vs Semantic Tokens

--ramp-* tokens are the raw color palette (e.g., --ramp-white-1000, --ramp-blue-500). These are used only in colors.css to define semantic tokens.

--color-* tokens are context-aware semantic tokens (e.g., --color-bg, --color-text-brand). These handle light/dark theming automatically.

Components and elements should ALWAYS use --color-* semantic tokens, never --ramp-* palette tokens directly.

css
/* ❌ BAD - using raw palette */
background: var(--ramp-white-1000);

/* ✅ GOOD - using semantic token */
background: var(--color-bg);

Process

Step 1: Get Changed CSS Files
bash
git status --porcelain | grep '\.css$'

Or if a specific file is provided, use that directly.

Step 2: Parallel Violation Detection

Run these grep searches IN PARALLEL to detect all violation types at once:

bash
# 1. SCSS Nesting Violations (BEM patterns that don't work in CSS)
grep -n '&__\|&--' "$FILE"

# 2. Hardcoded Spacing (px/rem values that should be tokens)
grep -nE ':\s*[0-9]+px|:\s*[0-9.]+rem' "$FILE"

# 3. Hardcoded Colors (hex, rgb, rgba - includes box-shadow)
grep -nE '#[0-9a-fA-F]{3,8}|rgba?\(' "$FILE"

# 4. Legacy Theme Variables
grep -nE 'var\(--theme-|var\(--style-|var\(--base\)' "$FILE"

# 5. Old Token Names (pre-UI4 naming)
grep -nE '\-\-bg-default|\-\-bg-secondary|\-\-text-default|\-\-text-secondary|\-\-icon-default|\-\-icon-secondary|\-\-border-default|\-\-border-strong' "$FILE"

# 6. Raw Palette Usage (should use semantic tokens instead)
# Skip this check for colors.css which defines the semantic tokens
grep -nE 'var\(--ramp-' "$FILE"

Invoke all 6 grep commands in a single parallel batch, then analyze results.

Note: Raw --ramp-* violations are only flagged in component CSS files, not in colors.css where they're used to define semantic tokens.

Step 3: Auto-Fix by Priority
  1. SCSS Nesting (breaks CSS entirely) — Fix first
  2. Legacy Variables (deprecated) — Replace with new tokens
  3. Old Token Names (pre-UI4) — Convert to --color-* naming
  4. Raw Palette Usage (--ramp-* in components) — Replace with semantic --color-* tokens
  5. Hardcoded Values (spacing, colors, radius) — Replace with tokens
Step 4: Report

After fixing, report:

  • Total violations found
  • Violations auto-fixed
  • Violations that need manual review (no clear token match)

Violation Reference

SCSS Nesting (BREAKS CSS)
PatternIssueFix
&__elementBEM element concatUse flat .block__element selector
&--modifierBEM modifier concatUse flat .block--modifier selector
.child { .parent--mod & }Parent referenceMove to .parent--mod .child

What DOES work: &:hover, &:focus, &::before, & .child


Spacing Tokens
ValueToken
4px / 0.25rem--spacer-1
8px / 0.5rem--spacer-2
12px / 0.75rem--spacer-2-5
16px / 1rem--spacer-3
24px / 1.5rem--spacer-4
32px / 2rem--spacer-5
40px / 2.5rem--spacer-6

Rounding rules — ALWAYS round to nearest token:

Pixel RangeTokenNotes
0-2px--spacer-0Use 0
3-6px--spacer-1 (4px)5-6px rounds to 4px
7-10px--spacer-2 (8px)10px rounds DOWN to 8px
11-14px--spacer-2-5 (12px)13.33px rounds to 12px
15-20px--spacer-3 (16px)15px, 20px both round to 16px
21-28px--spacer-4 (24px)
29-36px--spacer-5 (32px)30px rounds to 32px
37-48px--spacer-6 (40px)

Rule: For values ≤ 40px, ALWAYS use a single token (no calc()). For values > 40px, use calc() with a spacer token.

Exceptions: 0, percentages, auto, inherit, -1px (for clip offsets)


Stroke Width Tokens
ValueToken
1px--stroke-width-small

Radius Tokens
ValueToken
2px / 0.125rem--radius-small
5px / 0.3125rem--radius-medium
13px / 0.8125rem--radius-large
9999px--radius-full

Elevation Tokens (Box Shadows)

Defined in packages/ui/src/css/elevations.css.

Never use hardcoded rgba() for box-shadows. Use elevation tokens instead:

TokenUse Case
--elevation-300-tooltipTooltips, small floating elements
--elevation-400-menu-panelMenus, dropdowns, floating panels
--elevation-500-modal-windowModals, dialogs, full overlays
css
/* ❌ BAD - hardcoded shadow */
box-shadow: 0 -2px 16px -2px rgba(0, 0, 0, 0.2);

/* ✅ GOOD - elevation token */
box-shadow: var(--elevation-400-menu-panel);

Elevations automatically adjust for light/dark themes.


Show full SKILL.md (266 more words)Show less
Semantic Color Tokens (UI4 Naming)

All semantic colors use the --color- prefix. The default category and variant are implicit.

Old NameNew Name (UI4)
--bg-default--color-bg
--bg-secondary--color-bg-secondary
--bg-hover--color-bg-hover
--bg-selected--color-bg-selected
--bg-brand--color-bg-brand
--bg-danger--color-bg-danger
--bg-success--color-bg-success
--bg-warning--color-bg-warning
--text-default--color-text
--text-secondary--color-text-secondary
--text-tertiary--color-text-tertiary
--text-brand--color-text-brand
--text-danger--color-text-danger
--text-success--color-text-success
--icon-default--color-icon
--icon-secondary--color-icon-secondary
--icon-tertiary--color-icon-tertiary
--icon-brand--color-icon-brand
--icon-danger--color-icon-danger
--border-default--color-border
--border-strong--color-border-strong
--border-selected--color-border-selected
--border-brand--color-border-brand

Legacy Variables (Replace Immediately)
LegacyReplacement
--theme-elevation-0--color-bg
--theme-elevation-50--color-bg-secondary
--theme-elevation-100--color-border
--theme-text--color-text
--style-radius-m--radius-medium

var(--base) Conversion: Legacy token = 20px. Convert using:

OriginalPixelsReplacement
var(--base) * 0.48pxvar(--spacer-2)
var(--base) * 0.510pxcalc(var(--spacer-1) * 2.5)
var(--base) * 0.612pxvar(--spacer-2-5)
var(--base)20pxcalc(var(--spacer-4) * 0.833)
var(--base) * 240pxvar(--spacer-6)

See ui4 skill Step 1 for full conversion table.


Behavior

DO NOT just report violations. FIX THEM immediately using replace_string_in_file or multi_replace_string_in_file.

When a violation has no clear token match (e.g., 3px or an unusual rem value), flag it for manual review but don't guess.

For each violation:

  1. Identify the exact line and value
  2. Determine the correct token replacement
  3. Use replace_string_in_file to fix it immediately
  4. Report what was fixed

Only flag (don't fix) when:

  • No matching token exists (e.g., 18px badge size)
  • Value is intentional (e.g., 1px border, 0)
  • Ambiguous replacement

Empty CSS files: If a component's CSS file becomes empty after migration (all styles now handled by shared components like Button), delete the CSS file and remove its import from the component.


Output Format

After auto-fixing, report:

## Auto-Fixed

✅ Collapsible/index.css:9 — `height: 2rem` → `height: var(--spacer-5)`
✅ Collapsible/index.css:120 — `width: 2rem` → `width: var(--spacer-5)`

## Flagged (Manual Review)

⚠️ ErrorPill/index.css:15 — `height: 1.125rem` (18px) — no matching token

Summary

After all fixes, provide a simple summary:

FileFixedFlagged
Collapsible/index.css21
ErrorPill/index.css02

© payloadcms, 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 .agents/skills/ui4-review of payloadcms/payload.

Open the folder on GitHubat commit c66a7be

Compare with similar skills

Ui4 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.

Ui4 Review compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ui4 Review this skillpayloadcms/payload45k—~2.4kAutomated safety check: PassMIT
MCP Developmentcoollabsio/coolify63k1 repos~949Automated safety check: PassMIT
Transitions PolishJakubantalik/transitions.dev4.6k2 repos~3.2kAutomated safety check: PassCustom licence
Web Style ExtractorLucent-Snow/style-extractor453—~3.8kAutomated safety check: PassNone
Liuguang Banlan UIsickn33/agentic-awesome-skills47k1 repos~2.5kAutomated safety check: PassMIT
Tailwind Design SystemSuFxGIT/scoutarr1145 repos~5.6kAutomated safety check: PassNone

Similar skills

  • MCP Development

    coollabsio/coolify

    A skill your agent uses for Laravel MCP development. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 1 repo~949 tokens
    Frontend & DesignAuto-check passed
  • Transitions Polish

    Jakubantalik/transitions.dev

    Audits existing UI animations against the transitions.dev motion-token scale and suggests tokens for duration, distance, scale, blur and easing.

    4.6k GitHub starsUsed in 2 repos~3.2k tokens
    Frontend & DesignAuto-check passed
  • Web Style Extractor

    Lucent-Snow/style-extractor

    Extracts evidence-backed style guides and motion appendices from websites, keeping reusable visual language and stripping product-specific content.

    453 GitHub stars~3.8k tokensUpdated 6 mo ago
    Frontend & DesignAuto-check passed
  • Liuguang Banlan UI

    sickn33/agentic-awesome-skills

    Implements an interface in one of two named color modes, iridescent white or colorful black, from a parameterized starter that reports measured color intensity.

    47k GitHub starsUsed in 1 repo~2.5k tokens
    Frontend & DesignAuto-check passed
  • Tailwind Design System

    SuFxGIT/scoutarr

    Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns.

    114 GitHub starsUsed in 5 repos~5.6k 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 9 days ago
    Frontend & DesignAuto-check: notes

More from payloadcms/payload

All 9 skills in this repo
  • Record PR Demo

    payloadcms/payload

    A skill your agent uses when a Payload pull request needs a concise visual walkthrough for reviewers.

    45k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Payload

    payloadcms/payload

    A skill your agent uses when working with Payload projects (payload.config.ts, collections, fields, hooks, access control, Payload API).

    45k GitHub starsUsed in 5 repos~6.2k tokens
    Auto-check passed
  • Audit Dependencies

    payloadcms/payload

    A skill your agent uses when fixing dependency vulnerabilities, running pnpm audit, or when the audit-dependencies CI check fails

    45k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Generate Translations

    payloadcms/payload

    A skill your agent uses when new translation keys are added to packages to generate new translations strings

    45k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Triage CI Flake

    payloadcms/payload

    A skill your agent uses when CI tests fail on main branch after PR merge, when investigating flaky test failures, or when user provides a PR URL/number to aggregate all failing tests

    45k GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Ui4 Convert Tests

    payloadcms/payload

    A skill your agent uses when UI changes are complete and e2e tests need updating.

    45k GitHub stars~3.5k tokensUpdated today
    Auto-check passed

Works with

Questions about Ui4 Review

What does Ui4 Review do?

Review UI4 CSS migrations for proper token usage. An agent skill from payloadcms/payload. Ui4 Review is an agent skill from payloadcms/payload. Review UI4 CSS migrations for proper token usage.

When should I use Ui4 Review?

Ui4 Review fits situations like: tasks that involve Design tokens; tasks that involve CSS and styling.

How do I install Ui4 Review in Claude Code?

Run `npx skills add payloadcms/payload --skill ui4-review -a claude-code`. Or copy the skill folder (.agents/skills/ui4-review in payloadcms/payload) into .claude/skills/ui4-review in your project. Claude Code loads it when a task matches its description.

How do I install Ui4 Review in Codex?

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

Can I use Ui4 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 payloadcms/payload --skill ui4-review -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ui4-review, .gemini/skills/ui4-review, .github/skills/ui4-review and .opencode/skills/ui4-review in your project.

What does Ui4 Review need to run?

Going by SKILL.md and its folder, Ui4 Review needs the command-line tools its instructions call (git).

Does Ui4 Review access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Ui4 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 Ui4 Review use?

Ui4 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 Ui4 Review use?

About 2.4k tokens (SKILL.md is roughly 9.6k 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 Ui4 Review?

Skills that share tags, products or a category with Ui4 Review: MCP Development (coollabsio/coolify, 63k stars), Transitions Polish (Jakubantalik/transitions.dev, 4.6k stars), Web Style Extractor (Lucent-Snow/style-extractor, 453 stars) and Liuguang Banlan UI (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ui4 Review?

payloadcms (a GitHub organization) maintains it in payloadcms/payload, which has 45,140 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 8, 2026.

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