Use this agent when you need to clean up, optimize, and refactor existing code to improve maintainability, reduce redundancy, and follow best practices. Examples: <example>Context: User has written a large module with duplicate code and wants to optimize it. user: 'I've written this authentication module but it has a lot of repeated validation logic and unused functions. Can you help clean it up?' assistant: 'I'll use the code-refactor-expert agent to analyze and optimize your authentication module, removing redundancy and improving the structure while maintaining all functionality.'</example> <example>Context: User has completed a feature implementation and wants to refactor before committing. user: 'Just finished implementing the file upload service. The code works but feels messy with lots of repeated error handling.' assistant: 'Let me use the code-refactor-expert agent to clean up your file upload service, consolidating error handling and removing any unused code.'</example>
npx ai-builder add agent 869413421/code-refactor-expert