rust-refactor-helper

rust-refactor-helper is a skill for Claude Code from moeru-ai/auv. It costs 45 tokens per session (1,629 once invoked), scanned C, original, Apache-2.0.

A Rust code refactoring tool that uses language-server analysis to find affected code before changing it. It supports renaming symbols, extracting or inlining functions, and moving symbols between modules.

In plain words
What is it for?
Use it to rename Rust functions or variables, turn a selected code section into a function, inline a function, or move a symbol to another module.
Why use it?
It helps reduce missed references and broken relationships when changing code structure. A dry-run option can let you inspect a proposed change first.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to rename Rust functions or variables, turn a selected code section into a function, inline a function, or move a symbol to another module.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/moeru-ai/auv/rust-refactor-helper
View source ↗ moeru-ai/auv
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add moeru-ai/auv --skill rust-refactor-helper
Clone the repo
git clone --depth 1 https://github.com/moeru-ai/auv

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rust-refactor-helper

README.md
[![agentmods](https://agentmods.dev/badge/skills/moeru-ai/auv/rust-refactor-helper.svg)](https://agentmods.dev/skills/moeru-ai/auv/rust-refactor-helper)
Your own site
<a href="https://agentmods.dev/skills/moeru-ai/auv/rust-refactor-helper"><img src="https://agentmods.dev/badge/skills/moeru-ai/auv/rust-refactor-helper.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,629 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.01629
Opus 5 $0.00023 $0.00814
Sonnet 5 $0.00009 $0.00326
Haiku 4.5 $0.00005 $0.00163

Measured 7d ago against content hash acda4e50e8bf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade C, and why

rust-refactor-helper scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

​```rust let file = File::open(&path)?; let mut contents = String::new(); file.read_to_string(&mut contents)?; let config: Config = toml::from_str(&contents)?; validate_config(&config)?; ​``` ### Analysis **Inputs:** pat
.agents/skills/rust-refactor-helper/SKILL.md · 274 lines

How it starts

The opening of the file, as written. The whole thing — 274 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rust Refactor Helper

Perform safe refactoring with comprehensive impact analysis.

Usage

/rust-refactor-helper <action> <target> [--dry-run]

Actions:

  • rename <old> <new> - Rename symbol
  • extract-fn <selection> - Extract to function
  • inline <fn> - Inline function
  • move <symbol> <dest> - Move to module

Examples:

  • /rust-refactor-helper rename parse_config load_config
  • /rust-refactor-helper extract-fn src/main.rs:20-35
  • /rust-refactor-helper move UserService src/services/

LSP Operations Used

Pre-Refactor Analysis

# Find all references before renaming
LSP(
  operation: "findReferences",
  filePath: "src/lib.rs",
  line: 25,
  character: 8
)

# Get symbol info
LSP(
  operation: "hover",
  filePath: "src/lib.rs",
  line: 25,
  character: 8
)

# Check call hierarchy for move operations
LSP(
  operation: "incomingCalls",
  filePath: "src/lib.rs",
  line: 25,
  character: 8
)

Refactoring Workflows

1. Rename Symbol

User: "Rename parse_config to load_config"
    │
    ▼
[1] Find symbol definition
    LSP(goToDefinition)
    │
    ▼
[2] Find ALL references
    LSP(findReferences)
    │
    ▼
[3] Categorize by file
    │
    ▼
[4] Check for conflicts
    - Is 'load_config' already used?
    - Are there macro-generated uses?
    │
    ▼
[5] Show impact analysis (--dry-run)
    │
    ▼
[6] Apply changes with Edit tool

Output:

## Rename: parse_config → load_config

### Impact Analysis

**Definition:** src/config.rs:25
**References found:** 8

| File | Line | Context | Change |
|------|------|---------|--------|
| src/config.rs | 25 | `pub fn parse_config(` | Definition |
| src/config.rs | 45 | `parse_config(path)?` | Call |
| src/main.rs | 12 | `config::parse_config` | Import |
| src/main.rs | 30 | `let cfg = parse_config(` | Call |
| src/lib.rs | 8 | `pub use config::parse_config` | Re-export |
| tests/config_test.rs | 15 | `parse_config("test.toml")` | Test |
| tests/config_test.rs | 25 | `parse_config("")` | Test |
| docs/api.md | 42 | `parse_config` | Documentation |

### Potential Issues

⚠️ **Documentation reference:** docs/api.md:42 may need manual update
⚠️ **Re-export:** src/lib.rs:8 - public API change

### Proceed?
- [x] --dry-run (preview only)
- [ ] Apply changes

Read the full file on GitHub · 274 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 274 lines · 45 tokens per session scan C acda4e50e8bf

Subscribe to this mod's changes

rust-refactor-helper is a skill published in the GitHub repository moeru-ai/auv (25 stars, last pushed 4d ago), licensed Apache-2.0. It adds 45 tokens to every session and 1,629 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.