pproenca avatar

Rust Refactor

This teaches you to look at working Rust code and see unnecessary complexity. It's built around four diagnostic questions you run before touching anything: Is this parameter just being forwarded? Is this feature flag still needed? Is this file doing too many things? Does this struct have mutually exclusive optional fields? Then it gives you six transformation patterns with actual coordination sequences: how to remove forwarded parameters from the bottom up, how to split a 950-line file by domain instead of layer, how to migrate types incrementally with From bridges instead of big-bang rewrites. The crate extraction section includes before-and-after compile time measurements, which is rare and useful. It's opinionated about when to add abstraction versus when to delete it.

skills.sh installs
322
GitHub stars
222
last updated
Aug 21, 2026

Install

$ npx -y skills add pproenca/dot-skills --skill rust-refactor --agent claude-code

Installs into .claude/skills of the current project.

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?"

Sponsors

Details

Repository
github.com/pproenca/dot-skills
Categories
Code Review & Quality, Productivity & Planning, Rust
First seen
Jun 3, 2026

More from pproenca/dot-skills

All 100
1patricio0312rev avatarfrontend-refactor-plannerpatricio0312rev/skillsCreates safe refactor plans for messy UI code including component splitting strategies, state simplification, performance optimizations, and accessibility impro317skills.sh installs
2davila7 avatarquality-manager-qms-iso13485davila7/claude-code-templatesISO 13485 Quality Management System specialist for medical device companies. Provides QMS implementation, maintenance, process optimization, and compliance expe306skills.sh installs
3mhattingpete avatarcode-refactormhattingpete/claude-skills-marketplacePerform bulk code refactoring operations like renaming variables/functions across files, replacing patterns, and updating API calls. Use when users request rena301skills.sh installs
4cognitedata avatarflows-app-reviewcognitedata/builder-skillsRun a full Flows app platform review against a React/TypeScript CDF codebase, following the cognitedata/dune-app-reviews scoring criteria. Produces three artifa298skills.sh installs
5charleswiltgen avataraxiom-swiftui-architecturecharleswiltgen/axiomUse when separating logic from SwiftUI views, choosing architecture patterns, refactoring view files, or asking 'where should this code go', 'how do I organize 273skills.sh installs
6rmyndharis avatarbackend-architectrmyndharis/antigravity-skillsExpert backend architect specializing in scalable API design, microservices architecture, and distributed systems. Masters REST/GraphQL/gRPC APIs, event-driven 270skills.sh installs