working-with-legacy-code
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 oh-my-skill add wondelai/skills/working-with-legacy-codecurl -fsSL https://oh-my-skill.com/install.sh | bash -s -- wondelai/skills/working-with-legacy-codenpx oh-my-skill verify wondelai/skills/working-with-legacy-code怎么用
商店整理自技能原文 · 版本 326b380 · 表述以原文为准当你要修改没有测试的旧代码时,Claude 会引导你安全地添加测试、拆分依赖,并一步步修改代码,避免破坏现有功能。
当你提到“遗留代码”“没有测试”“如何测试这个”等关键词,或者需要安全修改无测试代码、为难以测试的类编写测试、向混乱模块添加功能时触发。