refactor-safely
Skill2 starsChanged 3 months agoMITView on GitHub
Plan and execute safe refactoring using dependency analysis
6 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- techygarg/latticetheir own version, first seen Sep 3, 2026
- adiutama/skillstheir own version, first seen Aug 25, 2026
- hamakyo/okf-skillstheir own version, first seen Aug 21, 2026
- leandrodslv/claude-skills-libraryedited, first seen Aug 14, 2026
- tirth8205/code-review-graphedited, first seen Jun 10, 2026
- SerhatKumas/AI--ClaudeCodeStartertheir own version, first seen Jun 7, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- tirth8205/code-review-graph★ 32k17% same
- leandrodslv/claude-skills-library★ 088% same
Wrote their own version · 4
- techygarg/lattice★ 197same name
- hamakyo/okf-skills★ 2same name
- adiutama/skills★ 1same name
- SerhatKumas/AI--ClaudeCodeStarter★ 1same name
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 repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- debug-issueSkill
- explore-codebaseSkill
- review-changesSkill
- building-gtd-domain-packsSkill
- get-things-doneSkill
- gtd-capability-routerSkill
- gtd-deliberationSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 3 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
3
Distinctive
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_tool 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_tool before major refactors.
- Very specific: line 22
Use get_affected_flows_tool to ensure no critical paths are broken.
- Very specific: line 23
Run find_large_functions_tool to identify decomposition targets.
- Very specific: line 26
Start with get_minimal_context_tool(task="<your task>") before other graph tools.
- Very specific: line 27
Use detail_level="minimal" on all calls.
- Distinctive: line 29
Read the implementation and its tests before changing code.
“Common” is measured: kept by at least 6 in 10 of the 6 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
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_changes_toolto verify the refactoring impact.
Safety Checks
- Always preview before applying (rename mode gives you an edit list).
- Check
get_impact_radius_toolbefore major refactors. - Use
get_affected_flows_toolto ensure no critical paths are broken. - Run
find_large_functions_toolto identify decomposition targets.
Token Efficiency Rules
- Start with
get_minimal_context_tool(task="<your task>")before other graph tools. - 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.
- Read the implementation and its tests before changing code. The graph narrows scope; it does not replace the source.
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.

