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エージェントが、大きなアプリを独立したサービスに分割する手順の順番を、優先度とフェーズとともに計画できるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。