review-duplication

Detects duplicated logic and reinvented utilities during code reviews.

Updated May 23, 2026
One-click install
npx skills add https://github.com/kiranimmadi2/promptforge-ai --skill review-duplication-kiranimmadi2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: review-duplication
Source: https://github.com/kiranimmadi2/promptforge-ai/tree/main/gemini-cli/.gemini/skills/review-duplication
Command: npx skills add https://github.com/kiranimmadi2/promptforge-ai --skill review-duplication-kiranimmadi2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code reviews often miss duplicated functionality, reinvented utilities, and ignored shared patterns, leading to bloated codebases and inconsistent implementations that are harder to maintain. ## Core Features & Use Cases - Duplication Investigation Workflow: Extracts core logic from new code, hypothesizes where similar code would live, and traces third-party dependency usage across the project. - Sub-Agent Delegation: Delegates deep codebase searches to codebase_investigator and generalist sub-agents using structural similarity, naming conventions, and architectural fit as search vectors. - Best Practice Evaluation: Checks error handling, state management, and styling against established project conventions. - Use Case: When reviewing a PR that adds a custom date formatting function, this skill finds the existing formatDate utility in the project and generates a review comment showing exactly how to import and reuse it. ## Quick Start Review this pull request for duplicated functionality and check whether the new code reuses existing project utilities and patterns.

Frequently Asked Questions about review-duplication

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

FAQPage Schema
How do I find duplicated code during a code review?

Extract the core logic from the new code, hypothesize where similar functionality would live in the project, then search for structural similarity, naming patterns, and matching comments. Delegate deep searches to sub-agents for open-ended investigations.

How to check if a PR reinvents an existing utility function?

Check package.json for installed libraries that already provide the functionality, then search utility directories like src/utils for existing implementations. Trace how third-party libraries are currently wrapped or used elsewhere in the project.

When should I delegate codebase searches to sub-agents?

Delegate any open-ended investigation, such as semantic comparisons or architectural mapping, to sub-agents like codebase_investigator. Reserve direct searches only for simple unambiguous checks like verifying a dependency in package.json.

What should a duplication review comment include?

A good comment identifies the exact file path and symbol to reuse, provides a code snippet showing how to integrate the existing implementation, and explains the benefit such as consistency or built-in edge case handling.

Does this approach work for UI components as well as utilities?

Yes, the workflow covers UI components, services, configuration, and core logic. For components, use a generalist sub-agent to semantically compare the new implementation against existing components that could be extended or reused.