Rust Refactor
Decision frameworks and six transformation patterns for simplifying, splitting, and migrating working Rust code.
- CCM score
- 58 of 100
- skills.sh installs
- 334
- GitHub stars
- 228
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers two modes, defensive (add abstraction for safety) and offensive (delete indirection), and when to use each
- Includes four diagnostic questions on forwarded parameters, stale feature flags, oversized files, and mutually exclusive
Optionfields - Provides six transformations: ambient access, domain-split modules, incremental
Frombridges, flag removal, crate extraction, and enum conversion - Designed for Rust codebases where refactors must keep every intermediate commit compiling
Install
$ npx -y skills add pproenca/dot-skills --skill rust-refactor -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Rust Refactoring Frameworks
This skill teaches you to look at working Rust code and see unnecessary complexity. Every refactoring starts with a diagnostic question, follows a transformation pattern, and ends with a self-review checklist.
The Two Refactoring Philosophies
Before touching code, decide which mode you are in.
Defensive mode: Add abstraction for safety. Split types. Create From bridges. Audit every consumer. Use when: security-critical code, type evolution, multi-crate dependencies.
Offensive mode: Delete indirection. Remove forwarded parameters. Collapse layers. Use when: the abstraction adds complexity without adding safety, the mediator just forwards, the parameter is always None.
Know which mode you are in. Do not add abstraction when you should be deleting, and do not delete safety layers when you should be adding them.
The 4 Diagnostic Questions
Run these BEFORE touching any code. They determine WHAT to refactor.
1. "Is this parameter just being forwarded?"
Details
- Repository
- github.com/pproenca/dot-skills
- Categories
- Rust, Code Review & Quality
- First seen
- Jun 3, 2026
Questions
What does the rust-refactor skill do?
The rust-refactor skill gives decision frameworks for refactoring, simplifying and decomposing Rust code. It covers removing forwarded parameters, splitting large files by domain, removing dead feature flags, migrating types incrementally, and turning mutually exclusive optional fields into enums.
How do I install the rust-refactor skill?
Run npx -y skills add pproenca/dot-skills --skill rust-refactor -y in your project. This installs the skill from the pproenca/dot-skills repository on GitHub.
Where does rust-refactor rank among Rust skills?
It ranks in the top 100 of the Rust category on Claude Marketplaces. Other well-known skills in the same category include fix-errors, rust-best-practices, rust-async-patterns, rust-testing and rust-patterns.
When should an agent use rust-refactor?
Use it when simplifying Rust code, splitting large files, removing dead abstractions, migrating types incrementally or cleaning up feature flags. It also applies to module splitting, parameter cleanup and incremental type migration.
How does rust-refactor decide what to change?
It starts with four diagnostic questions, such as whether a parameter is only being forwarded or whether a file is doing too many things. Each question has a signal and a matching action, so the agent knows what to refactor before editing code.
More from pproenca/dot-skills
All 100- Python332
- Ios Design System331
- Js Google327
- Tailwind Refactor324
- Pulumi320
- Harness Engineering315
- Ios Hig313
- Rails Testing312
- Ios Xcode310
- Ruby Refactor310
- Think310
- Restful Hateoas307
- Ios Ui Refactor303
- Rails Dev302
- Swift Optimise296
- Ruby Optimise295
- Ios Testing292
- Swift Refactor292
- Dev Rfc289
- Ios Taste286
- Swift Ui Architect286
- Ios Storyboard280
- Rails Design System279
- Ios Navigation278
Similar to Rust Refactor
More Rustrefactorpproenca/dot-skills665 installsStructured refactoring guide of 43 rules across eight prioritized categories, drawn from Fowler's catalog and Clean Code.
rust-implementpproenca/dot-skills257 installsMulti-pass Rust workflow that designs types first, implements, simplifies, then runs an automated lint against the code.
code-simplifierrtk-ai/rtk2.3K installsRust simplification guide for RTK that removes verbosity while preserving the project's required constraints.
refactor-advisorlaolaoshiren/claude-code-skills-zh117 installsSystematic code refactoring advisor that scans for smells, ranks issues by severity, and outlines fixes.