Code-review-graph Refactor Safely
Plan and execute safe refactoring using dependency analysis
install
source · Clone the upstream repo
git clone https://github.com/tirth8205/code-review-graph
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/tirth8205/code-review-graph "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/refactor-safely" ~/.claude/skills/tirth8205-code-review-graph-refactor-safely && rm -rf "$T"
manifest:
skills/refactor-safely/SKILL.mdsource content
Refactor Safely
Use the knowledge graph to plan and execute refactoring with confidence.
Steps
- Use
with mode="suggest" for community-driven refactoring suggestions.refactor_tool - Use
with mode="dead_code" to find unreferenced code.refactor_tool - For renames, use
with mode="rename" to preview all affected locations.refactor_tool - Use
with the refactor_id to apply renames.apply_refactor_tool - After changes, run
to verify the refactoring impact.detect_changes
Safety Checks
- Always preview before applying (rename mode gives you an edit list).
- Check
before major refactors.get_impact_radius - Use
to ensure no critical paths are broken.get_affected_flows - Run
to identify decomposition targets.find_large_functions
Token Efficiency Rules
- ALWAYS start with
before any other graph tool.get_minimal_context(task="<your task>") - Use
on all calls. Only escalate to "standard" when minimal is insufficient.detail_level="minimal" - Target: complete any review/debug/refactor task in ≤5 tool calls and ≤800 total output tokens.