
Review Duplication
- 280 installs
- 106k repo stars
- Updated August 5, 2026
- google-gemini/gemini-cli
Use this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared utilities.
About
Use this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared utilities. This skill provides a structured workflow for investigating a codebase during a code review to identify duplicated logic, reinvented utilities, and missed opportunities to reuse established patterns. By executing this workflow, you ensure that new code integrates seamlessly with the existing project architecture.
- ## Workflow: Investigating for Duplication
- When reviewing code, perform the following steps before finalizing your review:
- ### 2. Hypothesize Existing Locations & Trace Dependencies
- Think about where this type of code *would* live if it already existed in the project. Provide absolute paths from the r
- **Utilities:** `packages/core/src/utils/`, `packages/cli/src/utils/`
Review Duplication by the numbers
- 280 all-time installs (skills.sh)
- Ranked #288 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
review-duplication capabilities & compatibility
- Capabilities
- ## workflow: investigating for duplication · when reviewing code, perform the following steps · ### 2. hypothesize existing locations & trace de · think about where this type of code *would* live
- Use cases
- documentation
What review-duplication says it does
Use this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared utilities.
npx skills add https://github.com/google-gemini/gemini-cli --skill review-duplicationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 280 |
|---|---|
| repo stars | ★ 106k |
| Last updated | August 5, 2026 |
| Repository | google-gemini/gemini-cli ↗ |
How do I apply review-duplication using the workflow in its SKILL.md?
Use this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared ...
Who is it for?
Developers following the review-duplication skill for the tasks it documents.
Skip if: Tasks outside the review-duplication scope described in SKILL.md.
When should I use this skill?
User mentions review-duplication or related triggers from the skill description.
What you get
Working review-duplication setup aligned with the documented patterns and constraints.
- duplication findings
- consolidation recommendations
Files
Review Duplication
Overview
This skill provides a structured workflow for investigating a codebase during a code review to identify duplicated logic, reinvented utilities, and missed opportunities to reuse established patterns. By executing this workflow, you ensure that new code integrates seamlessly with the existing project architecture.
Workflow: Investigating for Duplication
When reviewing code, perform the following steps before finalizing your review:
1. Extract Core Logic
Analyze the new code to identify the core algorithms, utility functions, generic data structures, or UI components being introduced. Look beyond the specific business logic to see the underlying mechanics.
2. Hypothesize Existing Locations & Trace Dependencies
Think about where this type of code would live if it already existed in the project. Provide absolute paths from the repo root to disambiguate.
- Utilities:
packages/core/src/utils/,packages/cli/src/utils/ - UI Components:
packages/cli/src/ui/components/,packages/cli/src/ui/ - Services:
packages/core/src/services/,packages/cli/src/services/ - Configuration:
packages/core/src/config/,packages/cli/src/config/ - Core Logic: Call out
packages/core/if functionality does not appear React UI specific.
Trace Third-Party Dependencies: If the PR introduces a new import for a utility library (e.g., lodash.merge, date-fns), trace how and where the project currently uses that library. There is likely an existing wrapper or shared utility.
Check Package Files: Before flagging a custom implementation of a complex algorithm, check package.json to see if a standard library (like lodash or uuid) is already installed that provides this functionality.
3. Investigate the Codebase (Sub-Agent Delegation)
Delegate the heavy lifting of codebase investigation to specialized sub-agents. They are optimized to perform deep searches and semantic mapping without bloating your session history.
To ensure a comprehensive review, you MUST formulate highly specific objectives for the sub-agents, providing them with the "scents" you discovered in Step 1.
- Codebase Investigator: Use the
codebase_investigatoras your primary researcher. When delegating, formulate an objective that asks specific, investigative questions about the codebase, explicitly including these search vectors: - Structural Similarity: Ask if existing code uses the same underlying APIs (e.g., "Does any existing code use
Intl.DateTimeFormatorsetTimeoutfor similar purposes?"). - Naming Conventions: Ask if there are existing symbols with similar naming patterns (e.g., "Are there existing symbols with naming patterns like
*Format*or*Debounce*?"). - Comments & Documentation: Ask if keywords from the PR's comments or JSDoc exist in describing similar behavior elsewhere.
- Architectural Fit: Ask where this type of logic is currently centralized (e.g., "Where is centralized date formatting logic located?").
- Refactoring Guidance: Crucially, ask the sub-agent to explain how the new code could be refactored to use any existing logic it finds.
- Generalist Agent: Use the
generalistfor detailed, turn-intensive comparisons. For example: "Review the implementation ofMyNewComponentin the PR and compare it semantically against all components inpackages/ui/src. Are there any existing components that could be extended or used instead?" - Retain Fast Path for Simple Searches: For extremely simple, unambiguous checks (e.g., "Does
package.jsonincludelodash?"), perform a direct search to save time. Default to delegation for any open-ended "investigations."
4. Evaluate Best Practices
Check if the new code aligns with the project's established conventions.
- Error Handling: Does it use the project's standard error classes or logging mechanisms?
- State Management: Does it bypass established stores or contexts?
- Styling: Does it hardcode colors or spacing instead of using theme variables?
If the PR introduces a new pattern, compare it against the documented standards and explicitly confirm if an existing project pattern should have been used instead.
5. Formulate Constructive Feedback
If you discover that the PR duplicates existing functionality or ignores a best practice:
- Provide a clear review comment.
- Identify the Source: Explicitly mention the absolute or project-relative file path and the specific symbol (function, component, class) that should be reused.
- Implementation Guidance: Provide a brief code snippet or a clear explanation showing how to integrate the existing code to fulfill the task's requirements.
- Explain the Value: Briefly explain why reusing the existing code is beneficial (e.g., maintainability, consistency, built-in edge case handling).
Example comment:
"It looks like this PR introduces a newformatDateutility. We already have a robust, testedformatDatefunction insrc/utils/dateHelpers.ts.
>
You can replace your implementation by importing it like this:
```typescript
import { formatDate } from '../utils/dateHelpers';
>
// Then use it here:
const displayDate = formatDate(userDate, 'MMM Do, YYYY');
```
Reusing this ensures that the date formatting remains consistent with the rest of the application and handles timezone conversions correctly."
Related skills
How it compares
Use review-duplication for structural reuse investigation during review rather than linting or security scanning tools.
FAQ
What does review-duplication do?
Use this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared ...
When should I use review-duplication?
Invoke when Use this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to re.
Is review-duplication safe to install?
Review the Security Audits panel on this page before installing in production.