From dev-essentials
Refactor the specified code to improve quality and maintainability. Focus on:
How this command is triggered — by the user, by Claude, or both
Slash command
/dev-essentials:refactorThe summary Claude sees in its command listing — used to decide when to auto-load this command
Refactor the specified code to improve quality and maintainability. Focus on: 1. **Code Structure** - Extract complex methods/functions - Reduce function/method length - Separate concerns appropriately - Apply SOLID principles 2. **Code Quality** - Remove code duplication (DRY) - Improve naming for clarity - Simplify complex conditionals - Replace magic numbers with constants 3. **Design Patterns** - Identify applicable design patterns - Suggest pattern implementations - Improve abstraction levels 4. **Maintainability** - Reduce cyclomatic complexity ...
Refactor the specified code to improve quality and maintainability. Focus on:
Code Structure
Code Quality
Design Patterns
Maintainability
Backward Compatibility
Provide before/after code examples with clear explanations of the improvements and their benefits.
npx claudepluginhub androidyue/claude_code_plugin_example --plugin dev-essentials/refactor-codeRefactors code systematically: analyzes functionality, verifies/adds tests, applies incremental changes, improves quality, performance, design, error handling, docs, and tests.
/refractorRefactors provided code following best practices and design patterns. Maintains functionality; improves readability, extracts reusable components, optimizes performance, applies modern conventions, adds type safety. Explains each change.
/sc-refactorPlans refactoring opportunities in code or executes specific behavior-preserving refactors like extract/rename/simplify, verifying with tests before/after.
/refactorOrchestrates refactoring for specified scope: assesses architecture and issues, plans incremental transformations with risk mitigation, provides code change guides with examples, validation tests, and monitoring plan.
/refactorSystematically refactors target code area: identifies smells like long functions and duplicates, verifies/adds tests, plans atomic steps, executes with verification, preserves behavior.