Skip to content
Back to skills

Remove Duplication

ASecurity

Finds duplicated logic in one area and merges it only where the copies truly belong together, with tests proving behavior held.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 15, 2026
ai-agentssql

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill remove-duplication --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Remove Duplication?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Remove Duplication
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-remove-duplication/badge)](https://www.skillsdirectory.com/skills/workspace-templates-remove-duplication)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: remove-duplication
description: Finds duplicated logic in one area and merges it only where the copies truly belong together, with tests proving behavior held.
argument-hint: "[folder or module]"
user-invocable: true
disable-model-invocation: true
---

Find and remove duplication in: $ARGUMENTS

1. Search the area for repeated logic: similar function bodies, repeated conditionals, parallel switch statements, copied SQL or regexes. Use `jscpd` or a similar detector if installed, then verify by reading.
2. For each cluster, diff the copies and list what differs. Ask of each pair: if one needs to change tomorrow, must the other change too? If yes, they truly belong together. If not, it is coincidental.
3. Make sure tests cover each copy before merging. Add missing characterization tests first and run them green.
4. Merge only real duplicates: extract one function, pass the differences as parameters, name it for what it does. Keep it in the nearest shared module, not a new utils dump.
5. Never merge across package boundaries or change public signatures without asking.

Report clusters as merged, left alone (with the reason), or needs decision. Run all tests and show the net lines removed.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.