actionbook avatar

Rust Refactor Helper

Safe Rust refactoring that scans LSP references and previews impact before rename, extract, inline, or move.

skills.sh installs
3.7K
GitHub stars
1.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers four actions: rename a symbol, extract a function, inline a function, and move a symbol to another module
  • Runs LSP findReferences, hover, and incomingCalls before edits, and groups every affected site by file
  • Enforces a --dry-run preview showing conflicts, macro-generated uses, and re-exports before any Edit is applied
  • Pairs with rust-code-navigator, rust-call-graph, rust-symbol-analyzer, and rust-trait-explorer for navigation and structure

Install

$ npx -y skills add actionbook/rust-skills --skill rust-refactor-helper -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Rust Refactor Helper

Perform safe refactoring with comprehensive impact analysis.

Usage

/rust-refactor-helper <action> <target> [--dry-run]

Actions:

  • rename <old> <new> - Rename symbol
  • extract-fn <selection> - Extract to function
  • inline <fn> - Inline function
  • move <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

Details

Repository
github.com/actionbook/rust-skills
Categories
Rust, Code Review & Quality
First seen
May 16, 2026

More from actionbook/rust-skills

All 38

Similar to Rust Refactor Helper

More Rust