refactor-safely

refactor-safely is a skill for Claude Code, Codex from Arasz/ai-raccoon. It costs 148 tokens per session (1,034 once invoked), scanned A, original, MIT.

A refactoring workflow for renaming, moving, extracting, or removing code safely. It lists affected locations before edits, checks the likely impact, and verifies the result with tests.

In plain words
What is it for?
Use it for repository-wide renames, signature changes, extractions, and removals. It helps find callers, inspect critical paths, review the edit list, and test the final result.
Why use it?
It reduces missed references and accidental breakage during changes that span multiple files. Previewing the affected code first is safer than assuming a successful compile means the refactor is complete.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for repository-wide renames, signature changes, extractions, and removals. It helps find callers, inspect critical paths, review the edit list, and test the final result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arasz/ai-raccoon/refactor-safely
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 Arasz/ai-raccoon --skill refactor-safely
Clone the repo
git clone --depth 1 https://github.com/Arasz/ai-raccoon

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-safely

README.md
[![agentmods](https://agentmods.dev/badge/skills/arasz/ai-raccoon/refactor-safely/github.svg)](https://agentmods.dev/skills/arasz/ai-raccoon/refactor-safely)
Your own site
<a href="https://agentmods.dev/skills/arasz/ai-raccoon/refactor-safely"><img src="https://agentmods.dev/badge/skills/arasz/ai-raccoon/refactor-safely/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-safely

Your own site · 80×15
<a href="https://agentmods.dev/skills/arasz/ai-raccoon/refactor-safely"><img src="https://agentmods.dev/badge/skills/arasz/ai-raccoon/refactor-safely.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 148 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,034 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.00148 $0.01034
Opus 5.5 $0.00059 $0.00414
Sonnet 5.5 $0.00030 $0.00207
Haiku 4.5 $0.00015 $0.00103

Measured yesterday against content hash ad3edc54df48, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refactor-safely 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 yesterday.

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.

.ai-badger/skills/refactor-safely/SKILL.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refactor safely

Always preview before applying. The discipline: enumerate every affected location before changing one, confirm no critical path runs through the target unexamined, then verify with tests after — never trust that a rename or removal was complete just because it compiled.

The workflow derives from the skill templates the code-review-graph project auto-installs (MIT, © 2026 Tirth Kanani), rewritten here to be tool-agnostic: every step carries a baseline that needs no graph server.

Steps

  1. Enumerate every affected location before changing one. Accelerated: a code-graph refactor tool in rename-preview mode (e.g. refactor_tool with mode="rename"; discover the real tool name from the server's own listing) returns the full edit list before anything is applied. Baseline: the IDE's rename-refactoring (atomic, reference-aware) where available; otherwise grep -rn every reference and read each hit to rule out false positives (shadowed names, string literals, comments).

  2. Check blast radius and whether a critical path runs through the target. Accelerated: impact-radius / affected-flows calls (e.g. get_impact_radius-shaped, get_affected_flows-shaped). Baseline: grep callers and walk outward toward entry points, same as the tracing step in debug-issue. Flag any hit in auth, payment, data-write, or public API surface.

  3. For a removal, confirm zero reachable callers before deleting — not zero grep hits. Accelerated: a dead-code detection mode (e.g. refactor_tool with mode="dead_code"). Baseline: grep the whole tree including test files and dynamic-dispatch registration (DI container, route table, reflection lookup, config-driven plugin list) — a zero-hit grep is not proof if the language or framework allows dynamic dispatch.

  4. Apply using the safest available mechanism, always using the edit list from step 1 rather than re-deriving it. Accelerated: apply the previewed refactor by its id (e.g. apply_refactor_tool with the refactor_id from step 1). Baseline: the IDE's apply-refactor action, or scripted find-replace only after step 1's list is complete and has been read in full.

Read the full file on GitHub · 81 lines

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. yesterday First seen · 81 lines · 148 tokens per session scan A ad3edc54df48

Subscribe to this mod's changes

refactor-safely is a skill published in the GitHub repository Arasz/ai-raccoon (7 stars, last pushed today), licensed MIT. It adds 148 tokens to every session and 1,034 once invoked, about $0.0006 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-12-05.

Related

refactor-safely compared with skills from other repositories

refactor-safely next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refactor-safelyArasz/ai-raccoonSkill7todayMITA148Claude Code, Codex
pr-bodyalibaba/anolisaSkill68813d agoApache-2.0A68Claude Code, Codex
gitcode-apiXiaoLuoLYG/GODSkill1.3k11d agoApache-2.0A79Claude Code, Codex
pre-prplastic-labs/honchoSkill8.4kyesterdayAGPL-3.0A65Claude Code, Codex
prismer-githubPrismer-AI/PrismerCloudSkill1.4k1mo agoMITA22Claude Code, Codex
yesloopcarsteneu/yesmemSkill483d agoApache-2.0A48Claude Code
babysit-prckorhonen/claude-skillsSkill364d agoMITA48Claude Code, Codex