code-deduplication

Maintain a CODE_INDEX.md capability index to prevent semantic code duplication.

1|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/phonowell/mimikit --skill code-deduplication-phonowell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-deduplication
Source: https://github.com/phonowell/mimikit/tree/main/.agents/skills/code-deduplication
Command: npx skills add https://github.com/phonowell/mimikit --skill code-deduplication-phonowell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Precludes semantic code duplication and bloat by maintaining a central capability index that informs whether a new function should be created or an existing one extended.

Core Features & Use Cases

  • Maintain a centralized CODE_INDEX.md to track capabilities and encourage reuse
  • Enforce a check-before-write workflow to decide between reuse, extension, or new development
  • Update the index post-implementation to keep it current and auditable
  • Patterns and audits for deduplication to reduce technical debt

Quick Start

Consult CODE_INDEX.md before writing new code and update the index after implementing.

Frequently Asked Questions about code-deduplication

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

FAQPage Schema
How do I prevent semantic code duplication when writing new functions?

To prevent semantic code duplication, you can maintain a centralized capability index that informs whether a new function should be created or an existing one extended. This check-before-write workflow ensures code reuse and reduces bloat.

What is a code deduplication audit and how does an index help?

A code deduplication audit identifies overlapping capabilities to reduce technical debt. Maintaining a CODE_INDEX.md tracks existing functions, enforcing a workflow where developers consult the index before implementation to reuse or extend code.

How do I enforce a check-before-write workflow for refactoring code?

You enforce a check-before-write workflow by requiring developers to consult a CODE_INDEX.md before writing code. This index guides the decision to reuse, extend, or create new code, and must be updated post-implementation to stay auditable.

Does this code deduplication approach work for general software engineering tasks?

Yes, this deduplication approach is applicable to software engineering tasks involving writing or refactoring code. It focuses on deduplication checks, index updates, and post-write synchronization to maintain code hygiene across general development workflows.

What is the best way to maintain a capability index during software development?

The best way to maintain a capability index is to enforce explicit post-write synchronization. After implementing code, update the central CODE_INDEX.md to keep it current, ensuring future development can accurately check for reuse opportunities.

When should I extend an existing function instead of creating a new one?

You should extend an existing function instead of creating a new one when a centralized capability index indicates overlapping capabilities. Consulting this index before implementation precludes semantic code duplication and bloat.