finding-duplicate-functions

Detect semantic duplicate functions across TypeScript and JavaScript codebases.

4|Updated Jan 12, 2017
One-click install
npx skills add https://github.com/brandon-fryslie/dotfiles --skill finding-duplicate-functions-brandon-fryslie
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finding-duplicate-functions
Source: https://github.com/brandon-fryslie/dotfiles/tree/main/config/codex/skills/finding-duplicate-functions
Command: npx skills add https://github.com/brandon-fryslie/dotfiles --skill finding-duplicate-functions-brandon-fryslie

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires extract-functions.sh, categorize-prompt.md, prepare-category-analysis.sh, find-duplicates-prompt.md, generate-report.sh, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Identifies duplicate functions that serve the same purpose but have different names or implementations within a codebase.

Core Features & Use Cases

  • Function Detection: Automates the detection of function definitions across code repositories.
  • Semantic Analysis: Determines semantic duplicates by understanding function intent and not just syntactic patterns.
  • Custom Analysis: Allows custom extraction and categorization through the use of prompt files for AI subagents.

Quick Start

To identify duplicates in your 'src/' directory, execute the skill using:

finding-duplicate-functions -c src/

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 duplicate functions in a TypeScript or JavaScript codebase?

You can find duplicate functions by running an automated extraction script that identifies function definitions and then uses AI-based semantic analysis to detect matching intent across your codebase.

What is semantic duplicate detection and how does it differ from finding identical code blocks?

Semantic duplicate detection identifies functions that serve the same purpose but have different names or implementations, going beyond syntactic pattern matching to understand the actual intent of the code.

Can I use custom prompts to categorize extracted functions during a codebase audit?

Yes, the tool allows custom extraction and categorization through predefined prompt files that guide AI subagents in analyzing and grouping extracted functions according to your specific criteria.

What's the best way to audit my src directory for unintended duplicate code?

Execute the duplicate detection skill targeting your source directory to automatically extract function definitions, categorize them semantically, and generate a report highlighting unintended duplicates for consolidation.

Does this duplicate detection approach work with languages other than JavaScript and TypeScript?

The tool is specifically designed to identify function-level duplicates across TypeScript and JavaScript codebases, focusing on semantic duplication within those language ecosystems.

Why does semantic analysis find duplicates that standard linters and code analysis tools miss?

Semantic analysis uses AI to understand function intent rather than just syntactic patterns, allowing it to detect duplicates that have different implementations or naming conventions but serve the same underlying purpose.