From all-commands
Refactors code systematically: analyzes functionality, verifies/adds tests, applies incremental changes, improves quality, performance, design, error handling, docs, and tests.
How this command is triggered — by the user, by Claude, or both
Slash command
/all-commands:refactor-code 1. **Pre-Refactoring Analysis**The summary Claude sees in its command listing — used to decide when to auto-load this command
# Intelligently Refactor and Improve Code Quality Intelligently refactor and improve code quality ## Instructions Follow this systematic approach to refactor code: **$ARGUMENTS** 1. **Pre-Refactoring Analysis** - Identify the code that needs refactoring and the reasons why - Understand the current functionality and behavior completely - Review existing tests and documentation - Identify all dependencies and usage points 2. **Test Coverage Verification** - Ensure comprehensive test coverage exists for the code being refactored - If tests are missing, write them BEFORE ...
Intelligently refactor and improve code quality
Follow this systematic approach to refactor code: $ARGUMENTS
Pre-Refactoring Analysis
Test Coverage Verification
Refactoring Strategy
Environment Setup
git checkout -b refactor/$ARGUMENTSIncremental Refactoring
Code Quality Improvements
Performance Optimizations
Design Pattern Application
Error Handling Improvement
Documentation Updates
Testing Enhancements
Static Analysis
Performance Verification
Integration Testing
Code Review Preparation
Documentation of Changes
Deployment Considerations
Remember: Refactoring should preserve external behavior while improving internal structure. Always prioritize safety over speed, and maintain comprehensive test coverage throughout the process.
npx claudepluginhub davepoon/buildwithclaude --plugin all-commands/refactor-codeRefactors code systematically: analyzes functionality, verifies/adds tests, applies incremental changes, improves quality, performance, design, error handling, docs, and tests.
/refactorRefactors code or file via structured workflow (analyze quality/smells, plan changes, add tests, refactor incrementally, verify with tests/report). Outputs analysis/plan/logs. Also supports component and performance modes.
/refactorRefactors code to improve structure, quality, and maintainability without changing behavior. Ensures tests pass, reduces complexity, and applies design patterns.
/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.
/refractorRefactors code in specified file or directory: improves structure, removes duplication, optimizes performance, enhances maintainability, adds tests and documentation.
/refactorSystematically refactors target code area: identifies smells like long functions and duplicates, verifies/adds tests, plans atomic steps, executes with verification, preserves behavior.