component-common-domain-detection
Что он делает
Этот скилл заставляет ИИ просканировать кодовую базу на одинаковые бизнес-правила, повторённые в разных компонентах, и предложить, где их объединить. Он нужен разработчикам, которые планируют рефакторинг и хотят меньше дублирующейся логики.
Когда использовать
- ✓Когда вы спрашиваете, где одна и та же бизнес-логика повторяется в сервисах или модулях.
- ✓Когда вы планируете рефакторинг и хотите знать, что можно объединить.
- ✓Когда вы хотите увидеть, какие классы используются сразу в нескольких компонентах.
Ссылка на скилл
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/component-common-domain-detection/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Найди бизнес-логику, которая дублируется между нашими сервисами, и предложи, что стоит объединить в первую очередь.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
ИИ сопоставляет компоненты, ищет общие классы и похожие правила, оценивает эффект связанности при слиянии и предлагает подход к объединению.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Common Domain Component Detection
This skill identifies common domain functionality that is duplicated across multiple components and suggests consolidation opportunities to reduce duplication and improve maintainability.
How to Use
Quick Start
Request analysis of your codebase:
- "Find common domain functionality across components"
- "Identify duplicate domain logic that should be consolidated"
- "Detect shared classes used across multiple components"
- "Analyze consolidation opportunities for common components"
Usage Examples
Example 1: Find Common Functionality
User: "Find common domain functionality across components"
The skill will:
1. Scan component namespaces for common patterns
2. Detect shared classes used across components
3. Identify duplicate domain logic
4. Analyze coupling impact of consolidation
5. Suggest consolidation opportunities
Example 2: Detect Duplicate Notification Logic
User: "Are there multiple notification components that should be consolidated?"
The skill will:
1. Find all components with notification-related names
2. Analyze their functionality and dependencies
3. Calculate coupling impact if consolidated
4. Recommend consolidation approach
Example 3: Analyze Shared Classes
User: "Find classes that are shared across multiple components"
The skill will:
1. Identify classes imported/used by multiple components
2. Classify as domain vs infrastructure functionality
3. Suggest consolidation or shared library approach
4. Assess impact on coupling
Step-by-Step Process
- Scan Components: Identify components with common namespace patterns
- Detect Shared Code: Find classes/files used across components
- Analyze Functionality: Determine if functionality is truly common
- Assess Coupling: Calculate coupling impact before consolidation
- Recommend Actions: Suggest consolidation or shared library approach
When to Use
Apply this skill when:
- After identifying and sizing components (Pattern 1)
- Before flattening components (Pattern 3)
- When planning to reduce code duplication
- Analyzing shared domain logic across the codebase
- Preparing for component consolidation
- Identifying candidates for shared services or libraries
Core Concepts
Domain vs Infrastructure Functionality
Domain Functionality (candidates for consolidation):
- Business processing logic (notification, validation, auditing, formatting)
- Common to some processes, not all
- Examples: Customer notification, ticket auditing, data validation
Infrastructure Functionality (usually not consolidated here):
- Operational concerns (logging, metrics, security)
- Common to all processes
- Examples: Logging, authentication, database connections
Common Domain Patterns
Common domain functionality often appears as:
Namespace Patterns: Components ending in same leaf node
*.notification,*.audit,*.validation,*.formatting- Example:
TicketNotification,BillingNotification,SurveyNotification
Shared Classes: Same class used across multiple components
- Example:
SMTPConnectionused by 5 different components - Example:
AuditLoggerused by multiple domain components
- Example:
Similar Functionality: Different components doing similar things
- Example: Multiple components sending emails with slight variations
- Example: Multiple components writing audit logs
Consolidation Approaches
Shared Service:
- Common functionality becomes a separate service
- Other components call this service
- Good for: Frequently changing logic, complex operations
Shared Library:
- Common code packaged as library (JAR, DLL, npm package)
- Components import and use the library
- Good for: Stable functionality, simple utilities
Component Consolidation:
- Merge multiple components into one
- Good for: Highly related functionality, low coupling impact
Analysis Process
Phase 1: Identify Common Namespace Patterns
Scan component namespaces for common leaf node names:
Extract leaf nodes from all component namespaces
- Example:
services/billing/notification→notification - Example:
services/ticket/notification→notification
- Example:
Group by common leaf nodes
- Find components with same leaf node name
- Example: All components ending in
.notification
Filter out infrastructure patterns
- Exclude:
.util,.helper,
- Exclude:
Частые вопросы
Находит ли он скопированные строки кода?
Нет. Для этого лучше подходят линтеры. Этот скилл смотрит на общую бизнес-логику между компонентами.
Меняет ли он мой код?
Его задача — анализировать и предлагать объединение, а не вносить изменения самому.
Это для проверки зависимостей?
Нет. Проверки зависимостей выполняет отдельный скилл анализа связанности.
Подробности
Оригинальное описание автора
Finds duplicate business logic spread across multiple components and suggests consolidation. Use when asking "where is this logic duplicated?", "find common code between services", "what can be consolidated?", "detect shared domain logic", or analyzing component overlap before refactoring. Do NOT use for code-level duplication detection (use linters) or dependency analysis (use coupling-analysis).
Популярность
- Звёзды на GitHub
- 7.1k
- Место в рейтинге
- #13499
- Лицензия
- —
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
component-flattening-analysis
7.1kПомогает агенту найти код, стоящий не на своём месте, и выровнять запутанную структуру папок компонентов, чтобы каждая часть находилась на месте.
component-identification-sizing
7.1kПомогает агенту описать части кодовой базы и измерить их размер, чтобы найти, какой модуль стоит разделить первым.
coupling-analysis
7.1kПомогает агенту проверить, насколько тесно части кодовой базы зависят друг от друга, и какие связи стоит ослабить в первую очередь.
decomposition-planning-roadmap
7.1kПомогает агенту спланировать пошаговый порядок разбиения большого приложения на отдельные сервисы с приоритетами и этапами.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.