refactor-safely
Plan and execute safe refactoring using dependency analysis
By tirth8205 · 203 installs
npx skills add tirth8205/code-review-graph --skill refactor-safely
Source repository · Upstream listing
Refactor Safely
Plan a refactor from the dependency graph and apply renames from a preview.
Steps
1. Call refactor tool with mode="suggest" for refactoring candidates, or mode="dead code" for unreferenced code.
2. For a rename, call refactor tool with mode="rename" , old name and new name . Check the returned edit list before applying.
3. Call apply refactor tool with the returned refactor id to apply the rename.
4. Before a large refactor, call get impact radius tool and get affected flows tool to see the dependents and critical paths involved.
5. Call find large functions tool to find functions worth splitting.
6. After the change, call detect changes tool to confirm the impact matches the plan.
Token Efficiency Rules
Call get minimal context tool(task="<your task ") before any other graph tool.
Pass detail level="minimal" wherever a tool accepts it. Use "standard" only when minimal is not enough.
Prefer a targeted query graph tool call over a broad listing call.
Budget: about five tool calls and 800 tokens of graph output per task.
Read the implementation and its tests before changing code. The graph narrows scope; it does not replace the source.