refactoring-patterns
Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions "refactor this", "code smells", "extract method", "replace conditional", "technical debt", "move method", "inline variable", "decompose conditional", or "clean up this messy code". Also trigger when cleaning up legacy code, preparing code for new features by restructuring, or identifying which transformation fits a specific code smell. Covers smell-driven refactoring, safe transformation sequences, and testing guards. For code-quality foundations, see clean-code. For managing complexity, see software-design-philosophy.
适合你,如果经常需要重构代码、消除技术债务
npx oh-my-skill add wondelai/skills/refactoring-patternscurl -fsSL https://oh-my-skill.com/install.sh | bash -s -- wondelai/skills/refactoring-patternsnpx oh-my-skill verify wondelai/skills/refactoring-patterns怎么用
商店整理自技能原文 · 版本 326b380 · 表述以原文为准装上后,Claude 会帮你用命名好的重构手法(如提取方法、移动字段)改善代码结构,但不改变代码行为。它会先检查测试是否通过,然后一步步做小改动,每步都再跑测试确保没破坏功能。
当你提到“重构这段代码”、“代码坏味”、“提取方法”、“替换条件”等关键词,或者要求清理遗留代码、为新增功能重组代码时触发。