Rust Refactor
Helps with Rust, refactoring as part of developing backend services and APIs workflows.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add rust-refactor npx -- -y @trustedskills/rust-refactor
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"rust-refactor": {
"command": "npx",
"args": [
"-y",
"@trustedskills/rust-refactor"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
The rust-refactor skill enables AI agents to analyze Rust codebases and generate optimized refactoring strategies. It focuses on improving code quality, performance, and maintainability by identifying specific patterns that require structural changes.
When to use it
- Legacy Code Modernization: Updating older Rust projects to follow the latest edition syntax and best practices.
- Performance Optimization: Refactoring inefficient algorithms or memory-heavy operations in high-performance backend services.
- Safety Audits: Identifying potential undefined behavior or unsafe block usage that could lead to runtime panics.
- Architecture Cleanup: Restructuring monolithic modules into smaller, testable crates or libraries.
Key capabilities
- Analyzes existing Rust source files for anti-patterns and technical debt.
- Generates concrete refactoring plans tailored to the specific codebase context.
- Suggests improvements for error handling, ownership management, and trait implementations.
- Provides actionable code snippets demonstrating how to apply the suggested changes.
Example prompts
- "Analyze my
src/main.rsfile and suggest a refactoring plan to reduce cyclomatic complexity." - "Identify unsafe blocks in this Rust backend service and propose safer alternatives using standard library features."
- "Refactor this module to use async/await patterns instead of futures for better readability."
Tips & gotchas
Ensure your codebase compiles before running the skill, as some refactoring suggestions may depend on specific compiler versions or feature flags. Always review generated changes manually, especially when modifying unsafe code or complex ownership logic.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.