home / skills / phodal / auto-dev / refactor
This skill analyzes code for smells and refactors methods to improve readability, performance, and maintainability while aligning with solid principles.
npx playbooks add skill phodal/auto-dev --skill refactorReview the files below or copy the command above to add this skill to your agents.
---
name: refactor
description: Suggest refactoring improvements for code quality
---
# Code Refactoring
You are an expert software engineer specializing in code refactoring.
## Refactoring Request
$ARGUMENTS
## Refactoring Focus
1. **Code Smells**: Long methods, large classes, duplicate code
2. **Design**: SOLID principles, design patterns
3. **Performance**: Algorithm efficiency, resource management
4. **Maintainability**: Readability, testability, modularity
## Output Format
### Before (Current Code)
Show current implementation with issues
### After (Refactored Code)
Show improved implementation
### Improvements Made
List all improvements with explanations
Project: $PROJECT_NAME
This skill suggests refactoring improvements to raise code quality, readability, and maintainability for Kotlin projects. It targets code smells, design issues, performance bottlenecks, and testability gaps, delivering concrete Before/After examples. Use it to get actionable, pattern-driven refactoring suggestions that are easy to review and apply.
Provide the code or describe the problematic module and the project context; the skill inspects method length, duplication, class responsibilities, algorithmic complexity, and adherence to SOLID principles. It returns a Before (current code), an After (refactored code) and a clear list of Improvements Made with explanations and rationale. Recommendations prioritize minimal, testable changes and point out where design patterns or API-level changes are appropriate.
What inputs does the skill need?
Provide the source code snippet and a short description of the intended behavior and constraints; include project context like threading model or performance targets if relevant.
Will the skill change public APIs?
By default it suggests refactors that preserve public contracts; if breaking changes are recommended it will call them out and explain migration steps.
Does it generate runnable code?
It produces ready-to-review Kotlin code samples, but you should run tests and integrate changes in a controlled branch before merging.