intent-based-dedup

Compare code block intents to prevent inappropriate deduplication during reviews.

24|1|Updated Sep 15, 2023
One-click install
npx skills add https://github.com/j5ik2o/event-store-adapter-js --skill intent-based-dedup-j5ik2o
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: intent-based-dedup
Source: https://github.com/j5ik2o/event-store-adapter-js/tree/main/.agents/skills/intent-based-dedup
Command: npx skills add https://github.com/j5ik2o/event-store-adapter-js --skill intent-based-dedup-j5ik2o

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify when code blocks sharing a surface have the same intent to prevent inappropriate deduplication and brittle shared implementations.

Core Features & Use Cases

  • Intent comparison: Assess whether two code snippets truly share the same purpose and business logic.
  • Refactoring guidance: Advise whether to extract a common function or maintain separate implementations based on intent.
  • Review assist: Provide rationale and guardrails for DRY decisions during code reviews and new feature work.
  • Language-agnostic applicability: Effective across multiple programming languages and domains.

Quick Start

Provide two code excerpts with their stated goals and ask it to decide whether they should be unified by intent.

Frequently Asked Questions about intent-based-dedup

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

FAQPage Schema
How do I decide whether to extract a common function during code refactoring?

During code refactoring, you decide whether to extract a common function by evaluating if the duplicated code blocks share the same intent and business logic, rather than just matching appearance. This prevents brittle shared implementations by documenting the rationale to guide team decisions.

What is intent-based code deduplication and how does it differ from standard DRY principles?

Intent-based code deduplication assesses whether code snippets sharing a surface truly serve the same purpose. Unlike standard DRY principles that focus on appearance, it aligns purpose and domain concepts to prevent inappropriate deduplication.

How do I review a DRY proposal during code reviews without creating brittle implementations?

To review a DRY proposal during code reviews, compare the stated goals and domain concepts of the code snippets. Provide rationale and guardrails for commonization decisions to avoid creating brittle shared implementations.

Is intent-based code deduplication language-agnostic for evaluating new feature implementations?

Yes, intent-based code deduplication is language-agnostic. It evaluates purpose alignment and names and domain concepts across multiple programming languages and domains when assessing duplication requests during new feature implementations.

When should I not unify code blocks that look the same?

You should not unify code blocks that look the same when they lack the same intent or purpose alignment. If their underlying business logic or domain concepts differ, maintaining separate implementations prevents inappropriate deduplication.