domain-identification-grouping
它能做什么
这个技能让 AI 把现有代码库的组件整理到合理的业务领域中。适合计划把服务化设计落地、并想知道哪些部分应放在一起的架构师和开发者。
适用场景
- ✓当你想知道应用中的哪些组件应该放在一起时。
- ✓当你计划把现有应用转变为独立的领域服务时。
- ✓当文件夹或命名空间的结构与业务领域不一致,并且你希望对齐它们时。
技能链接
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/domain-identification-grouping/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我们代码库中的组件归入业务领域,让我看到哪些组件应该放在一起。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会审阅每个组件的功能以及组件之间的连接,把每个组件分配到一个业务领域,并建议相应的文件夹调整。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Domain Identification and Grouping
This skill groups architectural components into logical domains (business areas) to prepare for creating domain services in a service-based architecture.
How to Use
Quick Start
Request analysis of your codebase:
- "Group components into logical domains"
- "Identify component domains for service-based architecture"
- "Create domain groupings from components"
- "Analyze which components belong to which domains"
Usage Examples
Example 1: Domain Identification
User: "Group components into logical domains"
The skill will:
1. Analyze component responsibilities and relationships
2. Identify business domains based on functionality
3. Group components into domains
4. Create domain diagrams
5. Suggest namespace refactoring for domain alignment
Example 2: Domain Analysis
User: "Which domain should the billing components belong to?"
The skill will:
1. Analyze billing component functionality
2. Check relationships with other components
3. Identify appropriate domain (e.g., Customer or Financial)
4. Recommend domain assignment
Example 3: Domain Refactoring
User: "What namespace refactoring is needed to align components with domains?"
The skill will:
1. Compare current component namespaces to identified domains
2. Identify misaligned components
3. Suggest namespace changes
4. Create refactoring plan
Step-by-Step Process
- Identify Domains: Analyze business capabilities and component relationships
- Group Components: Assign components to appropriate domains
- Validate Groupings: Ensure components fit well in their domains
- Refactor Namespaces: Align component namespaces with domains
- Create Domain Map: Visualize domain structure and component groupings
When to Use
Apply this skill when:
- After identifying, sizing, and analyzing component dependencies
- Before creating domain services (Pattern 6)
- When planning service-based architecture migration
- Analyzing component relationships and business alignment
- Preparing for domain-driven design implementation
- Grouping components for better organization
Core Concepts
Domain Definition
A domain is a logical grouping of components that:
- Represents a distinct business capability or area
- Contains related components that work together
- Has clear boundaries and responsibilities
- Can become a domain service in service-based architecture
Examples:
- Customer Domain: Customer profile, billing, support contracts
- Ticketing Domain: Ticket creation, assignment, routing, completion
- Reporting Domain: Ticket reports, expert reports, financial reports
Component Domain Relationship
One-to-Many: A single domain contains multiple components
Domain: Customer
├── Component: Customer Profile
├── Component: Billing Payment
├── Component: Billing History
└── Component: Support Contract
Domain Manifestation
Domains are physically manifested through namespace structure:
Before Domain Alignment:
services/billing/payment
services/billing/history
services/customer/profile
services/supportcontract
After Domain Alignment:
services/customer/billing/payment
services/customer/billing/history
services/customer/profile
services/customer/supportcontract
Notice how all customer-related functionality is grouped under .customer domain.
Analysis Process
Phase 1: Identify Business Domains
Analyze the codebase to identify distinct business domains:
Examine Component Responsibilities
- Read component names and descriptions
- Understand what each component does
- Identify business capabilities
Look for Business Language
- Group components by business vocabulary
- Example: "billing", "payment", "invoice" → Financial domain
- Example: "customer", "profile", "contract" → Customer domain
Identify Domain Boundaries
- Where do business concepts change?
- What are the distinct business areas?
- How do components relate to business capabilities?
Collaborate with Business Stakeholders
- Validate domain identification with product owners
- Ensure domains align with business understanding
- Get feedback on domain boundaries
Example Domain Identification:
## Identified Domains
1. **Ticketing Domain** (ss.ticket)
- Ticket creation, assignment, routing, completion
- Customer surveys
- K
常见问题
它会从零开始发现新的领域吗?
不会。从头识别新领域是另一个单独的技能。
它会分析各部分之间的耦合吗?
不会。耦合分析由它自己的技能负责。
它会建议命名空间的修改吗?
会。它可以提出文件夹和命名空间的调整,让代码与领域保持一致。
详情
作者的原始描述
Groups existing components into logical business domains to plan service-based architecture. Use when asking "which components belong together?", "group these into services", "organize by domain", "component-to-domain mapping", or planning service extraction from an existing codebase. Do NOT use for identifying new domains from scratch (use domain-analysis) or analyzing coupling (use coupling-analysis).
热度
- GitHub 星标
- 7.1k
- 排名
- #13505
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
component-common-domain-detection
7.1k帮你的智能体找出代码库中多个部分重复的业务逻辑,并建议如何合并。
component-flattening-analysis
7.1k帮你的智能体找出位置不当的代码,并整理杂乱的组件文件夹结构,让每个部分都放在应在的位置。
component-identification-sizing
7.1k帮你的智能体梳理代码库的各个组成部分并测量其规模,以找出应首先拆分的模块。
coupling-analysis
7.1k帮你的智能体检查代码库各部分之间的依赖有多紧密,并找出应优先放松的连接。