
Rust Refactor Helper
The rust-refactor-helper skill enables developers to safely refactor Rust code by leveraging Language Server Protocol (LSP) analysis to identify all affected locations before making changes. It supports multiple refactoring operations—including renaming symbols, extracting functions, inlining functions, and moving symbols across modules—with optional dry-run previews that show impact analysis, potential conflicts, and side effects like documentation updates or public API changes. This skill solves the problem of performing large-scale code transformations in Rust while minimizing the risk of introducing bugs or breaking dependent code.
- skills.sh installs
- 821
- GitHub stars
- 1.3K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add zhanghandong/rust-skills --skill rust-refactor-helper --agent claude-codeInstalls into .claude/skills of the current project.
Files
Rust Refactor Helper
Perform safe refactoring with comprehensive impact analysis.
Usage
/rust-refactor-helper <action> <target> [--dry-run]
Actions:
rename <old> <new>- Rename symbolextract-fn <selection>- Extract to functioninline <fn>- Inline functionmove <symbol> <dest>- Move to module
Examples:
/rust-refactor-helper rename parse_config load_config/rust-refactor-helper extract-fn src/main.rs:20-35/rust-refactor-helper move UserService src/services/
LSP Operations Used
Pre-Refactor Analysis
# Find all references before renaming
LSP(
operation: "findReferences",
filePath: "src/lib.rs",
line: 25,
character: 8
)
# Get symbol info
LSP(
operation: "hover",
filePath: "src/lib.rs",
line: 25,
character: 8
)
# Check call hierarchy for move operations
LSP(
operation: "incomingCalls",
filePath: "src/lib.rs",
line: 25,
character: 8
)
Refactoring Workflows
1. Rename Symbol
Sponsors
Details
- Repository
- github.com/zhanghandong/rust-skills
- Categories
- Code Review & Quality, Rust
More from zhanghandong/rust-skills
All 34- M01 Ownership809
- M04 Zero Cost789
- M05 Type Driven786
- M02 Resource783
- M03 Mutability773
- M12 Lifecycle764
- M14 Mental Model751
- M09 Domain750
- M11 Ecosystem747
- M13 Domain Error738
- Rust Trait Explorer731
- Rust Code Navigator728
- Unsafe Checker726
- Domain Cli709
- Rust Symbol Analyzer702
- Rust Call Graph699
- Rust Router698
- Rust Learner688
- Rust Deps Visualizer684
- Rust Skill Creator670
- Domain Web648
- Meta Cognition Parallel635
- Rust Daily635
- Domain Embedded625