Refactoring Assistant
高级development最低上下文:64K
Guides systematic code refactoring while preserving exact behavior. Identifies code smells, suggests appropriate refactoring patterns, and executes transformations incrementally with verification at each step. Follows Chesterton's Fence principle — understands why code exists before changing it.
使用场景
- Reducing cyclomatic complexity in large functions
- Extracting reusable components or modules
- Migrating from legacy patterns to modern idioms
- Eliminating code duplication (DRY principle)
- Improving testability through dependency injection
示例提示词
Refactor the following code to improve readability and maintainability. Requirements: - Preserve exact existing behavior (no functional changes) - Apply one refactoring pattern at a time - Explain the rationale for each change - Suggest tests to verify behavior is preserved - Flag any code where the purpose is unclear (Chesterton's Fence) Code to refactor: ``` [paste code here] ```
推荐模型
兼容工具
claude-codecursorgithub-copilotkiroany
模态
输入: code, text
→输出: code, text
相关 Skills
作者
OpenModels Community