code-reuse-enforcer

Enforce code reuse by searching existing components and hooks before new implementations.

Updated Dec 28, 2025
One-click install
npx skills add https://github.com/mbelenmontoya/hara --skill code-reuse-enforcer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-reuse-enforcer
Source: https://github.com/mbelenmontoya/hara/tree/main/.claude/skills/code-reuse-enforcer
Command: npx skills add https://github.com/mbelenmontoya/hara --skill code-reuse-enforcer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents redundant code by ensuring developers search for and leverage existing components, hooks, and utilities before creating new implementations.

Core Features & Use Cases

  • Codebase Search Guidance: Directs developers to specific directories and files where existing solutions are likely to be found.
  • Component & Hook Inventory: Lists pre-existing UI components and custom hooks to avoid duplication.
  • Verification Checklist: Provides steps to confirm if a solution already exists and guidelines for extending or wrapping existing code.
  • Use Case: A developer needs to add a new button component. Instead of creating a new one, they consult the Skill, find the existing Button component in app/components/ui/, and use it, potentially extending it with new props if necessary.

Quick Start

Before creating a new component, search the codebase for existing implementations in app/components/ui/ and app/components/.

Frequently Asked Questions about code-reuse-enforcer

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

FAQPage Schema
How do I prevent code duplication when adding new UI components?

Preventing code duplication involves searching specific directories like `app/components/ui/` and `lib/` for existing components and hooks before creating new implementations. This verifies that you reuse available assets instead of reinventing them.

What is the best way to find existing custom hooks in a codebase?

The best way to find existing custom hooks is to consult a component and hook inventory that lists pre-existing utilities. You can search designated directories like `lib/` to locate and reuse these assets instead of building new ones.

How do I extend an existing component instead of creating a new one?

You can extend an existing component by locating it in `app/components/` and wrapping it or adding new props. This follows a USE → IMPROVE → ADD philosophy to avoid redundant code while meeting new requirements.

When should I search for existing utilities before writing new code?

You should search for existing utilities before writing new code to validate against duplication and maintain code quality. Mandating searches in directories like `lib/` ensures you leverage existing solutions instead of creating redundant implementations.

Does enforcing code reuse work with my existing component library?

Enforcing code reuse works with your existing component library by providing an inventory of pre-existing UI elements and hooks. It directs developers to specific directories to find and use these established assets.