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.5 $0.00016 $0.00063
Sonnet 5.5 $0.00008 $0.00031
Haiku 4.5 $0.00004 $0.00016

Measured 1mo ago against content hash b186bb026482, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 4mo ago), licensed MIT. It adds 40 tokens to every session and 157 once invoked, about $0.0002 per session on Opus 5.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

refactor

Guides a refactor, cleanup, or restructure with the right decomposition. Use when the user asks to refactor, simplify, extract, or modernize code.

code-yeongyu/oh-my-openagent · 36 tokens

pre-publish-review

Nuclear-grade 12-agent pre-publish release gate. Runs /get-unpublished-changes to detect all changes since last npm release, spawns up to 10 ultrabrain agents for deep per-change analysis, invokes /review-work (orchestrator manual QA plus one gate reviewer) for holistic review, and 1 oracle for overall release…

code-yeongyu/oh-my-openagent · 161 tokens

work-with-pr

Full PR lifecycle in a fresh task-owned git worktree: implement via the ulw-loop skill with mandatory evidence-bound manual QA → reviewer-readable English PR → verification loop (CI + Cubic, where Cubic is skipped only when its quota is exhausted) → merge by default → worktree cleanup. Decomposes one task into the…

code-yeongyu/oh-my-openagent · 211 tokens

remove-ai-slops

Removes AI-generated code smells from branch changes or an explicit file list behind regression tests. Use when the user asks to clean up, deslop, or remove AI-slop patterns from recent changes.

code-yeongyu/oh-my-openagent · 45 tokens

review-work

Post-implementation gate review: run manual QA on the real surface yourself, then launch ONE gate reviewer (never a panel) to audit goal, constraints, code quality, security, missed context, and QA evidence. Use before a PR handoff or when the user explicitly asks to review completed work.

code-yeongyu/oh-my-openagent · 63 tokens

tech-debt-audit

Thorough, file-cited technical debt audit across 9 dimensions using AST-grep (tree-sitter), grep, LSP, and language-native tooling. Produces TECHDEBTAUDIT.md with severity, effort estimates, and prioritized fixes. Use when asked for codebase health check, tech debt audit, architecture review, code quality assessment…

code-yeongyu/oh-my-openagent · 127 tokens