refactor_clean

refactor_clean is a skill for Claude Code, Codex from ahmadrrrtx/xr. It costs 0 tokens per session (72 once invoked), scanned A, original, MIT.

A clean-code refactoring guide for improving existing code without changing what it does.

In plain words
What is it for?
Use it to inspect a target file, suggest behavior-preserving improvements, and present a diff for review.
Why use it?
It helps make code easier to read while requiring approval before the changes are written.

Skill for Claude CodeCodex

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 skills/ahmadrrrtx/xr/refactor_clean
Any agent
npx skills add ahmadrrrtx/xr --skill refactor_clean
Clone the repo
git clone --depth 1 https://github.com/ahmadrrrtx/xr

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_clean

README.md
[![agentmods](https://agentmods.dev/badge/skills/ahmadrrrtx/xr/refactor_clean.svg)](https://agentmods.dev/skills/ahmadrrrtx/xr/refactor_clean)
Your own site
<a href="https://agentmods.dev/skills/ahmadrrrtx/xr/refactor_clean"><img src="https://agentmods.dev/badge/skills/ahmadrrrtx/xr/refactor_clean.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 72 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 $0.00000 $0.00072
Opus 5 $0.00000 $0.00036
Sonnet 5 $0.00000 $0.00014
Haiku 4.5 $0.00000 $0.00007

Measured 4d ago against content hash 05d978303bdc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

refactor_clean 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 4d 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.

skills/refactor_clean/SKILL.md · 13 lines

What it actually says

Refactor Clean

  1. read_file the target.
  2. Apply clean-code principles WITHOUT changing behavior.
  3. Present a diff for approval before writing.
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. 4d ago First seen · 13 lines · 0 tokens per session scan A 05d978303bdc

Subscribe to this mod's changes

refactor_clean is a skill published in the GitHub repository ahmadrrrtx/xr (5 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 72 tokens. 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

writing-skills

Use when a task reveals a recurring, multi-step capability worth saving for future sessions — writing a new Norma skill, or improving an existing self-authored one, via skillwrite.

yanlingLabs/norma · 40 tokens

cuj-guardian

Run and triage AI Atelie's Critical User Journey (CUJ) for every PR — the single end-to-end test that proves a user can open the app, create a project, drive the Claude Code agent, and see the canvas render. Before running, gate by inspecting the PR diff for changes that plausibly affect the journey (routes…

aiatelie/ai-atelie · 137 tokens

ship-task

Take an AI Atelie task — issue, ticket, or ad-hoc ask — all the way from description to merged-ready PR. Use whenever the user says "implement X and ship it", "work on issue.

aiatelie/ai-atelie · 46 tokens

canvas-sync

Keep the canvas surface coherent across its three places — the canonical starter at mcp/starters/DesignCanvas.jsx, the byte-identical demo copy at web/projects/demo/design-canvas.jsx, and the host-side wiring in web/src/lib/tweakBridge.ts plus mcp/CANVASPROTOCOL.md. Use whenever the diff touches any of those files, or…

aiatelie/ai-atelie · 147 tokens

export

Export a selected element from the canvas as PNG, JPEG, OGraf bundle, Lottie, or video. Saves to the project's exports/ folder; the chat renders the result inline as an artifact card.

aiatelie/ai-atelie · 43 tokens

pr-evidence

Run AI Atelie's journey suite and inject inline-rendering evidence (per-journey video + screenshot, in a 4-column markdown table) into the current PR's body. Use whenever the user says "post evidence", "run journeys", "update PR with videos", or after ship-task opens a PR. Wraps bun run journeys; idempotent — re-runs…

aiatelie/ai-atelie · 93 tokens