Refactor Safely
Skill10 starsChanged 6 months agoMITView on GitHub
Plan and execute safe refactoring using dependency analysis
4 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- theexperiencecompany/gaiaedited, first seen Nov 3, 2026
- nilsteampassnet/TeamPassword for word, first seen Oct 8, 2026
- microsoft/Microsoft365DSCedited, first seen Oct 8, 2026
- dorian-akhs/skillsword for word, first seen Sep 1, 2026
Other versions4 projects use a version of this.
Word for word · 2
- nilsteampassnet/TeamPass★ 1.9k100% same
- dorian-akhs/skills★ 0100% same
Edited · 2
- microsoft/Microsoft365DSC★ 2.5k100% same
- theexperiencecompany/gaia★ 325100% same
Wrote their own version · 0
None found.
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 repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- Debug IssueSkill
- Explore CodebaseSkill
- Review ChangesSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use the knowledge graph to plan and execute refactoring with confidence.
- Very specific: line 12
Use refactor_tool with mode="suggest" for community-driven refactoring suggestions.
- Very specific: line 13
Use refactor_tool with mode="dead_code" to find unreferenced code.
- Very specific: line 15
Use apply_refactor_tool with the refactor_id to apply renames.
- Very specific: line 16
After changes, run detect_changes to verify the refactoring impact.
- Distinctive: line 20
Always preview before applying (rename mode gives you an edit list).
- Very specific: line 21
Check get_impact_radius before major refactors.
- Very specific: line 22
Use get_affected_flows to ensure no critical paths are broken.
- Very specific: line 23
Run find_large_functions to identify decomposition targets.
- Very specific: line 26
ALWAYS start with get_minimal_context(task="<your task>") before any other graph tool.
- Very specific: line 27
Use detail_level="minimal" on all calls.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Refactor Safely
Use the knowledge graph to plan and execute refactoring with confidence.
Steps
- Use
refactor_toolwith mode="suggest" for community-driven refactoring suggestions. - Use
refactor_toolwith mode="dead_code" to find unreferenced code. - For renames, use
refactor_toolwith mode="rename" to preview all affected locations. - Use
apply_refactor_toolwith the refactor_id to apply renames. - After changes, run
detect_changesto verify the refactoring impact.
Safety Checks
- Always preview before applying (rename mode gives you an edit list).
- Check
get_impact_radiusbefore major refactors. - Use
get_affected_flowsto ensure no critical paths are broken. - Run
find_large_functionsto identify decomposition targets.
Token Efficiency Rules
- ALWAYS start with
get_minimal_context(task="<your task>")before any other graph tool. - Use
detail_level="minimal"on all calls. Only escalate to "standard" when minimal is insufficient. - Target: complete any review/debug/refactor task in ≤5 tool calls and ≤800 total output tokens.
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.

