From all-commands
Guides a systematic, test-driven code refactoring process — from pre-analysis and coverage verification through incremental changes, quality improvements, performance optimization, and documentation updates.
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-commands2plugins reuse this command
First indexed Jan 8, 2026
/refactor-codeGuides a systematic, test-driven code refactoring process — from pre-analysis and coverage verification through incremental changes, quality improvements, performance optimization, and documentation updates.
/refactor-codeRefactors code based on a given description, following a systematic process of analysis, test coverage, incremental changes, and quality improvements.
/refractorAnalyzes and refactors code to improve maintainability, performance, and scalability using systematic techniques like extract method, DRY, and naming improvements.
/sc-refactorPlans and executes behavior-preserving code refactorings. Automatically detects whether to analyze code for opportunities or perform a specific refactoring (extract, rename, simplify) with pre/post test verification.
/refactorExecutes a three-phase code refactoring workflow: analyze code smells and complexity, apply design patterns and improve naming, then validate with tests and static analysis while preserving behavior.
/refactorAnalyzes code for structural friction and proposes refactoring plans to improve maintainability and design.