This is taking longer than expected.

Try againBrowse the library
AI Blocks

All AI specialists

Hire an AI Rust refactoring planner

Give it the Rust code in scope, such as files, a module or a crate, pasted or attached. You get in audit mode, a numbered list of findings, each with place, evidence, end state, risk and how to verify.

What you give

  • The Rust code in scope, such as files, a module or a crate, pasted or attached
  • Whether you want an audit list or the full change
  • What must not change, such as the public API, error types or the minimum Rust version

What you get

  • In audit mode, a numbered list of findings, each with place, evidence, end state, risk and how to verify
  • A note on what stays the same, and any change in behavior that needs your yes
  • The cargo commands to run, marked as run or not run
  • A list of what it could not check, such as feature flags or other targets

An example

You want a rename, a module split or a signature change done everywhere it reaches, not just where you spotted it.

You ask: “Give it the Rust code in scope, such as files, a module or a crate, pasted or attached. Use the material I attach and ask for anything essential that is missing.”

You get back:

  • Scope and goal. The goal in one line, the mode, what must stay the same, and what is missing.
  • Findings. Each opportunity with place, evidence, end state, risk and how to verify it (audit mode).
  • Change set. Before and after code for every affected file, so no caller or test is left behind.

An example, not your task.

Words used here

  • API: a way for one piece of software to talk to another

Hire this specialist

It is free and needs no account. Download the pack, give it to your AI and tell it the job. Your AI asks for anything it is missing, then does the work and checks it.

Download the specialist

Related specialists

Skills and workflows for this job: Test and fix code

Details

Everything it can hand back

Your task sets the actual outputs. The specialist picks the methods that cover them.

  • In audit mode, a numbered list of findings, each with place, evidence, end state, risk and how to verify
  • In change mode, the full set of edits across every affected file, with before and after code
  • A note on what stays the same, and any change in behavior that needs your yes
  • The cargo commands to run, marked as run or not run
  • A list of what it could not check, such as feature flags or other targets

How it does the job well

  • Ask before you change public API, ABI, CLI, config, feature flags, wire formats, saved data or the Rust version. Also ask before adding a production dependency, changing lint settings, or touching existing unsafe, FFI, crypto or login code.
  • Never add unsafe to get past ownership or lifetime rules. Never weaken, skip or rewrite a test just to accept new behavior.
  • Never swap an error for an empty value or a default unless the contract says so.
  • Claim a speed gain only if a before and after measurement is provided. Removing a copy is "removed an allocation", not "faster".
  • Do not claim a command passed unless it ran. A chat cannot run cargo.
  • No arbitrary refactor limit. Semantic coherence, not file count or diff size, defines the boundary.
  • No unrelated churn. Every changed line must belong to the requested transformation.

Mistakes it avoids

  • Claiming code works without running it or its tests.
  • Inventing APIs, package versions or settings instead of checking the installed ones.
  • Changing behaviour outside the request, such as reformatting whole files or renaming public interfaces.

What a good result looks like

An example, not your task: You want a rename, a module split or a signature change done everywhere it reaches, not just where you spotted it.

  • Scope and goal. The goal in one line, the mode, what must stay the same, and what is missing.
  • Findings. Each opportunity with place, evidence, end state, risk and how to verify it (audit mode).
  • Change set. Before and after code for every affected file, so no caller or test is left behind.
  • Behavior and API. What stays identical, and any public change that waits for your yes.
  • Verification. The cargo format, test and Clippy commands to run, with what a pass looks like.
  • Remaining risk. What it could not check, such as other targets or feature flags, and deferred ideas.

How the work is checked

  • The changed files build, and the relevant tests and linters pass. The commands and results are shown.
  • Each change is explained in one line with its reason, and risky areas are named.
  • Any check that could not run is reported as NOT_RUN with what it needs.
  • States which checks passed, failed or could not run, and names missing inputs.

These checks have not been run against a model yet. Your AI uses them to check its own work.

Capabilities

  • Pick audit or change. It sorts your request into audit, change, explanation or plan, and sets the scope and what you allow to change.
  • Map what is reached. It traces definitions, callers, imports, re-exports, tests, macros, feature flags and docs. It does not assume "pub" means a change breaks outsiders.
  • Set a baseline. It lists the tests and checks to run before any edit, so earlier failures are not blamed on the refactor.
  • Group the work. It bundles edits that must land together, and orders the bundles by dependency and risk.
  • Write the full change. It updates every definition and reference, adds a test for each real bug it fixes, and leaves no old and new paths side by side.
  • Review the diff. It checks that each changed file belongs to the goal, then lists remaining risk and anything it could not run.

How the role works

  1. Checks your task, context and available tools.
  2. Picks the methods needed and prepares a work plan.
  3. Carries out supported tasks, with each method's limits and review gates.
  4. Checks the real deliverables and corrects supported faults.
  5. Hands back files, evidence and unresolved gaps.

Your specialist's working setup

Download the base specialist without a task form or account. README.md and SETUP.md explain how to use the folder. SOUL.md defines its scope. INTAKE.md asks missing questions inside your AI. PLAYBOOK.md, SKILLS.md, BEST_PRACTICES.md, CHECKS.md and HANDOFF.md guide the work and its checked deliverables.

Complete associated skills, supporting files and licences are included. Choose only the methods needed for the actual task. Keep context, working files and accepted feedback in your AI project.

Use this specialist through MCP or the API

Call prepare_specialist with role_id engineering-rust-refactoring-specialist only. No task is required to load it. Your AI asks what job you need done, what you want back and which relevant context it can use.

For task-led hiring, call find_specialist, explain the suggested specialists and let the user accept or change the team.

Complete ZIP: Download base specialist. API: GET /api/v1/specialists/engineering-rust-refactoring-specialist/pack. The host AI supplies its own model, tools and execution; a pack does not connect accounts or run a task.

Inputs and helpful context

The specialist starts from the task brief. Only active methods require their inputs.

For the primary method, when used

  • The Rust code in scope, such as files, a module or a crate, pasted or attached
  • The goal in one sentence, such as "borrow paths instead of cloning them" or "split config.rs into modules"
  • Whether you want an audit list or the full change
  • What must not change, such as the public API, error types or the minimum Rust version
  • Your Cargo.toml and the current test or Clippy results (optional)

Helpful context (optional)

  • Your Cargo.toml and workspace layout, so it knows which crates and features exist.
  • The output of cargo test and cargo clippy before the change.
  • A note of which items are public to other crates.

Tools and access

  • Claude Code or another AI that can open your repo and run commands: It can search every reference and run cargo itself, so the checks are real. In a plain chat you paste the code and run them yourself.
  • Cargo, rustfmt and Clippy: These are Rust's own build, format and lint tools. They tell you if the refactor is safe.

Functions and deliverables

  • Rust refactoring planner: Get a Rust refactoring plan or a full change set, with every affected file named and the cargo checks to run before you merge.
    • In audit mode, a numbered list of findings, each with place, evidence, end state, risk and how to verify
    • In change mode, the full set of edits across every affected file, with before and after code
    • A note on what stays the same, and any change in behavior that needs your yes
    • The cargo commands to run, marked as run or not run
    • A list of what it could not check, such as feature flags or other targets
    Source: Michael Sitarzewski and Agency Agents contributors.
  • Code refactor planner: Share code and tests. Get small refactoring steps that keep behavior the same.
    • Code smells with locations
    • A named move for each smell
    • A step-by-step order
    • A quality score out of ten
    Source: Wondel.ai.
  • Shared field change checker: Check a changed field or flag across your database, API and apps. Find where it is missing or read differently before you release.
    • A definition of each state
    • A map of everywhere the field flows
    • A list of gaps with evidence
    • Missing test and rollout checks
    Source: sickn33.
  • Class roster file checker: Check your OneRoster roster files before upload. Get a line-numbered list of broken links, bad encoding and manifest errors, with fixes.
    • A list of errors by file and row
    • Broken links and orphan records
    • Manifest problems
    • Encoding fixes
    • Steps to repair the bundle
    Source: sickn33.
  • AI project context organiser: Share your project and next task. Get a short rules file, a focused file list and a clear handoff for later sessions.
    • A ready rules file for your project
    • A list of which files to load for each task
    • Rules for when to reset or trim the session
    • A checklist for spotting drifting answers
    Source: Addy Osmani.

Tasks you can use it for

  • You want a rename, a module split or a signature change done everywhere it reaches, not just where you spotted it.
  • Clippy or compiler warnings have piled up, and you want them fixed without turning off the lint.
  • A function takes owned values and clones them at every call, and you want to borrow instead.
  • You inherited a Rust crate and want a ranked list of safe clean-ups before you touch it.

Limits to check before starting

  • You need a one-line bug fix with the smallest possible diff. Use the Focused code fix developer.
  • Your code is not Rust. Use the Code Reviewer agent, or the Full stack developer for other languages.
  • You want a security review of unsafe code or crypto. Use the Application security reviewer, and have a Rust expert review it.
  • You have no tests and no way to run cargo. Expect a plan and a list of tests to write first, not changes you can trust.

Best way to use this role

Give it one clear outcome, the actual files and a definition of done. Keep the work in one AI project so it can reuse checked context and earlier files.

  • Download the pack from this page and add it to your AI as a skill. Or paste SKILL.md into a new chat, then paste references/source-agent.md after it.
  • Paste your goal, what must not change, and the code. Say "audit only" if you want findings first. A chat AI can read only what you paste, so add the callers and tests too.
  • Read the findings or plan first. Remove any item you do not want, then ask for the change.
  • Check the list of public items it will touch. Say yes or no to each. It will not change public API without your yes.
  • In your own terminal, run cargo fmt, cargo test and cargo clippy as listed. Paste any failure back into the chat.
  • Use a coding AI that can open your repo, such as Claude Code, for a large crate. It can follow every reference and run cargo itself.

Read it as data

Read the complete role setup as JSON. Connect your AI to the AI Blocks MCP library and read aiblocks://roles/engineering-rust-refactoring-specialist for its role instructions and pinned sources.

This is a prepared AI role. No task has run. Your AI carries out authorized work using its available tools and reports the actual deliverables and checks.