Duplication Removal Via Extraction

Remove duplicated code across methods and classes by extracting small shared utilities first and letting larger structure (superclass, Template Method) emerge. Use whenever a developer says 'I'm changing the same code in multiple places', 'I'm fixing the same bug in 3 files', 'copy-pasted code everywhere', 'duplicate logic', 'DRY violation', 'same code in multiple classes', 'repeated patterns', 'shotgun surgery'. Activates for 'extract method', 'extract class', 'pull up method', 'Template Method pattern', 'superclass for duplication', 'deduplicate', 'shared utility', 'parallel classes'.

bookforge-ai Updated

File contents

bookforge-ai/bookforge-skills/tree/main/books/working-effectively-with-legacy-code/skills/duplication-removal-via-extraction commit 33bb19608e

Frequently asked questions

npx skillmds@latest add bookforge-ai/duplication-removal-via-extraction