review-reuse-and-dedup

Identify reusable helpers and constants to reduce duplication in repository changes.

229|5|Updated May 25, 2026
One-click install
npx skills add https://github.com/compartmentdev/compartment --skill review-reuse-and-dedup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: review-reuse-and-dedup
Source: https://github.com/compartmentdev/compartment/tree/main/.codex/skills/review-reuse-and-dedup
Command: npx skills add https://github.com/compartmentdev/compartment --skill review-reuse-and-dedup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams identify opportunities to remove duplication, reuse existing helpers, and consolidate constants or logic to improve maintainability across a repository during reviews.

Core Features & Use Cases

  • Identify duplicate logic: Spot repeated parsing, normalization, formatting, or variable derivations that could be factored into shared utilities.
  • Promote reuse and consolidation: Recommend moving helpers to shared packages like packages/utils or owning packages.
  • Use Case: When reviewing a PR that touches multiple services, surface candidates to extract common utilities and prevent drift.

Quick Start

Review a code change to surface reusable helpers and deduplicate logic across packages.

Frequently Asked Questions about review-reuse-and-dedup

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

FAQPage Schema
How do I identify code duplication and reuse gaps during a code review?

To identify code duplication during a review, evaluate changes for repeated parsing, normalization, formatting, or variable derivations to surface candidates for extracting into shared utilities.

What is the best way to consolidate repeated literals and logic across multiple services?

The best way to consolidate repeated literals is to extract duplicate logic and constants into shared utilities like packages/utils or owning packages to prevent drift and improve maintainability.

How do I find existing helpers and shared utilities in a repository refactor?

Finding existing helpers during a refactor involves evaluating repository changes against current packages to spot repeated derivations and recommend reusing available utilities before adding new code.

Can I use static analysis to surface reusable helpers across different packages?

Yes, you can use static analysis concepts to evaluate repository changes, surface reusable helpers, and highlight where shared utilities exist or could be extracted across multiple packages.

When should I not extract duplicate logic into a shared package?

You should avoid extracting duplicate logic into a shared package when ownership boundaries are unclear, as improper consolidation across services can negatively impact maintainability and create tight coupling.