cleanup-dedupe

Detect duplicated code blocks with jscpd and refactor them to follow DRY principles.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/raintree-technology/agent-starter --skill cleanup-dedupe
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup-dedupe
Source: https://github.com/raintree-technology/agent-starter/tree/main/templates/.claude/skills/cleanup-dedupe
Command: npx skills add https://github.com/raintree-technology/agent-starter --skill cleanup-dedupe

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the detection of duplicated code blocks and refactors them to follow the DRY (Don't Repeat Yourself) principle, reducing complexity and improving code quality.

Core Features & Use Cases

  • Code Duplication Detection: Identifies and lists duplicated code blocks based on token and line count.
  • Refactoring: Automatically refactors code blocks that meet certain criteria to follow DRY principles.
  • Use Case: When you need to clean up your codebase, find and consolidate repeated logic, or automate the process of refactoring duplicated code.

Quick Start

Run the cleanup-dedupe skill with the path to your codebase to find and refactor duplicate code blocks.

Frequently Asked Questions about cleanup-dedupe

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

FAQPage Schema
How do I automate code deduplication in my codebase?

You can automate code deduplication by running the cleanup-dedupe skill with your codebase path to detect and refactor duplicated code blocks, enforcing DRY principles. It identifies repeated logic based on token and line count to improve overall code quality.

What is the DRY principle in code refactoring?

The DRY (Don't Repeat Yourself) principle in code refactoring focuses on reducing repetition within software. By detecting and consolidating duplicated code blocks into single, reusable representations, it reduces complexity and improves maintainability across the codebase.

Does code clone detection work with multiple programming languages?

Yes, code clone detection supports various programming languages. By utilizing jscpd for clone detection, the skill can identify and list duplicated code blocks across different codebases to help enforce DRY principles effectively.

How do I find and consolidate repeated logic in a large codebase?

To find and consolidate repeated logic, provide your codebase path to the skill. It utilizes jscpd to detect cloned blocks based on token and line count, and then automatically refactors the identified code to follow DRY principles.

When should I not use automated code refactoring for duplicated blocks?

Automated code refactoring for duplicated blocks is expected to handle clean codebases with a focus on improving code quality. If your codebase is highly unstructured or lacks test coverage, automated refactoring might introduce unexpected complexity.