SKILL.md
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
refactortoolwith mode="deadcode" to find unreferenced code. - For renames, use
refactor_toolwith mode="rename" to preview all affected locations. - Use
applyrefactortoolwith the refactor_id to apply renames. - After changes, run
detectchangestoolto verify the refactoring impact.
Safety Checks
- Always preview before applying (rename mode gives you an edit list).
- Check
getimpactradius_toolbefore major refactors. - Use
getaffectedflows_toolto ensure no critical paths are broken. - Run
findlargefunctions_toolto identify decomposition targets.
Token Efficiency Rules
- Start with
getminimalcontext_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.