code-deduplication

Prevents semantic code duplication using a capability index and check-before-write workflow.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill code-deduplication-dudqks0319-cpu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-deduplication
Source: https://github.com/dudqks0319-cpu/antigravity-skills/tree/main/code-deduplication
Command: npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill code-deduplication-dudqks0319-cpu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires chromadb, lancedb.

What problem does it solve? AI assistants and developers often reimplement functions that already exist, creating duplicate logic scattered across a codebase. This Skill prevents semantic duplication by maintaining a capability index so existing utilities are found and reused before new code is written. ## Core Features & Use Cases - Capability Index (CODE_INDEX.md): Maintains a project-root index organized by capability (dates, validation, API clients, hooks) listing each function's location, purpose, and parameters. - Check-Before-Write Workflow: Enforces a decision tree that searches the index and codebase before creating any new function, preferring extension of existing code over reimplementation. - Duplicate Audits: Provides an audit checklist and report format to detect overlapping utilities, inline validation logic, and similar components, with optional vector DB search (ChromaDB or LanceDB) for large codebases. - Use Case: Before adding a date-formatting helper, the assistant checks CODE_INDEX.md, finds formatRelative() in utils/dates.ts, and reuses or extends it instead of writing a fourth date formatter. ## Quick Start Ask the assistant to check the code index for existing functionality before writing any new utility function, and to update CODE_INDEX.md afterward.

Frequently Asked Questions about code-deduplication

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

FAQPage Schema
How do I prevent duplicate utility functions in a codebase?▼

Maintain a CODE_INDEX.md file organized by capability that lists each function's location, purpose, and parameters. Before writing any new function, search the index and codebase for similar functionality, then reuse or extend existing code instead of reimplementing it.

What is a code capability index and how is it structured?▼

A capability index is a Markdown file organized by what code does rather than where it lives. It groups functions into categories like Date/Time, Validation, and API Clients, with tables showing function name, file location with line number, plain-English purpose, and parameters.

When should I use a vector database for code search?▼

Use a vector database like ChromaDB or LanceDB when a codebase exceeds roughly 200 files and a Markdown index becomes hard to search. For under 50 files a Markdown index alone suffices, and 50-200 files work with an index plus periodic audits.

How do I audit a codebase for duplicate code?▼

Run a structured audit checking utility functions, API calls, validation logic, error handling, components, and hooks for overlap. Report findings by priority: high-priority items to merge immediately, medium-priority patterns to consolidate, and low-priority items to monitor.

What are the limitations of a Markdown-based code index?▼

A Markdown index requires manual or assisted updates after every code change and becomes unwieldy past a few hundred files. It also relies on keyword matching, so semantically similar functions with different naming may be missed without vector search.