refactor-safely

Plans and executes code refactoring using dependency graph analysis and impact previews.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/bmiit145/leadBee --skill refactor-safely-bmiit145
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactor-safely
Source: https://github.com/bmiit145/leadBee/tree/main/.gemini/skills/refactor-safely
Command: npx skills add https://github.com/bmiit145/leadBee --skill refactor-safely-bmiit145

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Refactoring large codebases is risky because renaming or restructuring code can silently break callers, flows, and critical paths. This Skill uses a knowledge graph of the codebase to preview every affected location before changes are applied, so refactors are verified rather than guessed. ## Core Features & Use Cases - Refactoring Suggestions & Dead Code Detection: Use community-driven suggestions and unreferenced-code analysis to find safe cleanup targets. - Rename Preview and Apply: Preview every location affected by a rename, then apply it via a refactor id after reviewing the edit list. - Impact Verification: Check impact radius, affected flows, and post-change detection to confirm no critical paths are broken. - Use Case: Before renaming a core service function used across modules, preview all call sites, check the impact radius, apply the rename, and verify the change set with change detection. ## Quick Start Ask the assistant to safely rename a function across the codebase, previewing all affected locations and verifying the impact before applying the change.

Frequently Asked Questions about refactor-safely

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely rename a function across a codebase?▼

Use the rename mode to preview every affected location as an edit list before changing anything. After reviewing the preview, apply the rename with the returned refactor id, then run change detection to verify the impact.

How to find dead code in a large project?▼

Run the refactor tool in dead_code mode to identify unreferenced code through the dependency graph. Combine this with refactoring suggestions to prioritize which unused code is safest to remove.

How do I check what breaks before refactoring code?▼

Check the impact radius tool before major refactors to see how far a change propagates through the dependency graph. Use the affected flows tool to confirm no critical execution paths are broken.

When should I not rely on the dependency graph for refactoring?▼

The graph narrows scope but does not replace reading the source. Always read the implementation and its tests before changing code, since dynamic references may not appear in static analysis.

How do I reduce token usage when analyzing code with graph tools?▼

Start with the minimal context tool for your task and use minimal detail level on all calls. Escalate to standard detail only when minimal output is insufficient, targeting five or fewer tool calls per task.