refactor

refactor is a skill for Claude Code, Codex from tonychen15/xReview. It costs 40 tokens per session (157 once invoked), scanned A, original, MIT.

A command for refactoring code with xReview, a peer-review workflow for code changes. Refactoring means changing code structure without changing its intended behavior.

In plain words
What is it for?
Use it when reorganizing or simplifying code, then send the changes through xReview for review.
Why use it?
It combines the requested cleanup with a separate review step, so the refactored code is checked before delivery.

Skill for Claude CodeCodex

Written for Claude Code and Codex: $ARGUMENTS substitution, but also agents/openai.yaml present. Also seen: mentions Codex.

Good fit Use it when reorganizing or simplifying code, then send the changes through xReview for review.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tonychen15/xreview/xreview-refactor
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.

Any agent
npx skills add tonychen15/xReview --skill xreview-refactor
Clone the repo
git clone --depth 1 https://github.com/tonychen15/xReview

Made for: Claude Code, Codex.

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/skills/tonychen15/xreview/xreview-refactor/github.svg)](https://agentmods.dev/skills/tonychen15/xreview/xreview-refactor)
Your own site
<a href="https://agentmods.dev/skills/tonychen15/xreview/xreview-refactor"><img src="https://agentmods.dev/badge/skills/tonychen15/xreview/xreview-refactor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/tonychen15/xreview/xreview-refactor"><img src="https://agentmods.dev/badge/skills/tonychen15/xreview/xreview-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 157 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00040 $0.00157
Opus 5 $0.00020 $0.00078
Sonnet 5 $0.00008 $0.00031
Haiku 4.5 $0.00004 $0.00016

Measured 10d ago against content hash b186bb026482, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 10d 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.

codex/commands/xreview-refactor/SKILL.md · 21 lines

What it actually says

Run this command first:

xreview codex refactor "$ARGUMENTS"

Read the script's output carefully. It tells you the session number and what to append to .review/REVIEW.md.

Then follow these steps:

  1. Append the session header and "Implementing" line to .review/REVIEW.md (use the exact format from the script output)
  2. Perform the refactoring described in the objective
  3. When done, run xreview review to trigger the reviewer
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 21 lines · 40 tokens per session scan A b186bb026482

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository tonychen15/xReview (2 stars, last pushed 2mo ago), licensed MIT. It adds 40 tokens to every session and 157 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

review-implementing

Process and implement code review feedback systematically. Use when user provides reviewer comments, PR feedback, code review notes, or asks to implement suggestions from reviews.

mhattingpete/claude-skills-marketplace · 35 tokens

code-auditor

Performs comprehensive codebase analysis covering architecture, code quality, security, performance, testing, and maintainability. Use when user wants to audit code quality, identify technical debt, find security issues, assess test coverage, or get a codebase health check.

mhattingpete/claude-skills-marketplace · 56 tokens

react-senior-code-review

Senior-level review of a React feature, by theSeniorDev — structure & boundaries, state & data flow, performance & rendering, types/forms/testability/a11y, and styling architecture & motion. Recommends design patterns by name when one fits. Produces prioritized findings (Critical → Nit) with file:line, why, and a…

the-senior-dev/senior-dev-skills · 127 tokens

shipkit-review-shipping

Review changes across 12 quality dimensions and report findings. Use after a chunk of work or before commit.

stefan-stepzero/shipkit · 27 tokens

shipkit-prompt-audit

Audit LLM prompt pipeline architecture — decomposition, parallelization, chain integrity, schema validation, fallback paths. Finds structural issues no linter catches.

stefan-stepzero/shipkit · 36 tokens

shipkit-review-planning

Internal reviewer — assesses planning artifact alignment. Checks definitions agree, specs cover roadmap, no gaps. A per-unit reviewer invoked by a caller (the engine in steered mode or a direction/planning caller), not for direct use.

stefan-stepzero/shipkit · 52 tokens