‹ 首页

refactoring-patterns

@wondelai · 收录于 1 周前 · 上游提交 1 周前

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 安装 校验哈希
npx oh-my-skill add wondelai/skills/refactoring-patterns
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- wondelai/skills/refactoring-patterns
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify wondelai/skills/refactoring-patterns
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
1589GitHub stars
~3.3K最小装载
~19.6K含声明引用
~19.6K文本包总量
镜像托管

怎么用

商店整理自技能原文 · 版本 326b380 · 表述以原文为准
它做什么

装上后,Claude 会帮你用命名好的重构手法(如提取方法、移动字段)改善代码结构,但不改变代码行为。它会先检查测试是否通过,然后一步步做小改动,每步都再跑测试确保没破坏功能。

什么时候触发

当你提到“重构这段代码”、“代码坏味”、“提取方法”、“替换条件”等关键词,或者要求清理遗留代码、为新增功能重组代码时触发。

装好后可以这样说
Claude 会分析函数并建议提取方法等重构。
Claude 会识别重复并建议提取方法或上移方法。
Claude 会建议提取类或移动字段。

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。