code-duplication-detector

Detect duplicate code patterns and generate similarity reports with refactoring suggestions.

3|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/sovrium/sovrium --skill code-duplication-detector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-duplication-detector
Source: https://github.com/sovrium/sovrium/tree/main/.claude/skills/detecting-code-duplication
Command: npx skills add https://github.com/sovrium/sovrium --skill code-duplication-detector

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Duplicated code makes maintenance hard. This Skill detects duplicate code patterns, similar functions, repeated logic, and copy-paste across the codebase. Reports duplication with similarity scores and refactoring suggestions to help you enforce the DRY principle.

Core Features & Use Cases

  • Exact & near-duplicate detection: Finds identical and near-identical blocks.
  • Similarity scoring: Provides similarity percentages to prioritize fixes.
  • Refactoring guidance: Suggests concrete extraction or abstraction opportunities.

Quick Start

Run the detector on your project to receive a detailed duplication report with suggested refactors.

Frequently Asked Questions about code-duplication-detector

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

FAQPage Schema
How do I detect duplicate code in my project?

Code duplication detection identifies exact and near-identical blocks across your codebase using block-based analysis with a minimum threshold of 5 lines. The detector scans TypeScript and JavaScript sources across multi-file projects, assigns similarity scores to each match, and generates a deterministic report pinpointing duplicates and suggesting refactoring opportunities to enforce the DRY principle.

What counts as code duplication that the detector finds?

The detector identifies exact duplicates, near-identical blocks with minor variations, repeated logic patterns, and copy-paste code. It assigns similarity percentages to prioritize which duplicates create the most maintenance burden, helping you focus refactoring efforts on the highest-impact violations.

Can I use code duplication detection on TypeScript and JavaScript codebases?

Yes, the detector operates on TypeScript and JavaScript sources using language-agnostic block-based comparison. It works across multi-file repositories and projects of any scale, applying consistent duplicate detection and similarity scoring regardless of project structure.

Does the detector suggest how to fix duplicated code?

Yes, the detector provides refactoring guidance alongside duplication reports. It suggests concrete extraction or abstraction opportunities based on similarity scores, helping you decide whether to consolidate duplicates into shared functions, utilities, or base classes.

What's the minimum code block size the detector analyzes?

The detector uses a minimum block size of 5 lines to identify duplicates. Blocks smaller than this threshold are not flagged, focusing analysis on substantial repeated logic rather than trivial similarities.

Does the detector modify my code?

No, the code duplication detector operates as a non-modifying analyzer. It produces deterministic duplication reports with similarity scores and refactoring suggestions but does not alter your codebase; you decide which duplicates to refactor.