‹ 首页

working-with-legacy-code

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

Safely change and test untested codebases using Feathers' "Working Effectively with Legacy Code". Use when the user mentions "legacy code", "no tests", "untested codebase", "how do I test this", "seams", "characterization tests", "golden master", "sprout method", "afraid to change this code", "monster method", "dependency breaking", or "inherited a messy codebase". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout/wrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.

适合你,如果接手了没有测试的旧代码,需要安全地修改和添加功能。

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

怎么用

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

当你要修改没有测试的旧代码时,Claude 会引导你安全地添加测试、拆分依赖,并一步步修改代码,避免破坏现有功能。

什么时候触发

当你提到“遗留代码”“没有测试”“如何测试这个”等关键词,或者需要安全修改无测试代码、为难以测试的类编写测试、向混乱模块添加功能时触发。

装好后可以这样说
Claude 会启动遗留代码修改流程。
Claude 会推荐依赖打断技术。
Claude 会建议先写表征测试或使用 Sprout 方法。

评论

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