Duplicate finder

From berkcangumusisik/claude-code-practices · View interactive version

Duplicate finder is an AI agent skill from the GitHub repository berkcangumusisik/claude-code-practices. Finds duplicated logic across the codebase and proposes shared abstractions

How to use this skill

Skill file

Find Duplicate Code

  1. Look for structural duplication:
# Similar function signatures
grep -rn "async function\|const .* = async" ${1:-src}/ --include="*.ts" | sort | head -40

# Similar patterns (fetch calls, error handling, etc.)
grep -rn "try {" ${1:-src}/ --include="*.ts" -l
  1. Read suspected duplicate files side by side.
  1. Identify duplication categories:
  1. For each duplication cluster:
  1. Ask which ones to consolidate, then apply.

Focus on impactful duplications (3+ occurrences or > 20 lines).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.