de-dupe

Extract shared utilities from duplicated code and update call sites.

Updated Feb 1, 2026
One-click install
npx skills add https://github.com/saadjs/agent-skills --skill de-dupe
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: de-dupe
Source: https://github.com/saadjs/agent-skills/tree/main/skills/de-dupe
Command: npx skills add https://github.com/saadjs/agent-skills --skill de-dupe

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Remove duplicated logic and tech debt by enforcing DRY principles, making code easier to maintain and extend.

Core Features & Use Cases

  • Identify duplication across files and modules.
  • Extract shared utilities into common helpers.
  • Guardrails for safe, incremental refactors that preserve behavior.

Quick Start

Refactor by extracting a shared utility from duplicated code and updating call sites after ensuring there are no uncommitted changes.

Frequently Asked Questions about de-dupe

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely refactor duplicated code without breaking existing behavior?

To safely refactor duplicated code, you must enforce DRY principles by checking for uncommitted changes, extracting shared utilities, and updating call sites incrementally to preserve behavior and minimize public API impact.

What is the best way to enforce the DRY principle across a large codebase?

Enforcing the DRY principle involves identifying redundancy across files and modules, extracting duplicated logic into common helpers, and updating existing call sites to ensure tech debt is removed safely.

How do I extract shared utilities from duplicated logic during a code maintenance task?

Extract shared utilities by first ensuring there are no uncommitted changes, identifying the repeated logic across modules, moving it to a common helper, and then updating all call sites to reference the new utility.

Can I refactor code for DRY compliance without affecting my public APIs?

Yes, safe refactoring for DRY compliance focuses on minimizing impact on public APIs by extracting shared utilities and updating internal call sites incrementally, which preserves external behavior while reducing tech debt.

When should I not use an incremental refactoring approach for removing tech debt?

You should not use incremental refactoring when there are uncommitted changes in your git workflow, as the process requires a clean state to safely extract shared utilities and update call sites without risking data loss.

Do I need a clean git workflow to start removing duplicated code and tech debt?

Yes, a clean git workflow is required because the refactoring process checks for uncommitted changes before extracting shared utilities, ensuring that redundancy is removed safely without overwriting unsaved work.