rust-refactor-helper

Refactor Rust code safely using LSP analysis for symbol operations.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/jmduea/emotiv-cortex-rs --skill rust-refactor-helper-jmduea
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-refactor-helper
Source: https://github.com/jmduea/emotiv-cortex-rs/tree/main/.github/skills/rust-refactor-helper
Command: npx skills add https://github.com/jmduea/emotiv-cortex-rs --skill rust-refactor-helper-jmduea

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manual Rust refactoring is risky because it can miss references, break macros, and require tedious impact analysis. This skill automates safe refactoring by leveraging LSP to find all usages and suggest changes.

Core Features & Use Cases

  • Rename Symbol – safely rename identifiers across the codebase with conflict detection.
  • Extract Function – pull selected code into a new function, handling inputs and outputs.
  • Inline Function – replace function calls with the body while preserving behavior.
  • Move Symbol – relocate structs, enums, or functions to another module with import updates.
  • Use Case – when you need to rename parse_config to load_config across a large project, the skill can preview every impact before applying changes.

Quick Start

Ask rust-refactor-helper to rename the function parse_config to load_config with a dry run.

Frequently Asked Questions about rust-refactor-helper

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

FAQPage Schema
How do I safely rename a function across a large Rust project?

To safely rename a function across a Rust project, use LSP-based refactoring to find all usages and detect conflicts. The skill previews every impact before applying changes, ensuring macros and references remain intact.

What is the best way to extract a function in Rust without breaking references?

Extracting a function in Rust is handled by pulling selected code into a new function while managing inputs and outputs. LSP analysis computes all references to ensure the refactoring preserves behavior without breaking existing code.

Can I move a Rust struct to another module and automatically update imports?

Moving a Rust struct to another module automatically updates imports by leveraging LSP analysis. The skill relocates structs, enums, or functions and verifies all reference impacts before applying the changes.

Do I need a Language Server Protocol setup to preview Rust refactoring changes?

A Language Server Protocol setup is required to preview Rust refactoring changes. The skill depends on LSP capabilities and edit tools to compute references, verify conflicts, and safely apply modifications.

How does LSP analysis improve Rust code refactoring compared to manual edits?

LSP analysis improves Rust code refactoring over manual edits by automating impact analysis to find all usages and suggest changes. This prevents missed references and broken macros during symbol renaming, extraction, or inlining.

What are the limitations of using LSP for inlining functions in Rust?

Inlining functions in Rust using LSP replaces function calls with the body while preserving behavior, but relies entirely on accurate LSP reference computation. Complex macro expansions or unresolved conflicts may require manual intervention.