anti-duplication

Search existing endpoints, components, services, and models before writing new code to prevent duplication.

Updated Feb 14, 2026
One-click install
npx skills add https://github.com/DYAI2025/MOD_shark-engine --skill anti-duplication-dyai2025
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: anti-duplication
Source: https://github.com/DYAI2025/MOD_shark-engine/tree/main/sharkengine/.claude/skills/anti-duplication
Command: npx skills add https://github.com/DYAI2025/MOD_shark-engine --skill anti-duplication-dyai2025

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Proactively searches codebases for existing patterns before implementing new features to prevent duplication, reduce maintenance burden, and promote reuse.

Core Features & Use Cases

  • Pre-emptive search of endpoints, components, services, and models to surface existing implementations
  • Reuse or extend existing patterns to maintain consistency and DRY principles
  • Decision framework (exact/close/pattern matches; extract pattern after 3+ similar instances; document justification)

Quick Start

Before implementing a feature, automatically search for existing patterns, present reuse options, and follow the established pattern.

Frequently Asked Questions about anti-duplication

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

FAQPage Schema
How do I prevent code duplication when adding new endpoints and services?

To prevent code duplication, proactively search existing endpoints, components, and services before writing new code to surface exact or close matches. This enforces DRY principles by guiding you to reuse established implementations and maintain consistency across your codebase.

When should I extract an abstract pattern from similar code implementations?

You should extract abstract patterns only after identifying three or more similar code instances during your pre-emptive code search. This threshold ensures refactoring is justified and maximizes reusable pattern consistency without premature abstraction across your models.

What is the best way to find existing implementations before writing new features?

The best way to find existing implementations is using a pre-emptive code search that surfaces exact matches, close matches, and reusable patterns. This decision framework guides you to either reuse templates, extend current logic, or document justifications for new code.

Can I justify writing a new component if a similar pattern already exists?

Yes, you can justify writing a new component if existing implementations do not meet requirements, but you must document the justification. The search results provide a decision framework to extend existing logic where possible before creating new models.

Does pre-emptive code search work for refactoring models and endpoints?

Pre-emptive code search works for refactoring models and endpoints by automatically scanning the codebase to surface reusable patterns. It enforces consistency by guiding you to reuse existing templates instead of duplicating logic across services.