Refactor Duplication — Content & Marketing agent for Claude Code
Scans for copy-pasted or near-identical code blocks of 10+ lines across files and returns the duplication groups.
How to install Refactor Duplication
Installs to ~/.claude/agents/spardutti-claude-skills-refactor-duplication.md
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/Spardutti/claude-skills/HEAD/agents/refactor-duplication.md -o ~/.claude/agents/spardutti-claude-skills-refactor-duplication.md Restart Claude Code, or start a new session, for it to be picked up.
What Refactor Duplication does
name: refactor-duplication description: Scans for copy-pasted or near-identical code blocks of 10+ lines across files and returns the duplication groups. model: haiku tools: Glob, Grep, Read
You are a duplication auditor. Find near-identical code blocks (10+ lines) that appear in 2 or more files.
Scope
Extensions + excludes:
**/*.ts **/*.tsx **/*.js **/*.jsx **/*.py **/*.go **/*.rs
**/*.java **/*.rb **/*.php **/*.vue **/*.svelte
Skip `node_modules`, `dist`, `build`, `.next`
Alternatives in Content & Marketing
- Conversion Optimizer — Conversion rate optimization specialist 587 ★
- Encrypted Column Auditor — Audits new or changed web API routes for server-side reads of E2E-encrypted content columns (groups.windows, s 189 ★
- Repurpose Longform — Long-form content specialist 139 ★
Full documentation available on GitHub
View Source RepositoryRelated Agents
P Code Review Reuse
Invoked by p-code-review to run the reuse / duplication channel across the entire working tree (no diff). Find
Verify Duplication
STAGE 4 VERIFICATION - Code duplication detection. Uses token-based and structural analysis to find copy-paste
Worker Source Fetcher
Fetches URLs or processes pasted content, applies privacy filter, saves to raw/ directory. Returns path for in
Section Scoper
Stage 2 worker — reads the pages of one PDF a scope listing names, as renders and text-layer lines, and return
Mk300 Preset
Use to read or edit presets on the MK-300 over USB: show, load, change a model or knob, turn blocks on/off, bp
Plugin Refactorer
Refactor an existing shotcowboystyle Claude Code workspace repo into a shareable Claude Code plugin. Fetches t
Related Skills
Refactor Safe
Refactor internals without changing public API. Fixes structural problems (long functions, duplication, poor n
Claude Account Sync Skill
A Claude Code skill that keeps the Claude desktop app's Code sidebar identical across several Claude accounts
Mem Compress
rtk-style pre-storage compression — collapses 3+ adjacent identical lines + merges adjacent key: value runs sh