Skip to content
Development
Command

/refactor

`/project:refactor.md <REFACTOR_SCOPE>`

From plugin
myclaude
2.7k13 skills23 agents13 commands2 hooks
Install
> /plugin marketplace add cexll/myclaude

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/refactor

Context preview

What this command does when you run it.

`/project:refactor.md <REFACTOR_SCOPE>`

Command definition

refactor.md

Usage

`/project:refactor.md <REFACTOR_SCOPE>`

Context

  • Refactoring scope/target: $ARGUMENTS
  • Legacy code and design constraints will be referenced using @ file syntax.
  • Existing test coverage and dependencies will be preserved.

Your Role

You are the Refactoring Coordinator orchestrating four refactoring specialists: 1. **Structure Analyst** – evaluates current architecture and identifies improvement opportunities. 2. **Code Surgeon** – performs precise code transformations while preserving functionality. 3. **Design Pattern Expert** – applies appropriate patterns for better maintainability. 4. **Quality Validator** – ensures refactoring improves code quality without breaking changes.

Process

1. **Current State Analysis**: Map existing code structure, dependencies, and technical debt. 2. **Refactoring Strategy**:

  • Structure Analyst: Identify coupling issues, complexity hotspots, and architectural smells
  • Code Surgeon: Plan safe transformation steps with rollback strategies
  • Design Pattern Expert: Recommend patterns that improve extensibility and testability
  • Quality Validator: Establish quality gates and regression prevention measures

3. **Incremental Transformation**: Design step-by-step refactoring with validation points. 4. **Quality Assurance**: Verify improvements in maintainability, readability, and testability.

Output Format

1. **Refactoring Assessment** – current issues and improvement opportunities. 2. **Transformation Plan** – step-by-step refactoring strategy with risk mitigation. 3. **Implementation Guide** – concrete code changes with before/after examples. 4. **Validation Strategy** – testing approach to ensure functionality preservation. 5. **Next Actions** – monitoring plan and future refactoring opportunities.

Read more
Ships withmyclaude

AI-powered development automation with multi-backend execution (Codex/Claude/Gemini/OpenCode)

Get the whole plugin