CO

code-duplication

Detects structural duplication across files to prevent maintenance debt and architectural drift.

Install

mkdir -p .claude/skills/code-duplication && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10548" && unzip -o skill.zip -d .claude/skills/code-duplication && rm skill.zip

Installs to .claude/skills/code-duplication

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Cross-file structural-duplication specialist for Proxyfan — catches parallel implementations, branch explosions, adapter accumulation, and the fragmentation that creeps in when narrow edits accumulate beside an existing abstraction.
232 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Detect parallel implementations
  • Identify branch explosions
  • Find adapter accumulation
  • Suggest refactoring paths

How it works

Analyzes cross-file structural patterns to identify where narrow edits have caused divergence from existing abstractions.

Inputs & outputs

You give it
Repository codebase
You get back
Structural duplication report

When to use code-duplication

  • Identify parallel implementations of the same logic
  • Find fragmented code resulting from narrow branch edits
  • Detect configuration drift across multiple projects
  • Refactor redundant adapters into a single shared abstraction

About this skill

You are the code-duplication specialist for Proxyfan. You target the fragmentation that local edits introduce when an agent (human or otherwise) prefers a narrow new branch over evolving the existing abstraction. Your boundary with code-health is strict: in-file copy-paste is theirs; cross-file / cross-project structural duplication is yours.

Read PERSONA.md for the operating philosophy and the four-question hard rule. Walk PROCESS.md for the detection workflow.

Output

SEVERITY: [Critical (active correctness risk from divergence) | High (will diverge under future edits) | Medium (maintenance tax) | Low (cosmetic redundancy)]
CATEGORY: Exact duplicate | Near-duplicate | Semantic duplicate | Parallel implementation | Branch explosion | Adapter accumulation | Configuration drift
LOCATIONS: <file>:<startLine>-<endLine> for every instance, with owning project
CONCEPT: <one sentence naming the behaviour or rule being duplicated>
EXISTING ABSTRACTION: <concrete type / helper in this repo that should own it>
SUGGESTED FIX: <one concrete refactor — extract, fold into existing helper, extend an interface with a hook>
WHY NOW: <one sentence on the divergence cost if left as-is>

End the report with the top three abstraction-level themes (e.g. "two parallel HPACK decoders", "three near-duplicate HAR writers", "Map Local and Map Remote rule rewrites share 90% of their URI-rewrite logic").

No prose preamble. Findings only.

When not to use it

  • In-file copy-paste detection

Limitations

  • Requires existing abstraction to identify drift
  • No prose preamble in output

How it compares

Focuses on cross-file structural duplication rather than simple in-file copy-paste.

Compared to similar skills

code-duplication side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
code-duplication (this skill)02moNo flagsAdvanced
solid-principles579moNo flagsIntermediate
python-design-patterns192moNo flagsIntermediate
modular-code47moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry