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.zipInstalls 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.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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| code-duplication (this skill) | 0 | 2mo | No flags | Advanced |
| solid-principles | 57 | 9mo | No flags | Intermediate |
| python-design-patterns | 19 | 2mo | No flags | Intermediate |
| modular-code | 4 | 7mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Proxyfan
View all by Proxyfan →You might also like
solid-principles
SmidigStorm
Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.
python-design-patterns
wshobson
Python design patterns including KISS, Separation of Concerns, Single Responsibility, and composition over inheritance. Use when making architecture decisions, refactoring code structure, or evaluating when abstractions are appropriate.
modular-code
parcadei
Modular Code Organization
component-common-domain-detection
tech-leads-club
Identifies duplicate domain functionality across components and suggests consolidation opportunities. Use when finding common domain logic, detecting duplicate functionality, analyzing shared classes, planning component consolidation, or when the user asks about common components, duplicate code, or domain consolidation.
framework-migration-code-migrate
sickn33
You are a code migration expert specializing in transitioning codebases between frameworks, languages, versions, and platforms. Generate comprehensive migration plans, automated migration scripts, and
framework-migration-legacy-modernize
sickn33
Orchestrate a comprehensive legacy system modernization using the strangler fig pattern, enabling gradual replacement of outdated components while maintaining continuous business operations through ex