Find Similar Functions
millionco/react-doctor
Use truffler to find similar or pre-existing JavaScript/TypeScript symbols before implementing new code, especially helpers, utilities, parsers, formatters, scanners, fuzzy matchers, and other…
A skill your agent uses when auditing a codebase for semantic duplication - functions that do the same thing but have different names or implementations.
$ npx skills add obra/superpowers-lab --skill finding-duplicate-functions -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install obra/superpowers-lab finding-duplicate-functions --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/obra/superpowers-lab.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/finding-duplicate-functions .claude/skills/finding-duplicate-functions && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "finding-duplicate-functions" agent skill from https://github.com/obra/superpowers-lab/tree/main/skills/finding-duplicate-functions into .claude/skills/finding-duplicate-functions/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "finding-duplicate-functions", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/obra/superpowers-lab/tree/main/skills/finding-duplicate-functionsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add obra/superpowers-lab --skill finding-duplicate-functions -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install obra/superpowers-lab finding-duplicate-functions --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/obra/superpowers-lab.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/finding-duplicate-functions .agents/skills/finding-duplicate-functions && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "finding-duplicate-functions" agent skill from https://github.com/obra/superpowers-lab/tree/main/skills/finding-duplicate-functions into .agents/skills/finding-duplicate-functions/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "finding-duplicate-functions", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add obra/superpowers-lab --skill finding-duplicate-functions -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install obra/superpowers-lab finding-duplicate-functions --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/obra/superpowers-lab.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/finding-duplicate-functions .cursor/skills/finding-duplicate-functions && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "finding-duplicate-functions" agent skill from https://github.com/obra/superpowers-lab/tree/main/skills/finding-duplicate-functions into .cursor/skills/finding-duplicate-functions/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "finding-duplicate-functions", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/obra/superpowers-lab.git --path skills/finding-duplicate-functions--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add obra/superpowers-lab --skill finding-duplicate-functions -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install obra/superpowers-lab finding-duplicate-functions --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/obra/superpowers-lab.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/finding-duplicate-functions .gemini/skills/finding-duplicate-functions && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "finding-duplicate-functions" agent skill from https://github.com/obra/superpowers-lab/tree/main/skills/finding-duplicate-functions into .gemini/skills/finding-duplicate-functions/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "finding-duplicate-functions", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install obra/superpowers-lab finding-duplicate-functionsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add obra/superpowers-lab --skill finding-duplicate-functions -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/obra/superpowers-lab.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/finding-duplicate-functions .github/skills/finding-duplicate-functions && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "finding-duplicate-functions" agent skill from https://github.com/obra/superpowers-lab/tree/main/skills/finding-duplicate-functions into .github/skills/finding-duplicate-functions/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "finding-duplicate-functions", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add obra/superpowers-lab --skill finding-duplicate-functions -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install obra/superpowers-lab finding-duplicate-functions --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/obra/superpowers-lab.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/finding-duplicate-functions .opencode/skills/finding-duplicate-functions && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "finding-duplicate-functions" agent skill from https://github.com/obra/superpowers-lab/tree/main/skills/finding-duplicate-functions into .opencode/skills/finding-duplicate-functions/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "finding-duplicate-functions", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
finding-duplicate-functionsA skill your agent uses when auditing a codebase for semantic duplication - functions that do the same thing but have different names or implementations.
Finding Duplicate Functions is an agent skill from obra/superpowers-lab. Use when auditing a codebase for semantic duplication - functions that do the same thing but have different names or implementations. Especially useful for LLM-generated codebases where new functions are often created rather than reusing existing ones.
Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts (for example `scripts/categorize-prompt.md`, `scripts/extract-functions.sh` and `scripts/find-duplicates-prompt.md`).
The repository describes itself as: Experimental skills for Claude Code Superpowers - new techniques and tools. The licence is MIT.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 51111f7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 5 files in scripts/ (Shell), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Finding Duplicate Functions loads about 1.2k tokens when it runs. Until then it costs about 70 tokens; SKILL.md has 427 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from obra/superpowers-lab at commit 51111f7, republished under its MIT licence (© obra). 427 words, ~1,199 tokens.
.claude/skills/finding-duplicate-functions/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.LLM-generated codebases accumulate semantic duplicates: functions that serve the same purpose but were implemented independently. Classical copy-paste detectors (jscpd) find syntactic duplicates but miss "same intent, different implementation."
This skill uses a two-phase approach: classical extraction followed by LLM-powered intent clustering.
| Phase | Tool | Model | Output |
|---|---|---|---|
| 1. Extract | scripts/extract-functions.sh | - | catalog.json |
| 2. Categorize | scripts/categorize-prompt.md | haiku | categorized.json |
| 3. Split | scripts/prepare-category-analysis.sh | - | categories/*.json |
| 4. Detect | scripts/find-duplicates-prompt.md | opus | duplicates/*.json |
| 5. Report | scripts/generate-report.sh | - | report.md |
digraph duplicate_detection {
rankdir=TB;
node [shape=box];
extract [label="1. Extract function catalog\n./scripts/extract-functions.sh"];
categorize [label="2. Categorize by domain\n(haiku subagent)"];
split [label="3. Split into categories\n./scripts/prepare-category-analysis.sh"];
detect [label="4. Find duplicates per category\n(opus subagent per category)"];
report [label="5. Generate report\n./scripts/generate-report.sh"];
review [label="6. Human review & consolidate"];
extract -> categorize -> split -> detect -> report -> review;
}./scripts/extract-functions.sh src/ -o catalog.jsonOptions:
-o FILE: Output file (default: stdout)-c N: Lines of context to capture (default: 15)-t GLOB: File types (default: *.ts,*.tsx,*.js,*.jsx)--include-tests: Include test files (excluded by default)Test files (*.test.*, *.spec.*, __tests__/**) are excluded by default since test utilities are less likely to be consolidation candidates.
Dispatch a haiku subagent using the prompt in scripts/categorize-prompt.md.
Insert the contents of catalog.json where indicated in the prompt template. Save output as categorized.json.
./scripts/prepare-category-analysis.sh categorized.json ./categoriesCreates one JSON file per category. Only categories with 3+ functions are worth analyzing.
For each category file in ./categories/, dispatch an opus subagent using the prompt in scripts/find-duplicates-prompt.md.
Save each output as ./duplicates/{category}.json.
./scripts/generate-report.sh ./duplicates ./duplicates-report.mdProduces a prioritized markdown report grouped by confidence level.
Review the report. For HIGH confidence duplicates:
Focus extraction on these areas first - they accumulate duplicates fastest:
| Zone | Common Duplicates |
|---|---|
utils/, helpers/, lib/ | General utilities reimplemented |
| Validation code | Same checks written multiple ways |
| Error formatting | Error-to-string conversions |
| Path manipulation | Joining, resolving, normalizing paths |
| String formatting | Case conversion, truncation, escaping |
| Date formatting | Same formats implemented repeatedly |
| API response shaping | Similar transformations for different endpoints |
Extracting too much: Focus on exported functions and public methods. Internal helpers are less likely to be duplicated across files.
Skipping the categorization step: Going straight to duplicate detection on the full catalog produces noise. Categories focus the comparison.
Using haiku for duplicate detection: Haiku is cost-effective for categorization but misses subtle semantic duplicates. Use Opus for the actual duplicate analysis.
Consolidating without tests: Before deleting duplicates, ensure the survivor has tests covering all use cases of the deleted functions.
© obra, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 5 other files (scripts) in skills/finding-duplicate-functions of obra/superpowers-lab.
Open the folder on GitHubat commit 51111f7
We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in obra/superpowers-lab, which our catalogue first saw on October 7, 2026.
Finding Duplicate Functions next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Finding Duplicate Functions this skillobra/superpowers-lab | 429 | 2 repos | ~1.2k | Automated safety check: Pass | MIT | |
| Find Similar Functionsmillionco/react-doctor | 15k | — | ~1.2k | Automated safety check: Pass | Custom licence | |
| Finding Duplicate Functionsbobmatnyc/claude-mpm | 155 | — | ~1.3k | Automated safety check: Pass | MIT | |
| Production Auditaffaan-m/ECC | 274k | 1 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Aims Auditalirezarezvani/claude-skills | 28k | — | ~1.3k | Automated safety check: Pass | MIT | |
| Click Path Auditaffaan-m/ECC | 274k | 3 repos | ~2k | Automated safety check: Pass | MIT |
millionco/react-doctor
Use truffler to find similar or pre-existing JavaScript/TypeScript symbols before implementing new code, especially helpers, utilities, parsers, formatters, scanners, fuzzy matchers, and other…
bobmatnyc/claude-mpm
A skill your agent uses when auditing a codebase for semantic duplication — functions that do the same thing but have different names or implementations, especially common in LLM-generated codebases
affaan-m/ECC
Local-evidence production readiness audit for shipped apps, pre-launch reviews, post-merge checks, and "what breaks in prod?" questions without sending repo data to an external audit service.
alirezarezvani/claude-skills
/cs:aims-audit <scope — ISO/IEC 42001 AIMS internal-audit 6-question forcing interrogation.
affaan-m/ECC
Trace every user-facing button/touchpoint through its full state change sequence to find bugs where functions individually work but cancel each other out, produce wrong final state, or leave the UI…
sickn33/agentic-awesome-skills
Full website GEO+SEO audit with parallel subagent delegation.
obra/superpowers-lab
A skill your agent uses when you need to run interactive CLI tools (vim, git rebase -i, Python REPL, etc.) that require real-time input/output - provides tmux-based approach for controlling…
A skill your agent uses when auditing a codebase for semantic duplication - functions that do the same thing but have different names or implementations. Finding Duplicate Functions is an agent skill from obra/superpowers-lab. Use when auditing a codebase for semantic duplication - functions that do the same thing but have different names or implementations.
Finding Duplicate Functions fits situations like: auditing a codebase for semantic duplication - functions that do the same thing but have different names; implementations.
Run `npx skills add obra/superpowers-lab --skill finding-duplicate-functions -a claude-code`. Or copy the skill folder (skills/finding-duplicate-functions in obra/superpowers-lab) into .claude/skills/finding-duplicate-functions in your project. Claude Code loads it when a task matches its description.
Run `npx skills add obra/superpowers-lab --skill finding-duplicate-functions -a codex`. Or copy the skill folder (skills/finding-duplicate-functions in obra/superpowers-lab) into .agents/skills/finding-duplicate-functions in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add obra/superpowers-lab --skill finding-duplicate-functions -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/finding-duplicate-functions, .gemini/skills/finding-duplicate-functions, .github/skills/finding-duplicate-functions and .opencode/skills/finding-duplicate-functions in your project.
Going by SKILL.md and its folder, Finding Duplicate Functions needs a shell for the scripts in its folder. Our summary lists: A Bash shell.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Finding Duplicate Functions is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Finding Duplicate Functions: Find Similar Functions (millionco/react-doctor, 15k stars), Finding Duplicate Functions (bobmatnyc/claude-mpm, 155 stars), Production Audit (affaan-m/ECC, 274k stars) and Aims Audit (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
obra (a GitHub user) maintains it in obra/superpowers-lab, which has 429 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on June 1, 2026.
Source: obra/superpowers-lab on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.