code-refactor

Refactor code across multiple files to rename identifiers and replace patterns.

657|94|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/mhattingpete/claude-skills-marketplace --skill code-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refactor
Source: https://github.com/mhattingpete/claude-skills-marketplace/tree/main/code-operations-plugin/skills/code-refactor
Command: npx skills add https://github.com/mhattingpete/claude-skills-marketplace --skill code-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manual code refactoring is tedious, error-prone, and time-consuming. This Skill automates bulk code changes, ensuring consistency and freeing developers from repetitive tasks across multiple files.

Core Features & Use Cases

  • Bulk Renaming: Rename variables, functions, or classes across multiple files with ease.
  • Pattern Replacement: Update deprecated code patterns or API calls project-wide.
  • Code Standardization: Enforce consistent coding styles and import paths across your codebase.
  • Use Case: Imagine you need to rename getUserData to fetchUserData across your entire project. This Skill can find all instances and apply the change, then verify the refactor.

Quick Start

Find all occurrences of a pattern

Grep(pattern="getUserData", output_mode="files_with_matches")

Replace all instances in a file

Edit( file_path="src/api.js", old_string="getUserData", new_string="fetchUserData", replace_all=true )

Frequently Asked Questions about code-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rename a function or variable across multiple files in my codebase?

Bulk renaming across multiple files uses pattern matching to find all instances of an identifier, then applies replacements systematically. This Skill automates the process by searching for the old name and replacing it everywhere, then verifying the changes took effect correctly.

Can I automate code refactoring for deprecated API calls across my project?

Yes. Pattern replacement automates updating deprecated API calls project-wide by finding old patterns and swapping them for new ones. The Skill handles this across 1 to 10+ files, making it practical for large-scale API migrations and modernization.

What's the best way to standardize code style across multiple files?

Code standardization uses bulk find-and-replace to enforce consistent naming conventions, import paths, and coding patterns across your entire codebase. The Skill applies changes systematically and verifies them to ensure uniform style.

How does this Skill handle refactoring in large projects with many files?

The Skill uses mode-aware execution: for 1–9 files it applies native grep and edit operations; for 10+ files it triggers code-execution workflows. Verification steps confirm all changes completed successfully across the entire scope.

Do I need to manually check each file after bulk refactoring?

No. The Skill includes built-in verification steps that automatically confirm changes were applied correctly after refactoring, reducing manual review burden and catching missed or malformed replacements.

Can I use this for renaming classes and identifiers in different file types?

Yes. The Skill applies refactoring across multiple files and supports any text-based identifier or pattern, making it effective for renaming variables, functions, and classes regardless of file type or language.