refactor

refactor is a command for Claude Code from opkod-france/opkod-claude-code-plugins. It costs 11 tokens per session (240 once invoked), scanned A, original, MIT.

A command that improves a web component's layout and visual styling using the Refactoring UI guidelines, while keeping its behavior unchanged.

In plain words
What is it for?
Use it on an existing UI component to refine button priority, form labels, spacing, colors, widths, de-emphasis, and icon balance.
Why use it?
It targets high-impact interface problems such as unclear buttons, missing labels, inconsistent spacing, and weak text hierarchy without changing application logic.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; positional $N argument.

Part of the ui-polish plugin — 1 skill, 2 commands, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/opkod-france/opkod-claude-code-plugins/refactor
Clone the repo
git clone --depth 1 https://github.com/opkod-france/opkod-claude-code-plugins

Made for: Claude Code.

Or install ui-polish, the plugin that ships this one along with the rest of its 1 skill, 2 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for refactor

README.md
[![agentmods](https://agentmods.dev/badge/commands/opkod-france/opkod-claude-code-plugins/refactor.svg)](https://agentmods.dev/commands/opkod-france/opkod-claude-code-plugins/refactor)
Your own site
<a href="https://agentmods.dev/commands/opkod-france/opkod-claude-code-plugins/refactor"><img src="https://agentmods.dev/badge/commands/opkod-france/opkod-claude-code-plugins/refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 240 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.00240
Opus 5 $0.00005 $0.00120
Sonnet 5 $0.00002 $0.00048
Haiku 4.5 $0.00001 $0.00024

Measured 5d ago against content hash 9f9ab2a2ad02, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ui-polish/commands/refactor.md · 27 lines

What it actually says

Refactor the UI component at @$1 using the refactoring-ui skill (load it for full criteria, anti-patterns, and component patterns).

Process

  1. Read the component and understand its purpose.
  2. Apply Refactoring UI priorities from the skill:
    • High: button hierarchy, missing form labels, arbitrary Tailwind values, grey-on-color text.
    • Medium: spacing consistency (space-y-*, gap-*), text color hierarchy, max-width.
    • Low: de-emphasis, icon balance, polish.
  3. Preserve all logic — only modify styling and layout.

Output

After editing:

  • 2–4 bullets summarizing key changes.
  • Trade-offs that need user review.
  • Anything you couldn't fix due to missing context.

Focus on high-impact changes. A few meaningful improvements beat many minor tweaks. Read-only refactoring of styling — do NOT create new files.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 27 lines · 11 tokens per session scan A 9f9ab2a2ad02

Subscribe to this mod's changes

refactor is a command published in the GitHub repository opkod-france/opkod-claude-code-plugins (9 stars, last pushed 2mo ago), licensed MIT. It adds 11 tokens to every session and 240 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.