MindaxisSearch for a command to run...
Guide a systematic refactoring session using the {{pattern}} pattern. The goal is to improve code structure without changing external behavior. Before starting any refactoring: - Ensure test coverage exists for the code being changed. If not, write characterization tests first. - Identify the specific code smell or structural problem being addressed. - Define the desired end state clearly before making changes. Refactoring process: 1. Take a snapshot — ensure all tests pass and the current state is committed. 2. Apply the transformation in small, verifiable steps. Each step should leave tests green. 3. After each step, run the test suite. If tests break, revert and try a smaller step. 4. Once the structural change is complete, review for further simplification opportunities. 5. Update documentation and comments to reflect the new structure. Pattern-specific guidance for {{pattern}}: - extract-method: look for code blocks with comments explaining what they do — the comment is the method name. - inline: remove unnecessary indirection when a function is called only once or adds no abstraction value. - rename: use names that reveal intent, not implementation. Update all references consistently. - move: relocate code to the module or class that owns the data it operates on. Never refactor and add features in the same commit. Keep refactoring commits separate and atomic.
| ID | Метка | По умолчанию | Опции |
|---|---|---|---|
| pattern | Refactoring pattern | extract-method | extract-methodinlinerenamemove |
npx mindaxis apply refactoring-guide --target cursor --scope project