Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By xiaolaiv0.4.6ISCIn 2 marketplaces
Block hardcoded UI values; enforce design tokens with rewrite-first hooks and a closed-loop control system
You run one by typing its /name in Claude Code.
1 caution to review before installing
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
2 marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Public GitHub repos that commit this plugin as enabled in their Claude Code settings
A Claude Code plugin that blocks hardcoded UI values and enforces design tokens at the moment the agent writes them.
When the agent calls Write, Edit, or MultiEdit, ui-tokenize inspects the content before it lands on disk and does one of three things:
var(--color-primary) in CSS, tokens.color.primary in TSX, etc.). The agent never sees an error.tokenize__propose MCP tool.It also ships a CLI for init, catalog, audit, fix, propose, and metrics, plus an MCP server exposing five tokenize__* tools.
LLM-generated frontend code drifts away from a design system fast. The agent guesses #3b82f6 when the team has color.primary, picks padding: 17px when the spacing scale only goes 4/8/16/24, and invents new color names when a token already exists. Style Dictionary, Stylelint, and ESLint can catch some of this in CI — but by then the literal is already in the diff, in the agent's context, and likely repeated across files.
ui-tokenize moves the gate to the write itself. The agent's wrong literal is corrected on the way to disk, or it is rejected with the right answer attached. Either way, the design system stays intact and the loop closes in one round-trip instead of three.
Zero runtime dependencies. No build step. Pure Node ESM, ≥ 20.
claude plugin install ui-tokenize@xiaolai --scope project
Install fails with "Plugin not found in marketplace 'xiaolai'"? Your local marketplace clone is stale. Run
claude plugin marketplace update xiaolaiand retry —plugin installdoes not auto-refresh.
In a project with existing tokens (DTCG tokens.json, CSS :root vars, SCSS / LESS / TS / Tailwind / CSS-in-JS):
/ui-tokenize:init
In a project with no tokens yet:
/ui-tokenize:init --starter shadcn
After init, every Write/Edit/MultiEdit from any agent in this project is intercepted automatically. The remaining slash commands are for inspection and CI:
| Command | Purpose |
|---|---|
/ui-tokenize:catalog [pattern] | Print the live token catalog |
/ui-tokenize:audit [--changed-only|--full-repo] [--baseline <ref>] [--json] | Scan for hardcoded values; default gates on changed lines vs baseline |
/ui-tokenize:review [--changed-only|--full-repo] [--baseline <ref>] | Semantic review: dispatch the token-reviewer agent to flag mis-picked tokens |
/ui-tokenize:fix [<path>] | Apply exact-match rewrites in place |
/ui-tokenize:propose <value> "<intent>" | Queue a new token proposal |
/ui-tokenize:metrics | Session ledger: blocks, rewrites, fabrications, escalations |
.tokenize/config.json:
| Mode | Effect |
|---|---|
consumer (default) | Agent cannot write tokens.json directly. New tokens go through tokenize__propose. |
maintainer | tokenize__add_token and tokenize__deprecate MCP tools are exposed; they write to tokens.json after DTCG / naming / collision validation. Direct Write/Edit of tokens.json remains denied. |
npx claudepluginhub xiaolai/ui-tokenize --plugin ui-tokenizeBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground