# refactoring_specialist

refactoring_specialist — a subagent for Claude Code plans code refactoring while preserving observable behavior. It pairs structural changes with regression protection.

- subagent · `type=agent` · Claude Code, Codex, Cursor · ★ 776 repo stars
- Author: AgenticOrgLab
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/AgenticOrgLab/ExecOrchestra/tree/HEAD/execorchestra/Pool/resources/agents/refactoring_specialist.md
- Updated: 2026-11-12
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/agents/agenticorglab-refactoring-specialist

## What it does

The subagent examines code structure, change boundaries, and risks, then produces an ordered refactoring plan with representative file-level edits. It covers dependencies, APIs, state, and error handling. The package also includes characterization tests, regression checks, and a rollback plan.

Its recommendations draw on repository evidence such as source excerpts, tests, or static-analysis results when provided. It leaves unrelated feature work out and preserves public behavior unless a breaking change is authorized. It does not report tests as passing or files as changed without execution evidence.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/agents/refactoring_specialist.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/refactoring_specialist.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/refactoring_specialist.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/AgenticOrgLab/ExecOrchestra/tree/HEAD/execorchestra/Pool/resources/agents/refactoring_specialist.md

## When to use it
- split a large module into smaller parts
- identify code smells backed by repository evidence
- preserve public behavior during refactoring
- plan regression checks for structural edits

## Example prompts
- Review this module and plan a refactor that preserves its current behavior.
- Prepare a refactoring package for `src/` with sample edits and regression checks.
- Assess the risks of this refactor and outline a rollback plan.

## Similar
- [refactoring](https://affpapa.org/en/nevibecode/skills/refactoring.md) — skill · 670 installs
- [refactoring-specialist](https://affpapa.org/en/nevibecode/agents/refactoring-specialist.md) — subagent · 784 installs
- [java-refactoring-extract-method](https://affpapa.org/en/nevibecode/skills/java-refactoring-extract-method.md) — skill · 9284 installs
- [code-refactoring-legacy-modernizer](https://affpapa.org/en/nevibecode/agents/code-refactoring-legacy-modernizer.md) — subagent · ★ 42780 repo stars
- [code-refactoring-tech-debt](https://affpapa.org/en/nevibecode/skills/code-refactoring-tech-debt.md) — skill · 2 installs
- [golang-refactoring](https://affpapa.org/en/nevibecode/skills/golang-refactoring.md) — skill · 13600 installs

From the same set: [agenticorglab/execorchestra](https://affpapa.org/en/nevibecode/by/agenticorglab/execorchestra.md) — 24 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
