From godmode
Safely refactors codebases using patterns like extract, inline, move, rename; runs impact analysis, verifies test coverage, applies atomic git commits with post-change verification and metrics report.
How this command is triggered — by the user, by Claude, or both
Slash command
/godmode:refactorgodmode/The summary Claude sees in its command listing — used to decide when to auto-load this command
# /godmode:refactor Safely transform codebases using proven refactoring patterns. Performs impact analysis, ensures test coverage, executes transformations in atomic steps, and verifies correctness after every change. ## Usage ## What It Does 1. Assesses refactoring scope: complexity, test coverage, dependents, risk level 2. Selects from pattern library: Extract, Inline, Move, Rename, Simplify, Compose, Architecture 3. Runs impact analysis: maps all affected files and dependencies 4. Verifies safety net: tests must pass BEFORE refactoring begins 5. Executes one transformation per comm...
Safely transform codebases using proven refactoring patterns. Performs impact analysis, ensures test coverage, executes transformations in atomic steps, and verifies correctness after every change.
/godmode:refactor <description> # Interactive refactoring with full analysis
/godmode:refactor --extract <type> # Extract function/class/module/interface
/godmode:refactor --inline <target> # Inline function/variable/class
/godmode:refactor --move <target> <dest> # Move code to a new location
/godmode:refactor --rename <old> <new> # Rename symbol across codebase
/godmode:refactor --analyze-only # Impact analysis without changes
/godmode:refactor --dry-run # Show planned changes without applying
/godmode:refactor --strangler # Use strangler pattern for migration
/godmode:refactor --no-verify # Skip pre-refactoring test check (dangerous)
"refactor: <pattern> — <description>"After refactoring: /godmode:review to verify code quality, or /godmode:test to add missing test coverage.
/godmode:refactor Extract business logic from UserController into UserService
/godmode:refactor --rename getUser findUserById # Rename across codebase
/godmode:refactor --move src/utils/auth.ts src/services/auth.service.ts
/godmode:refactor --analyze-only # Just show impact, no changes
/godmode:refactor --strangler # Incremental migration approach
npx claudepluginhub arbazkhan971/godmode/refactor-guidedPerforms safe incremental refactoring on target files directories or descriptions verifying tests at each step with git commits and reverts.
/sc-refactorPlans refactoring opportunities in code or executes specific behavior-preserving refactors like extract/rename/simplify, verifying with tests before/after.
/refactorSystematically refactors target code area: identifies smells like long functions and duplicates, verifies/adds tests, plans atomic steps, executes with verification, preserves behavior.
/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.
/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.
/refactorSafely refactors code gradually, quantitatively scores SOLID principles adherence (0-100 per principle), detects smells and debt, and prioritizes improvements with techniques like Extract Method.