code-refactor
Code Refactor handles systematic refactoring operations like renaming identifiers, replacing deprecated patterns, and updating method calls across your codebase. It intelligently switches to execution mode for larger jobs (10+ files), delivering significant token savings while maintaining accuracy through a safe find-analyze-execute-verify workflow.
Code Refactor renames identifiers and replaces patterns across multiple files, auto-switching to execution mode for 10+ files to save tokens.
AI-generated summary based on this skill's SKILL.md
Install
mhattingpete/claude-skills-marketplace/code-refactor · repository language: HTML
git clone https://github.com/mhattingpete/claude-skills-marketplace
cp -r claude-skills-marketplace/code-operations-plugin/skills/code-refactor ~/.claude/skills/code-refactorFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How does code-refactor rename variables across all files?
Code Refactor scans your codebase to identify all occurrences of the target identifier, then applies the rename systematically across every file where it appears. For projects with 10 or more files, it switches to execution mode, which optimizes token usage while maintaining accuracy through its find-analyze-execute-verify workflow.
Can code-refactor bulk find and replace code patterns?
Yes. Code Refactor performs bulk find-and-replace operations safely by first analyzing the scope of changes needed, then executing the replacement across all matching locations. This systematic approach ensures deprecated patterns, old API endpoints, and other code elements are updated consistently throughout your project.
What makes code-refactor suitable for refactoring function names in projects?
Code Refactor intelligently handles multi-file refactoring by detecting the scale of the operation. It updates all references to renamed functions across your codebase while verifying that changes maintain code integrity. The skill's verification step catches issues before they propagate.
How does code-refactor update deprecated API calls everywhere?
Code Refactor identifies all instances of deprecated API calls in your codebase and replaces them systematically. Whether updating method calls, changing function names, or replacing old endpoints, it applies changes consistently across all files while the verify step ensures the refactoring is complete and correct.
Does code-refactor automate large-scale code refactoring with verification?
Code Refactor automates large-scale transformations through a safe find-analyze-execute-verify workflow. For jobs spanning 10+ files, it enters execution mode to deliver significant token savings. The verification phase confirms all changes are applied correctly before completion, making it reliable for mass code transformations.
What refactoring operations can code-refactor perform systematically?
Code Refactor handles identifier renaming, deprecated pattern replacement, API call updates, method reference changes, and syntax conversions (like var to let). Its systematic approach works across single and multi-file scopes, with intelligent mode switching that optimizes performance for larger codebases while maintaining accuracy.
SKILL.md
rendered from the published skill — quoted content, verbatim
Code Refactor
Systematic code refactoring across files. Auto-switches to execution mode for 10+ files (90% token savings).
Mode Selection
- 1-9 files: Use native tools (Grep + Edit with replace_all)
- 10+ files: Automatically use
code-executionskill
Execution example (50 files):
from api.code_transform import rename_identifier
result = rename_identifier('.', 'oldName', 'newName', '**/*.py')
# Returns: {'files_modified': 50, 'total_replacements': 247}
# ~500 tokens vs ~25,000 tokens traditional
When to Use
- "rename [identifier] to [new_name]"
- "replace all [pattern] with [replacement]"
- "refactor to use [new_pattern]"
- "update all calls to [function/API]"
- "convert [old_pattern] to [new_pattern]"
Core Workflow (Native Mode)
1. Find All Occurrences
``` Grep(pattern="getUserData",
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
code-operations-plugin/skills/code-refactor/SKILL.md