Code Refactor
Disciplined multi-file rename/replace refactors with edge-case and breaking-API guardrails
Test report
- Verdict
- Tested · Works
- Score
- Tested
- Jul 21, 2026
- Environment
- Claude Code 2.x (agent harness)
- Upstream re-checked
- Aug 10, 2026 · 8c6bf87
Built two identical 3-file JS projects and ran the same task: rename getUserData -> fetchUserData. BASELINE (naive global replace-all) mutated all 7 occurrences including the string literal `const label = "getUserData"` and `console.log('getUserData called')`. SKILL run followed the body's find->analyze->execute->verify loop and its "Strings/comments: ask if should update" / "exported APIs: warn of breaking changes" rules: it renamed only the 3 genuine identifier sites (def, import, call) plus the descriptive doc comment, and left the legacy string literal and log message intact. Verified referenced api.code_transform.rename_identifier exists (raw fetch HTTP 200); no security smells (no curl|sh, base64, or exfil). Native mode is standalone; execution mode depends on an external runtime not shipped in the skill dir.
Scored on four weighted criteria — install, triggering, output vs. baseline, docs. How scoring works
- Installs cleanly 5/5
- Triggers reliably 5/5
- Output vs. baseline 6/10
- Docs & honesty 4/5
What Code Refactor does
A refactoring skill that walks Claude through a find-analyze-inform-execute-verify-test loop for bulk code changes like renaming identifiers, replacing deprecated patterns, and updating API calls. Triggers when a user asks to rename a variable/function across files, replace all instances of a pattern, or make consistent changes across multiple locations. For 1-9 files it uses native Grep+Edit; for 10+ files it hands off to a Python code-execution runtime for token savings.
How to install Code Refactor
git clone --depth 1 https://github.com/mhattingpete/claude-skills-marketplace.git /tmp/code-refactor-src
mkdir -p ~/.claude/skills
cp -R /tmp/code-refactor-src/code-operations-plugin/skills/code-refactor ~/.claude/skills/code-refactor
# Native mode (1-9 files) is self-contained: uses built-in Grep + Edit tools, no extra deps.
# Execution mode (10+ files) additionally needs the repo's execution-runtime/api/ package
# (code_transform.py etc.) importable on PYTHONPATH via the companion `code-execution` skill.
# That runtime is NOT copied by the command above; only native mode works out of the box.
Skills live in ~/.claude/skills/ (global) or .claude/skills/
(per-project). Restart Claude Code after installing.
Commands — how to trigger Code Refactor
-
/code-refactorDisciplined multi-file rename/replace refactors with edge-case and breaking-API guardrails
It also activates on plain-language prompts like these:
-
Rename this function across every file in the repo -
Replace all deprecated API calls with the new method -
Update this pattern consistently in all locations
Frequently asked questions
- Is the Code Refactor skill free?
- Yes. The skill itself is free from mhattingpete/claude-skills-marketplace. SkillProof publishes the install command and an independent test verdict at no cost.
- Does Code Refactor work with Claude Code?
- We tested it with Claude Code 2.x (agent harness) on Jul 21, 2026. Verdict: Tested · Works. Built two identical 3-file JS projects and ran the same task: rename getUserData -> fetchUserData. BASELINE (naive global replace-all) mutated all 7 occurrences including the string literal `const label = "getUserData"` and `console.log('getUserData called')`. SKILL run followed the body's find->analyze->execute->verify loop and its "Strings/comments: ask if should update" / "exported APIs: warn of breaking changes" rules: it renamed only the 3 genuine identifier sites (def, import, call) plus the descriptive doc comment, and left the legacy string literal and log message intact. Verified referenced api.code_transform.rename_identifier exists (raw fetch HTTP 200); no security smells (no curl|sh, base64, or exfil). Native mode is standalone; execution mode depends on an external runtime not shipped in the skill dir.
- What is the Code Refactor SkillProof Score?
- 8.0/10 — installs cleanly 5/5, triggers reliably 5/5, output vs. baseline 6/10, docs & honesty 4/5.
- How do I install Code Refactor?
- Copy the install command from this page, run it in your terminal, and restart Claude Code. Skills live in ~/.claude/skills/ (global) or .claude/skills/ inside a project.
- Can I use Code Refactor with Cursor, Copilot, Gemini CLI, Codex or other AI tools?
- The SKILL.md format is native to Claude (Claude Code, Desktop, claude.ai). The instructions inside adapt to other assistants: Cursor rules, GitHub Copilot instructions, Windsurf rules, Custom GPTs, AGENTS.md for OpenAI Codex, and GEMINI.md for Google Gemini CLI — our conversion guides cover each, and the free converter on the tools page does the wrapping for you.