# refactor > Refactor code while maintaining behavior - Author: Gavin - Repository: gabino75/nerv - Version: 20260207193353 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-08 - Source: https://github.com/gabino75/nerv - Web: https://mule.run/skillshub/@@gabino75/nerv~refactor:20260207193353 --- --- name: refactor description: Refactor code while maintaining behavior allowed-tools: [Read, Write, Edit, Bash, Grep, Glob] --- # Refactoring Workflow ## Acceptance Criteria - [ ] All existing tests still pass - [ ] No change in external behavior - [ ] Code is cleaner/more maintainable - [ ] No new linting errors ## Steps 1. Run existing tests to establish baseline 2. Identify refactoring opportunities 3. Make incremental changes 4. Run tests after each change 5. If tests fail, revert and try different approach 6. Document what was refactored and why