finding-duplicate-functions

Identify semantic duplicate functions in JavaScript/TypeScript codebases via extraction and LLM categorization.

154|1|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/haojing8312/WorkClaw --skill finding-duplicate-functions-haojing8312
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finding-duplicate-functions
Source: https://github.com/haojing8312/WorkClaw/tree/main/.claude/skills/finding-duplicate-functions
Command: npx skills add https://github.com/haojing8312/WorkClaw --skill finding-duplicate-functions-haojing8312

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ripgrep, jq, and includes scripts (resource) components.

What problem does it solve?

Large JavaScript/TypeScript codebases—especially those augmented by LLMs—often accumulate semantic duplicates: independently implemented functions that serve the same purpose but have different names or code. This skill helps locate those duplicate-intent functions so teams can prioritize consolidation, reduce maintenance burden, and improve test coverage.

Core Features & Use Cases

  • Two-phase pipeline: extract a function catalog from source files, then use LLM-driven categorization and per-category duplicate analysis to surface semantic duplicates.
  • Scripted automation: ready-to-run shell scripts produce catalog.json, categorized.json, per-category inputs, duplicate group outputs, and a prioritized markdown report.
  • Use Cases: audit LLM-generated repositories before refactoring, clean utility and helper directories, and prepare consolidation proposals for code review.

Quick Start

Run the extract, categorize, analyze, and report steps on your repository using the provided scripts to generate a prioritized duplicate-functions report.

Frequently Asked Questions about finding-duplicate-functions

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

FAQPage Schema
How do I find semantic duplicate functions in a TypeScript codebase?

To find semantic duplicate functions in a TypeScript codebase, use a two-phase pipeline that extracts a function catalog with ripgrep and applies LLM-driven categorization to identify independently implemented functions sharing the same purpose, outputting a prioritized markdown report.

What is the best way to audit LLM-generated JavaScript code for duplicate logic?

Auditing LLM-generated JavaScript code for duplicate logic involves running an extraction script to build a function catalog, followed by LLM-driven categorization that surfaces semantic duplicates to help teams prioritize consolidation and reduce maintenance burden.

Do I need ripgrep and jq installed to detect duplicate functions?

Yes, you need ripgrep and jq installed in a POSIX shell environment to run the provided shell scripts for duplicate function detection, which parse source files and generate categorized JSON outputs and markdown reports.

Can I use this duplicate function detection approach for pre-merge code review?

Yes, you can use this duplicate function detection approach for pre-merge code review, as it identifies semantic duplicates across JavaScript and TypeScript files to help teams prepare consolidation proposals and improve test coverage before merging.

What outputs are generated when scanning for semantic code duplication?

Scanning for semantic code duplication generates catalog.json, categorized.json, per-category inputs, duplicate group outputs, and a prioritized markdown report that details independently implemented functions serving the same purpose.