code-deduplication

Maintain a capability index to check for existing code before writing new implementations.

705|56|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/alinaqi/claude-bootstrap --skill code-deduplication-alinaqi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-deduplication
Source: https://github.com/alinaqi/claude-bootstrap/tree/main/skills/code-deduplication
Command: npx skills add https://github.com/alinaqi/claude-bootstrap --skill code-deduplication-alinaqi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents the creation of duplicate code by enforcing a "check before you write" policy, ensuring that existing functionality is reused and code bloat is minimized.

Core Features & Use Cases

  • Capability Index: Maintains a searchable index of existing functions and their purposes.
  • Proactive Checking: Guides AI to search for and reuse existing code before writing new implementations.
  • Use Case: When asked to implement a new date formatting function, the AI first consults the CODE_INDEX.md to find formatDate(), potentially extending it rather than creating a new, similar function.

Quick Start

Use the code deduplication skill to check if a function for validating email addresses already exists in the codebase.

Frequently Asked Questions about code-deduplication

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

FAQPage Schema
How do I prevent AI agents from writing duplicate code in my codebase?

To prevent AI agents from writing duplicate code, you can enforce a check-before-you-write policy using a capability index. This maintains a searchable record of existing functions, guiding the AI to reuse or extend current implementations rather than creating new ones.

What is the best way to maintain a capability index for code deduplication?

Maintaining a capability index for code deduplication involves documenting existing functions and their purposes in a structured file like CODE_INDEX.md. This allows AI agents to proactively search and find reusable code before writing new implementations.

How does semantic duplication prevention work during refactoring?

Semantic duplication prevention works by guiding AI agents to check a capability index for existing functionality before writing new code. It ensures that similar functions are extended rather than duplicated, reducing code bloat during refactoring.

Can I use vector database support for code deduplication in large codebases?

Yes, you can use optional vector database support for code deduplication in large codebases. Integrating vector databases helps manage and search extensive capability indexes more efficiently, ensuring proactive code reuse across complex projects.

How do I audit my codebase for redundant functions and code bloat?

You can audit your codebase for redundant functions and code bloat by using a structured documentation process. This involves maintaining a capability index that maps existing functions, enabling an audit to identify and eliminate semantic duplication.

Does code deduplication require any specific dependencies or frameworks?

Code deduplication does not require any specific dependencies or frameworks to function. It operates by maintaining a capability index and guiding AI agents, with optional vector database support available for large codebases.