rust-refactor-helper

Refactor Rust codebases safely using LSP analysis for renaming and extraction.

1|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/flexisuite-org/FlexiSuite_Kernel --skill rust-refactor-helper-flexisuite-org
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-refactor-helper
Source: https://github.com/flexisuite-org/FlexiSuite_Kernel/tree/main/.agents/skills/rust-refactor-helper
Command: npx skills add https://github.com/flexisuite-org/FlexiSuite_Kernel --skill rust-refactor-helper-flexisuite-org

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates complex and potentially risky code refactoring tasks in Rust projects, ensuring safety and correctness through Language Server Protocol (LSP) analysis.

Core Features & Use Cases

  • Safe Renaming: Renames symbols (variables, functions, types) across your codebase with impact analysis.
  • Function Extraction: Extracts selected code blocks into new functions, generating the correct signature and call site.
  • Symbol Moving: Moves symbols between modules, updating all necessary imports and references.
  • Use Case: Refactor a large Rust project by renaming a core function across hundreds of files, or extract a complex logic block into a reusable function without fear of breaking existing code.

Quick Start

Use the rust-refactor-helper skill to rename the function 'old_name' to 'new_name' in the current project.

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 codebase without breaking references?

Safe Rust renaming uses LSP analysis to assess impacts and automatically update all symbol references across hundreds of files. This prevents breaking existing code by validating the refactoring operation before applying changes.

How does LSP analysis ensure code safety during Rust refactoring operations?

LSP analysis ensures code safety by performing pre-refactor impact assessments on the Rust codebase. It validates symbol references, module structures, and function signatures before executing transformations like renaming or moving code elements.

Can I extract a complex logic block into a new function in Rust automatically?

Function extraction in Rust automatically generates the correct function signature and call site for selected code blocks. This LSP-driven transformation creates reusable functions without requiring manual signature calculation or call site updates.

Do I need a Language Server Protocol setup to move symbols between Rust modules?

Moving symbols between Rust modules requires LSP integration to automatically update all necessary imports and references. The protocol analysis ensures that moving code elements maintains structural integrity across the entire project.

What is the best way to refactor a large Rust project without breaking existing code?

The best way to refactor large Rust projects is using LSP analysis for pre-refactor impact assessment. This approach automates risky transformations like symbol renaming and function extraction while verifying code safety.

Are there limitations to automated Rust code transformations using LSP?

Automated Rust code transformations using LSP depend entirely on accurate pre-refactor analysis and impact assessment. Complex or ambiguous code structures may limit the safety guarantees of operations like function extraction and symbol moving.