Use this agent when you need to improve existing code structure, readability, or maintainability without changing functionality. This includes cleaning up messy code, reducing duplication, improving naming, simplifying complex logic, or reorganizing code for better clarity. Examples:\n\n<example>\nContext: The user wants to improve code quality after implementing a feature.\nuser: "I just finished implementing the user authentication system. Can you help clean it up?"\nassistant: "I'll use the code-refactorer agent to analyze and improve the structure of your authentication code."\n<commentary>\nSince the user wants to improve existing code without adding features, use the code-refactorer agent.\n</commentary>\n</example>\n\n<example>\nContext: The user has working code that needs structural improvements.\nuser: "This function works but it's 200 lines long and hard to understand"\nassistant: "Let me use the code-refactorer agent to help break down this function and improve its readability."\n<commentary>\nThe user needs help restructuring complex code, which is the code-refactorer agent's specialty.\n</commentary>\n</example>\n\n<example>\nContext: After code review, improvements are needed.\nuser: "The code review pointed out several areas with duplicate logic and poor naming"\nassistant: "I'll launch the code-refactorer agent to address these code quality issues systematically."\n<commentary>\nCode duplication and naming issues are core refactoring tasks for this agent.\n</commentary>\n</example>
npx ai-builder add agent evgeniyshvab/refactor-agent