sbusso

Refactor — Development agent for Claude Code

Development community

Safe code restructuring preserving behavior.

How to install Refactor

Installs to ~/.claude/agents/sbusso-claude-system-refactor.md

Terminal
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

  1. **Verify Test Coverage**

    • Run existing tests first
    • If no tests exist, STOP and suggest writing them
  2. **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 Repository