component-common-domain-detection
यह क्या करती है
यह स्किल AI से कोडबेस खंगलवाती है, ताकि एक ही बिज़नेस नियम अलग-अलग कंपोनेंट में दोहराए जाने की जगहें मिलें, फिर बताती है कि उन्हें कहाँ समेकित करना चाहिए। यह रिफ़ैक्टर की योजना बनाने वाले डेवलपर्स के लिए है जिन्हें कम दोहराया गया लॉजिक चाहिए।
कब इस्तेमाल करें
- ✓जब आप पूछते हैं कि एक ही बिज़नेस लॉजिक सर्विसेज़ या मॉड्यूल में कहाँ दोहराया गया है।
- ✓जब आप रिफ़ैक्टर की योजना बना रहे हैं और जानना चाहते हैं कि क्या मिलाया जा सकता है।
- ✓जब आप देखना चाहते हैं कि कौन सी क्लासें कई कंपोनेंट में साझा हो रही हैं।
Skill का लिंक
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 में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारी सर्विसेज़ में दोहराया गया बिज़नेस लॉजिक खोजिए और सुझाइए कि पहले क्या मिलाना चाहिए।”
हर हफ़्ते 5 नई skills, 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:
अक्सर पूछे जाने वाले सवाल
क्या यह कॉपी किए गए कोड की लाइनें ढूँढता है?
नहीं। इसके लिए linter बेहतर हैं। यह स्किल कंपोनेंट्स के बीच साझा बिज़नेस लॉजिक देखती है।
क्या यह मेरा कोड बदलता है?
इसका काम विश्लेषण करना और समेकन सुझाना है, खुद बदलाव करना नहीं।
क्या यह डिपेंडेंसी जाँच के लिए है?
नहीं। डिपेंडेंसी जाँच एक अलग coupling analysis स्किल करती है।
जानकारी
लेखक का मूल विवरण
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
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
component-flattening-analysis
7.1kयह आपके एजेंट को गलत जगह रखा गया कोड ढूँढने और उलझे हुए कंपोनेंट फ़ोल्डर ढाँचे को सीधा करने में मदद करती है, ताकि हर चीज़ अपनी सही जगह रहे।
component-identification-sizing
7.1kयह आपके एजेंट को कोडबेस के हिस्सों का नक्शा बनाने और उनका आकार मापने में मदद करती है, ताकि पता चले कि पहले किस मॉड्यूल को तोड़ना है।
coupling-analysis
7.1kयह आपके एजेंट को जाँचने में मदद करती है कि कोडबेस के हिस्से एक-दूसरे पर कितनी कसकर निर्भर हैं, और पहले कौन से जोड़ ढीले करने चाहिए।
decomposition-planning-roadmap
7.1kयह आपके एजेंट को बड़े ऐप को अलग सर्विसेज़ में तोड़ने के चरण-दर-चरण क्रम की योजना बनाने में मदद करती है, प्राथमिकताओं और चरणों के साथ।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।