finding-duplicate-functions

Identify semantic duplicate functions in codebases and generate a consolidation plan.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/hellitonsm/genesis-project --skill finding-duplicate-functions-hellitonsm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finding-duplicate-functions
Source: https://github.com/hellitonsm/genesis-project/tree/main/tools/finding-duplicate-functions
Command: npx skills add https://github.com/hellitonsm/genesis-project --skill finding-duplicate-functions-hellitonsm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Semantic duplicates in codebases are functions that perform the same task but are named or implemented differently. This skill helps you audit large projects (including LLMed codebases) to surface and consolidate these duplicates before refactoring.

Core Features & Use Cases

  • Two-phase analysis: extract a catalog of functions, then cluster by intent using LLM-powered categorization.
  • Traceable outputs: generate catalog.json, categorized.json, category-level outputs under categories/, and a final report.
  • Use Case: before a major rewrite, identify multiple implementations of the same business logic to consolidate onto a single, well-tested function.

Quick Start

Run the extraction script to catalog functions, categorize by intent, and run the semantic-duplicate analysis to surface consolidation opportunities.

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 codebase before refactoring?

To find semantic duplicate functions in a codebase, you can run a script that extracts a function catalog, clusters functions by intent using LLM categorization, and generates a consolidation plan. This surfaces implementations that share intent but differ in naming or implementation.

What is semantic duplication detection in multi-contributor or LLMed codebases?

Semantic duplication detection identifies functions that perform the same task but are named or implemented differently. It is applied to multi-contributor or LLMed codebases to reduce redundancy by categorizing extracted function catalogs by domain intent.

How do I audit a large project for functions sharing the same business logic?

You audit a large project by extracting a function catalog, categorizing it by domain, and performing semantic-duplicate detection. This produces categorized groups and a final consolidation report to help merge multiple implementations onto a single, well-tested function.

Does this duplicate function analysis generate traceable outputs for codebase audits?

Yes, duplicate function analysis generates traceable outputs including catalog.json, categorized.json, category-level outputs under a categories directory, and a final report to document the semantic duplication detection process.

Can I use this semantic duplicate detection for a major codebase rewrite?

Yes, semantic duplicate detection is designed for use before a major rewrite. It identifies multiple implementations of the same business logic across a codebase, allowing you to consolidate them onto a single, well-tested function.

What are the limitations of using LLM clustering for function analysis?

LLM clustering for function analysis relies on extracting a function catalog and categorizing by domain, which may require manual review of the generated consolidation plan and category-level outputs to verify intent accuracy before refactoring.