domain-analysis by tech-leads-club/agent-skills
npx skills add https://github.com/tech-leads-club/agent-skills --skill domain-analysis此技能用于分析代码库,以识别子域(核心域、支撑子域、通用子域),并遵循领域驱动设计战略设计原则建议限界上下文。
在以下情况下应用此技能:
核心域:竞争优势,最高业务价值,需要最优秀的开发人员
支撑子域:必需但不具差异性,业务特定
通用子域:通用功能,可外包
一个明确的语言边界,在此边界内领域术语具有特定、无歧义的含义。
扫描代码库以查找业务概念(非基础设施):
@Entity、、领域模型广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
class*Service、*Manager、*Handler*UseCase、*Command、*Handler*Controller、*Resolver、API 端点对于每个概念,确定:
主要语言上下文
Subscription、Invoice、Payment → 计费语言Movie、Video、Episode → 内容语言User、Authentication → 身份语言语言边界
概念关系
一个子域具有:
常见领域模式:
对每个子域进行分类:
使用此决策树:
Is it a competitive advantage?
YES → Core Domain
NO → Does it require business-specific knowledge?
YES → Supporting Subdomain
NO → Generic Subdomain
高内聚性指标 ✅
低内聚性指标 ❌
内聚性评分公式:
Score = (
Linguistic Cohesion (0-3) + // 共享词汇
Usage Cohesion (0-3) + // 一起使用
Data Cohesion (0-2) + // 实体关系
Change Cohesion (0-2) // 一起变更
) / 10
8-10: High Cohesion ✅
5-7: Medium Cohesion ⚠️
0-4: Low Cohesion ❌
规则 1:语言不匹配
User(身份)和 Subscription(计费)规则 2:跨领域依赖
规则 3:混合职责
规则 4:核心域中的通用功能
规则 5:边界不清晰
对于每个识别出的子域,建议限界上下文:
限界上下文特征:
集成模式:
对于每个领域/子域:
## Domain: {Name}
**Type**: Core Domain | Supporting Subdomain | Generic Subdomain
**Ubiquitous Language**: {key business terms}
**Business Capability**: {what business problem it solves}
**Key Concepts**:
- {Concept} (Entity|Service|UseCase) - {brief description}
**Subdomains** (if applicable):
1. {Subdomain} (Core|Supporting|Generic)
- Concepts: {list}
- Cohesion: {score}/10
- Dependencies: → {other domains}
**Suggested Bounded Context**: {Name}Context
- Linguistic boundary: {where terms have specific meaning}
- Integration: {how it should integrate with other contexts}
**Dependencies**:
- → {OtherDomain} via {interface/API}
- ← {OtherDomain} via {interface/API}
**Cohesion Score**: {score}/10
## Cross-Domain Cohesion
| Domain A | Domain B | Cohesion | Issue | Recommendation |
| -------- | -------- | -------- | ------------------ | ----------------------- |
| Billing | Identity | 2/10 | ❌ Direct coupling | Use interface |
| Content | Billing | 6/10 | ⚠️ Usage tracking | Event-based integration |
## Issues Detected
### Priority: High
**Issue**: {description}
- **Location**: {file/class/method}
- **Problem**: {what's wrong}
- **Concepts**: {involved concepts}
- **Cohesion**: {score}/10
- **Recommendation**: {suggested fix}
### Priority: Medium
{similar format}
## Suggested Bounded Contexts
### {ContextName}Context
**Contains Subdomains**:
- {Subdomain1} (Core)
- {Subdomain2} (Supporting)
**Ubiquitous Language**:
- Term: Definition in this context
**Integration Requirements**:
- Consumes from: {OtherContext} via {pattern}
- Publishes to: {OtherContext} via {pattern}
**Implementation Notes**:
- Separate persistence
- Independent deployment
- Explicit API boundaries
对于每个概念:
对于每个领域:
对于内聚性分析:
Analyze business capability
└─ Is it competitive advantage?
├─ YES → Core Domain
└─ NO → Is it business-specific?
├─ YES → Supporting Subdomain
└─ NO → Generic Subdomain
Same vocabulary? → High linguistic cohesion
Used together? → High usage cohesion
Direct relationships? → High data cohesion
Change together? → High change cohesion
All high → Strong subdomain candidate
Mix of high/low → Review boundaries
All low → Likely wrong grouping
Clear boundary signs:
✅ Distinct Ubiquitous Language
✅ Concepts have unambiguous meaning
✅ Different meanings across contexts
✅ Clear integration points
Unclear boundary signs:
❌ Same terms with same meanings everywhere
❌ Concepts used identically across system
❌ No clear linguistic differences
❌ Tight coupling everywhere
大泥球
全包含模型
混合语言概念
良好的领域识别具有:
每周安装次数
73
仓库
GitHub 星标数
1.9K
首次出现
2026年2月7日
安全审计
安装于
opencode71
gemini-cli70
github-copilot70
codex70
kimi-cli68
amp67
This skill analyzes codebases to identify subdomains (Core, Supporting, Generic) and suggest bounded contexts following Domain-Driven Design Strategic Design principles.
Apply this skill when:
Core Domain : Competitive advantage, highest business value, requires best developers
Supporting Subdomain : Essential but not differentiating, business-specific
Generic Subdomain : Common functionality, could be outsourced
An explicit linguistic boundary where domain terms have specific, unambiguous meanings.
Scan codebase for business concepts (not infrastructure):
Entities (domain models with identity)
@Entity, class, domain modelsServices (business operations)
*Service, *Manager, *HandlerUse Cases (business workflows)
*UseCase, *Command, *HandlerFor each concept, determine:
Primary Language Context
Subscription, Invoice, Payment → Billing languageMovie, Video, Episode → Content languageUser, Authentication → Identity languageLinguistic Boundaries
Concept Relationships
A subdomain has:
Common Domain Patterns :
Classify Each Subdomain :
Use this decision tree:
Is it a competitive advantage?
YES → Core Domain
NO → Does it require business-specific knowledge?
YES → Supporting Subdomain
NO → Generic Subdomain
High Cohesion Indicators ✅
Low Cohesion Indicators ❌
Cohesion Score Formula :
Score = (
Linguistic Cohesion (0-3) + // Shared vocabulary
Usage Cohesion (0-3) + // Used together
Data Cohesion (0-2) + // Entity relationships
Change Cohesion (0-2) // Change together
) / 10
8-10: High Cohesion ✅
5-7: Medium Cohesion ⚠️
0-4: Low Cohesion ❌
Rule 1: Linguistic Mismatch
User (identity) + Subscription (billing) in same serviceRule 2: Cross-Domain Dependencies
Rule 3: Mixed Responsibilities
Rule 4: Generic in Core
Rule 5: Unclear Boundaries
For each subdomain identified, suggest bounded context:
Bounded Context Characteristics :
Integration Patterns :
For each domain/subdomain:
## Domain: {Name}
**Type**: Core Domain | Supporting Subdomain | Generic Subdomain
**Ubiquitous Language**: {key business terms}
**Business Capability**: {what business problem it solves}
**Key Concepts**:
- {Concept} (Entity|Service|UseCase) - {brief description}
**Subdomains** (if applicable):
1. {Subdomain} (Core|Supporting|Generic)
- Concepts: {list}
- Cohesion: {score}/10
- Dependencies: → {other domains}
**Suggested Bounded Context**: {Name}Context
- Linguistic boundary: {where terms have specific meaning}
- Integration: {how it should integrate with other contexts}
**Dependencies**:
- → {OtherDomain} via {interface/API}
- ← {OtherDomain} via {interface/API}
**Cohesion Score**: {score}/10
## Cross-Domain Cohesion
| Domain A | Domain B | Cohesion | Issue | Recommendation |
| -------- | -------- | -------- | ------------------ | ----------------------- |
| Billing | Identity | 2/10 | ❌ Direct coupling | Use interface |
| Content | Billing | 6/10 | ⚠️ Usage tracking | Event-based integration |
## Issues Detected
### Priority: High
**Issue**: {description}
- **Location**: {file/class/method}
- **Problem**: {what's wrong}
- **Concepts**: {involved concepts}
- **Cohesion**: {score}/10
- **Recommendation**: {suggested fix}
### Priority: Medium
{similar format}
## Suggested Bounded Contexts
### {ContextName}Context
**Contains Subdomains**:
- {Subdomain1} (Core)
- {Subdomain2} (Supporting)
**Ubiquitous Language**:
- Term: Definition in this context
**Integration Requirements**:
- Consumes from: {OtherContext} via {pattern}
- Publishes to: {OtherContext} via {pattern}
**Implementation Notes**:
- Separate persistence
- Independent deployment
- Explicit API boundaries
For Each Concept :
For Each Domain :
For Cohesion Analysis :
Analyze business capability
└─ Is it competitive advantage?
├─ YES → Core Domain
└─ NO → Is it business-specific?
├─ YES → Supporting Subdomain
└─ NO → Generic Subdomain
Same vocabulary? → High linguistic cohesion
Used together? → High usage cohesion
Direct relationships? → High data cohesion
Change together? → High change cohesion
All high → Strong subdomain candidate
Mix of high/low → Review boundaries
All low → Likely wrong grouping
Clear boundary signs:
✅ Distinct Ubiquitous Language
✅ Concepts have unambiguous meaning
✅ Different meanings across contexts
✅ Clear integration points
Unclear boundary signs:
❌ Same terms with same meanings everywhere
❌ Concepts used identically across system
❌ No clear linguistic differences
❌ Tight coupling everywhere
Big Ball of Mud
All-Inclusive Model
Mixed Linguistic Concepts
Good domain identification has:
Weekly Installs
73
Repository
GitHub Stars
1.9K
First Seen
Feb 7, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode71
gemini-cli70
github-copilot70
codex70
kimi-cli68
amp67
站立会议模板:敏捷开发每日站会指南与工具(含远程团队异步模板)
10,500 周安装
Intercom自动化指南:通过Rube MCP与Composio实现客户支持对话管理
69 周安装
二进制初步分析指南:使用ReVa工具快速识别恶意软件与逆向工程
69 周安装
PrivateInvestigator 道德人员查找工具 | 公开数据调查、反向搜索与背景研究
69 周安装
TorchTitan:PyTorch原生分布式大语言模型预训练平台,支持4D并行与H100 GPU加速
69 周安装
screenshot 截图技能:跨平台桌面截图工具,支持macOS/Linux权限管理与多模式捕获
69 周安装
tmux进程管理最佳实践:交互式Shell初始化、会话命名与生命周期管理
69 周安装
Controllers/Resolvers (entry points)
*Controller, *Resolver, API endpoints