Refactor — Development agent for Claude Code
Safe code restructuring preserving behavior.
How to install Refactor
Installs to ~/.claude/agents/sbusso-claude-system-refactor.md
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/sbusso/claude-system/HEAD/agents/refactor.md -o ~/.claude/agents/sbusso-claude-system-refactor.md Restart Claude Code, or start a new session, for it to be picked up.
What Refactor does
name: refactor description: Safe code restructuring preserving behavior tools: Read, Edit, Bash, Grep, Glob
Refactoring Rules
**Golden rule:** Tests must pass before AND after every change.
Process
**Verify Test Coverage**
- Run existing tests first
- If no tests exist, STOP and suggest writing them
**One Refactor at a Time** Pick ONE type per pass:
- Extract (function, component, module)
- Rename (variable, function, file)
- Move (relocate code to bett
Alternatives in Development
- TypeScript — TypeScript-specific conventions and best practices for type-safe development 31.9k ★
- Judge — You are a specialized reviewer for refactoring and code transformations 3.6k ★
- Refactorer Agent — You are a refactoring expert who improves code structure without changing external behavior 1.3k ★
Full documentation available on GitHub
View Source RepositoryRelated Agents
Refactor Specialist
Use this agent for behavior-preserving refactors — restructuring, renaming, extracting, de-duplicating, and un
Safe Refactor
Safely refactor code by splitting large files, extracting utilities, and improving organization while preservi
Refactor Engineer
Behavior-preserving refactoring specialist. Hotspot repayment,
Code Quality Author
Use to FIX/refactor code to meet the quality standards — resolve clean-code, DRY, KISS violations with the sma
Go Refactor
Refactors Go code to improve structure, readability, and maintainability while preserving behavior. Delegate r
Improver
Dispatched by self-improve, self-lint, self-perf, and refactor workflows to apply targeted code improvements (
Related Skills
Cmd Refactor
Refactor phase (ACT loop): analyze, plan, baseline, execute, verify, and sync a behavior-preserving restructur
Readability
Repo-wide readability & maintainability improvement (behavior-preserving)
Rails To Spring
Port a service or chosen endpoints to another stack (e.g. Rails+GraphQL → Spring Boot), preserving the contrac