review-duplication

Detects duplicated logic and reinvented utilities in pull requests during code reviews.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code reviews often miss duplicated functionality, reinvented utilities, and ignored shared patterns, leading to maintenance debt and inconsistent implementations across a codebase. ## Core Features & Use Cases - Duplication Investigation: Analyzes new code for core algorithms, utilities, and components that may already exist in the project. - Sub-Agent Delegation: Delegates deep codebase searches to specialized 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 formatter, the skill traces existing utilities like formatDate in shared helpers and produces a constructive review comment with refactoring guidance. ## Quick Start Review this pull request for duplicated functionality and check whether the new code reuses existing shared utilities and project patterns.

Frequently Asked Questions about review-duplication

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

FAQPage Schema
How do I check a pull request for duplicated code?

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

How to find existing utilities before writing new helper functions?

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

When should code review searches be delegated to sub-agents?

Delegate any open-ended investigation, such as semantic comparisons or architectural mapping, to sub-agents to avoid bloating session history. Use 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 it, and explains the benefit such as consistency or built-in edge case handling.

Does this approach work for UI component duplication?

Yes, the workflow covers UI components by comparing new components semantically against existing ones in component directories and checking styling against theme variables rather than hardcoded values.