anti-duplication

Search existing code patterns before implementing new functionality to prevent duplication.

91|10|Updated Oct 4, 2025
One-click install
npx skills add https://github.com/marcusgoll/Spec-Flow --skill anti-duplication
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: anti-duplication
Source: https://github.com/marcusgoll/Spec-Flow/tree/main/.codex/skills/anti-duplication
Command: npx skills add https://github.com/marcusgoll/Spec-Flow --skill anti-duplication

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Proactively search for existing patterns before implementing new functionality to minimize duplication and maximize reuse.

Core Features & Use Cases

  • Search phase: semantic and literal code search for reusability
  • Decision phase: reuse directly, extend, or extract patterns
  • Pattern extraction: create shared abstractions when patterns repeat

Quick Start

Trigger on requests like "create endpoint" to start search-and-reuse workflow.

Frequently Asked Questions about anti-duplication

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

FAQPage Schema
How do I avoid code duplication when adding new features?

Search for existing code patterns before implementing new functionality. This Skill automatically identifies reusable patterns in authentication, validation, error handling, and routing, letting you extend or reuse them instead of duplicating code across your codebase.

What's the best way to enforce DRY principles across a codebase?

Standardize patterns by identifying and extracting common abstractions before building new features. This Skill applies semantic and literal code search to detect reusable patterns, then guides you to reuse, extend, or justify new implementations.

How does code search help prevent duplication?

Two-phase workflow: first, semantic and literal search discovers existing patterns matching your intent; second, you decide whether to reuse directly, extend an existing pattern, or extract a shared abstraction. This prevents redundant implementations.

Can I use pattern reuse with authentication and validation logic?

Yes. This Skill standardizes patterns across authentication, validation, error handling, and routing. It triggers on requests to create endpoints or implement new functionality, identifying existing patterns in these domains for reuse.

When should I extract a new pattern versus reusing existing code?

The Skill guides this decision by searching for existing patterns first. If no match exists, it prompts you to justify why a new implementation is necessary. Extract patterns when you detect repetition across multiple locations.