πŸ”§
QualityPython

Refactor Safely

by tirth8205

Refactor Safely is a Quality skill for Claude Code, published by tirth8205 in code-review-graph.

30K stars2.8K forkson tirth8205/code-review-graphAdded 2026/08/14Repository updated 2026/08/02
ai-codingclaudeclaude-codecode-reviewgraphragincrementalknowledge-graphllmmcppythonstatic-analysistree-sitter
Install in seconds
Install Refactor Safely
Copy Refactor Safely into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/tirth8205/code-review-graph/tree/main/skills/refactor-safely ~/.claude/skills/refactor-safely

Requires Node.js. Downloads this skill only β€” not the rest of the repository β€” into your Claude Code skills folder.

Without Node.js

git clone https://github.com/tirth8205/code-review-graph.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
skills/refactor-safely/SKILL.md in tirth8205/code-review-graph
Installs to
~/.claude/skills/refactor-safely
Collection
One of 7 skills cataloged from this repository
Category
Quality β€” 1354 skills

What Refactor Safely does

Refactor Safely plans and executes code refactoring using dependency analysis from a knowledge graph. It helps developers safely rename symbols, remove dead code, and verify refactoring impact before and after applying changes.

Refactor Safely is cataloged under Quality on DirSkills. Refactor Safely comes from a repository tagged ai-coding, claude, claude-code, code-review and graphrag.

Documentation

README

Refactor Safely

Use the knowledge graph to plan and execute refactoring with confidence.

Steps

  1. Use refactor_tool with mode="suggest" for community-driven refactoring suggestions.
  2. Use refactor_tool with mode="dead_code" to find unreferenced code.
  3. For renames, use refactor_tool with mode="rename" to preview all affected locations.
  4. Use apply_refactor_tool with the refactor_id to apply renames.
  5. After changes, run detect_changes_tool to verify the refactoring impact.

Safety Checks

  • Always preview before applying (rename mode gives you an edit list).
  • Check get_impact_radius_tool before major refactors.
  • Use get_affected_flows_tool to ensure no critical paths are broken.
  • Run find_large_functions to identify decomposition targets.

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Refactor Safely

  • What else does tirth8205 publish alongside Refactor Safely?

    Refactor Safely is one of 7 skills that DirSkills catalogs from tirth8205/code-review-graph, the repository it ships in. Its siblings there include Build Graph, Debug Issue and Explore Codebase. Each one is a separate skill with its own page in this directory, installs the same way Refactor Safely does, and is maintained by tirth8205 in that same repository. The rest of the collection is listed on the tirth8205/code-review-graph page.

  • How does Refactor Safely compare to other Quality skills?

    Refactor Safely ranks #98 by stars among the 1354 Quality skills in this catalog. The most-starred ones next to it are Benchmark, Benchmark Optimization Loop and API Design Patterns. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Refactor Safely against them. Open each page to compare what they document and how they install.

More from tirth8205/code-review-graph

Refactor Safely is one of 7 skills cataloged on DirSkills from tirth8205/code-review-graph.

See all 7 skills β†’
πŸ•ΈοΈ
2w ago

Build Graph

Build Graph initializes or incrementally updates a persistent code review knowledge graph for a repository via MCP tools. Use it for first-time setup, after major refactoring, or when the graph is stale; hooks normally keep it updated automatically.
Quality
30K2.8K
🐞
2w ago

Debug Issue

Debug Issue traces bugs through a code knowledge graph so developers can isolate root causes faster. Use it when investigating regressions, analyzing call paths, or checking recent changes.
Quality
30K2.8K
πŸ”Ž
2w ago

Explore Codebase

Explore Codebase uses knowledge graph tools to navigate and understand codebase structure, trace relationships, and find execution paths. Use it for code review, debugging, and refactoring with minimal context.
Quality
30K2.8K
πŸ”
2w ago

Review Changes

Review Changes performs a structured, risk-aware code review using change detection and impact analysis from a knowledge graph. It identifies risk levels, affected execution paths, test coverage gaps, and provides a merge recommendation.
Quality
30K2.8K
πŸ”
2w ago

Review Delta

Review Delta reviews only changes since the last commit using graph impact analysis, automatically detecting blast radius. Use it for token-efficient code review when you need to focus on changed code and its affected dependents.
Quality
30K2.8K
πŸ”
2w ago

Review PR

Review PR performs a comprehensive code review of a pull request or branch diff using a knowledge graph for structural context and blast-radius impact analysis. Use it to assess risk, check test coverage, and produce a structured file-by-file review.
Quality
30K2.8K