Skip to content
Back to skills

Dedupe

ASecurity

Collapse duplicated logic into a single shared implementation

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
ai-agentsgoexpressrefactoring

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill dedupe --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dedupe?

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

Security grade badge for Dedupe
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-dedupe/badge)](https://www.skillsdirectory.com/skills/black141312-dedupe)

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: dedupe
description: Collapse duplicated logic into a single shared implementation
category: refactoring
---

# Dedupe

Use when the same logic appears in two or more places and they must stay in sync. Unify only genuine duplication, not code that merely looks similar.

1. Locate all copies and diff them carefully to find the real differences (params, edge cases, ordering).
2. Confirm the duplicates represent the same concept — if they drift for different reasons, leave them apart.
3. Extract the shared core into one function/module; express the differences as parameters or hooks.
4. Replace each copy with a call to the shared implementation.
5. Run tests across every former call site, including the edge cases each copy handled.
6. Commit, and note any intentional remaining near-duplicates and why.

## Rules
- Don't force unification when the only commonality is shape — premature abstraction is worse than duplication (WET beats a wrong DRY).
- If copies differ subtly, decide deliberately which behavior is correct; merging can silently pick one and change the other.
- Keep the shared abstraction at the right layer so callers don't gain an awkward dependency.
- Avoid a parameter explosion; if the unified function needs many flags to cover variants, the abstraction is wrong.
- Verify each original edge case still works after merging — that's where dedupe bugs hide.

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.

Comments

Loading comments…