code-refactor
Skill4 starsChanged 10 months agoMITView on GitHub
Perform bulk code refactoring operations like renaming variables/functions across files, replacing patterns, and updating API calls. Use when users request renaming identifiers, replacing deprecated code patterns, updating method calls, or making consistent changes across multiple locations.
16 other projects use a version of this.
Adopted by
Most recently taken up by
- u9401066/zotero-keepertheir own version, first seen Nov 8, 2026
- OpenxIntelligence/Coding-Agent-Skillsword for word, first seen Nov 1, 2026
- hellyguo/self-ai-spectheir own version, first seen Oct 26, 2026
- I-Onlabs/claude-code-skillsword for word, first seen Oct 25, 2026
- u9401066/pubmed-search-mcptheir own version, first seen Oct 20, 2026
- nek1987/auto-agent-harnessword for word, first seen Oct 11, 2026
Used with
Projects with it also use git-doc-updater, git-precommit and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
u9401066Skillgit-doc-updater
Auto-check and update key documentation before Git commits to keep docs in sync with code. Triggers: docs, 文檔, 更新文檔, sync docs, release, 發布.
Also in 5 projects that use this
u9401066Skillgit-precommit
Orchestrate pre-commit workflow including Memory Bank sync, README/CHANGELOG/ROADMAP updates. Triggers: GIT, gc, push, commit, 提交, 準備 commit, 要提交了, git commit, pre-commit, 推送.
Also in 5 projects that use this
klauswgSkillreadme-i18n
Use when the user wants to translate a repository README, make a repo multilingual, localize docs, add a language switcher, internationalize the README, or update localized README variants in a GitHub-style repository.
Also in 5 projects that use this
GoogleSkillcode-reviewer
Also in 5 projects that use this
- +8 more from u9401066
Other versions16 projects use a version of this.
Word for word · 4
- nilecui/SkillsBase★ 27100% same
- I-Onlabs/claude-code-skills★ 4100% same
- nek1987/auto-agent-harness★ 4100% same
- OpenxIntelligence/Coding-Agent-Skills★ 4100% same
Edited · 0
None found.
Wrote their own version · 12
- u9401066/pubmed-search-mcp★ 28same name
- ZeroPointRepo/CRHQ-PRDs★ 22same name
- hellyguo/self-ai-spec★ 8same name
- u9401066/zotero-keeper★ 7same name
- arnabdeypolimi/claude_code_setup★ 4same name
- u9401066/nsforge-mcp★ 4same name
- msobczyk-x/agent-skills★ 3same name
- u9401066/template-is-all-you-need★ 3same name
- BryceYuuu/open-workflow-skills★ 1same name
- phdeng/ClaudeCodeChat★ 1same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository71 other files it gives its agents.
- AGENTS.mdAGENTS.md
- algorithmic-artSkill
- architecture-diagram-creatorSkill
- artifacts-builderSkill
- brainstormingSkill
- brand-guidelinesSkill
- canvas-designSkill
- changelog-generatorSkill
- code-auditorSkill
- codebase-documenterSkill
- code-executionSkill
- code-transferSkill
- content-research-writerSkill
- conversation-analyzerSkill
- csv-data-summarizerSkill
- dashboard-creatorSkill
- dev-graph-exportsSkill
- dispatching-parallel-agentsSkill
- doc-coauthoringSkill
- docker-helperSkill
- docxSkill
- ensemble-solvingSkill
- executing-plansSkill
- feature-planningSkill
- file-operationsSkill
- file-organizerSkill
- finishing-a-development-branchSkill
- flowchart-creatorSkill
- frontend-designSkill
- git-pushingSkill
- image-enhancerSkill
- imagenSkill
- internal-commsSkill
- markitdownSkill
- mcp-builderSkill
- pdfSkill
- pixel-detective-exportsSkill
- pptxSkill
- project-bootstrapperSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- review-implementingSkill
- rituals-guideSkill
- systematic-debuggingSkill
- scientific-visualizationSkill
- skill-creatorSkill
- skills-summarizerSkill
- skills-updaterSkill
- slack-gif-creatorSkill
- sprint-perspectivesSkill
- sprint-summary-pdfSkill
- start-dev-graphSkill
- start-pixel-detectiveSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- tailored-resume-generatorSkill
- technical-doc-creatorSkill
- template-skillSkill
- test-driven-developmentSkill
- test-fixingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
1-9 files: Use native tools (Grep + Edit with replace_all)
- Distinctive: line 72
Test: Recommend integration tests
- Distinctive: line 80
Consider edge cases (strings, comments)
- Distinctive: line 88
Test → Suggest running tests
- Distinctive: line 100
Must match EXACTLY (whitespace, quotes)
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 traditionalWhen 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", output_mode="files_with_matches") # Find files
Grep(pattern="getUserData", output_mode="content", -n=true, -B=2, -A=2) # Verify with context2. Replace All Instances
Edit(
file_path="src/api.js",
old_string="getUserData",
new_string="fetchUserData",
replace_all=true
)3. Verify Changes
Grep(pattern="getUserData", output_mode="files_with_matches") # Should return noneWorkflow Examples
Rename Function
- Find:
Grep(pattern="getUserData", output_mode="files_with_matches") - Count: "Found 15 occurrences in 5 files"
- Replace in each file with
replace_all=true - Verify: Re-run Grep
- Suggest: Run tests
Replace Deprecated Pattern
- Find:
Grep(pattern="\\bvar\\s+\\w+", output_mode="content", -n=true) - Analyze: Check if reassigned (let) or constant (const)
- Replace:
Edit(old_string="var count = 0", new_string="let count = 0") - Verify:
npm run lint
Update API Calls
- Find:
Grep(pattern="/api/auth/login", output_mode="content", -n=true) - Replace:
Edit(old_string="'/api/auth/login'", new_string="'/api/v2/authentication/login'", replace_all=true) - Test: Recommend integration tests
Best Practices
Planning:
- Find all instances first
- Review context of each match
- Inform user of scope
- Consider edge cases (strings, comments)
Safe Process:
- Search → Find all
- Analyze → Verify appropriate
- Inform → Tell user scope
- Execute → Make changes
- Verify → Confirm applied
- Test → Suggest running tests
Edge Cases:
- Strings/comments: Ask if should update
- Exported APIs: Warn of breaking changes
- Case sensitivity: Be explicit
Tool Reference
Edit with replace_all:
replace_all=true: Replace all occurrencesreplace_all=false: Replace only first (or fail if multiple)- Must match EXACTLY (whitespace, quotes)
Grep patterns:
-n=true: Show line numbers-B=N, -A=N: Context lines-i=true: Case-insensitivetype="py": Filter by file type
Integration
- test-fixing: Fix broken tests after refactoring
- code-transfer: Move refactored code
- feature-planning: Plan large refactorings
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

