component-common-domain-detection
하는 일
이 스킬은 AI가 서로 다른 컴포넌트에 반복된 같은 비즈니스 규칙을 코드베이스에서 찾고, 어디로 모을지 제안하게 합니다. 리팩터링을 계획하면서 중복 로직을 줄이고 싶은 개발자를 위한 것입니다.
사용하는 경우
- ✓서비스나 모듈 여러 곳에 같은 비즈니스 로직이 반복되는지 물을 때.
- ✓리팩터링을 계획하면서 무엇을 합칠 수 있는지 알고 싶을 때.
- ✓여러 컴포넌트가 공유하는 클래스가 무엇인지 보고 싶을 때.
스킬 링크
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/component-common-domain-detection/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리 서비스 전체에서 중복된 비즈니스 로직을 찾고, 무엇을 먼저 합치면 좋을지 제안해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 컴포넌트를 정리하고, 공유 클래스와 비슷한 규칙을 찾고, 그것들을 합쳤을 때 결합에 미칠 영향을 추정한 뒤, 통합 방법을 제안합니다.
기술 내용 (원본 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
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
component-flattening-analysis
7.1k에이전트가 잘못 놓인 코드를 찾고, 복잡한 컴포넌트 폴더 구조를 평평하게 정리해 각 조각이 제자리에 있도록 돕습니다.
component-identification-sizing
7.1k에이전트가 코드베이스의 부품을 파악하고 크기를 재어, 먼저 나눠야 할 모듈을 찾도록 돕습니다.
coupling-analysis
7.1k에이전트가 코드베이스의 부분들이 서로 얼마나 단단히 묶여 있는지 확인하고, 먼저 느슨하게 만들 연결을 알려 주도록 돕습니다.
decomposition-planning-roadmap
7.1k에이전트가 큰 앱을 별도 서비스로 나누는 단계별 순서를 우선순위와 단계와 함께 계획하도록 돕습니다.