domain-analysis
Skill này làm gì
Skill này để AI xác định các lĩnh vực nghiệp vụ chính của codebase, gắn nhãn chúng là cốt lõi, hỗ trợ hoặc chung, và gợi ý các bounded context. Phù hợp với lập trình viên và kiến trúc sư muốn ranh giới service khớp với nghiệp vụ.
Khi nào nên dùng
- ✓Khi bạn muốn biết có những lĩnh vực nghiệp vụ nào trong codebase.
- ✓Khi bạn cần quyết định nơi vẽ ranh giới giữa các service.
- ✓Khi bạn muốn kiểm tra xem các phần của hệ thống có khớp với các lĩnh vực nghiệp vụ không.
Liên kết skill
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/domain-analysis/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Các lĩnh vực nghiệp vụ chính trong codebase của chúng tôi là gì, và ranh giới service nên đặt ở đâu?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI đọc mã để tìm ngôn ngữ và quy tắc nghiệp vụ, nhóm chúng thành các lĩnh vực con, rồi gợi ý các bounded context nơi mỗi thuật ngữ có một nghĩa rõ ràng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Subdomain Identification & Bounded Context Analysis
This skill analyzes codebases to identify subdomains (Core, Supporting, Generic) and suggest bounded contexts following Domain-Driven Design Strategic Design principles.
When to Use
Apply this skill when:
- Analyzing domain boundaries in any codebase
- Identifying Core, Supporting, and Generic subdomains
- Mapping bounded contexts from problem space to solution space
- Assessing domain cohesion and detecting coupling issues
- Planning domain-driven refactoring
- Understanding business capabilities in code
Core Principles
Subdomain Classification
Core Domain: Competitive advantage, highest business value, requires best developers
- Indicators: Complex business logic, frequent changes, domain experts needed
Supporting Subdomain: Essential but not differentiating, business-specific
- Indicators: Supports Core Domain, moderate complexity, business-specific rules
Generic Subdomain: Common functionality, could be outsourced
- Indicators: Well-understood problem, low differentiation, standard functionality
Bounded Context
An explicit linguistic boundary where domain terms have specific, unambiguous meanings.
- Primary nature: Linguistic boundary, not technical
- Key rule: Inside boundary, all Ubiquitous Language terms are unambiguous
- Goal: Align 1 subdomain to 1 bounded context (ideal)
Analysis Process
Phase 1: Extract Concepts
Scan codebase for business concepts (not infrastructure):
Entities (domain models with identity)
- Patterns:
@Entity,class, domain models - Focus: Business concepts, not technical classes
- Patterns:
Services (business operations)
- Patterns:
*Service,*Manager,*Handler - Focus: Business logic, not technical utilities
- Patterns:
Use Cases (business workflows)
- Patterns:
*UseCase,*Command,*Handler - Focus: Business processes, not CRUD
- Patterns:
Controllers/Resolvers (entry points)
- Patterns:
*Controller,*Resolver, API endpoints - Focus: Business capabilities, not technical routes
- Patterns:
Phase 2: Group by Ubiquitous Language
For each concept, determine:
Primary Language Context
- What business vocabulary does this belong to?
- Examples:
Subscription,Invoice,Payment→ Billing languageMovie,Video,Episode→ Content languageUser,Authentication→ Identity language
Linguistic Boundaries
- Where do term meanings change?
- Same term, different meaning = different bounded context
- Example: "Customer" in Sales vs "Customer" in Support
Concept Relationships
- Which concepts naturally belong together?
- Which share business vocabulary?
- Which reference each other?
Phase 3: Identify Subdomains
A subdomain has:
- Distinct business capability
- Independent business value
- Unique vocabulary
- Multiple related entities working together
- Cohesive set of business operations
Common Domain Patterns:
- Billing/Subscription: Payments, invoices, plans
- Content/Catalog: Media, products, inventory
- Identity/Access: Users, authentication, authorization
- Analytics: Metrics, dashboards, insights
- Notifications: Messages, alerts, communications
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
Phase 4: Assess Cohesion
High Cohesion Indicators ✅
- Concepts share Ubiquitous Language
- Concepts frequently used together
- Direct business relationships
- Changes to one affect others in group
- Solve same business problem
Low Cohesion Indicators ❌
- Different business vocabularies mixed
- Concepts rarely used together
- No direct business relationship
- Changes don't affect others
- Solve different business problems
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 ❌
Phase 5: Detect Low Cohesion Issues
Rule 1: Linguistic Mismatch
- Problem: Different business vocabularies mixed
- Example:
User(identity) +Subscription(billing) in same service - Action: Suggest separation into different bounded contexts
**Rule 2: Cross-
Câu hỏi thường gặp
Bounded context là gì?
Đó là một vùng của hệ thống mà mỗi thuật ngữ nghiệp vụ chỉ có một nghĩa rõ ràng.
Nó có nhóm các component hiện có không?
Không. Việc nhóm các component hiện có thành lĩnh vực là một skill riêng.
Lĩnh vực cốt lõi, hỗ trợ và chung là gì?
Lĩnh vực cốt lõi tạo lợi thế cạnh tranh, lĩnh vực hỗ trợ giúp phần cốt lõi, còn lĩnh vực chung thì phổ biến và có thể thuê ngoài.
Chi tiết
Mô tả gốc của tác giả
Maps business domains and suggests service boundaries in any codebase using DDD Strategic Design. Use when asking "what are the domains in this codebase?", "where should I draw service boundaries?", "identify bounded contexts", "classify subdomains", "DDD analysis", or analyzing domain cohesion. Do NOT use for grouping existing components into domains (use domain-identification-grouping) or dependency analysis (use coupling-analysis).
Độ phổ biến
- Sao GitHub
- 7.1k
- Vị trí xếp hạng
- #13504
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
component-common-domain-detection
7.1kGiúp agent của bạn tìm logic nghiệp vụ bị lặp lại ở nhiều phần của codebase và gợi ý cách gộp nó lại.
component-flattening-analysis
7.1kGiúp agent của bạn tìm mã nằm sai chỗ và làm phẳng các cấu trúc thư mục component lộn xộn, để mỗi phần nằm đúng vị trí.
component-identification-sizing
7.1kGiúp agent của bạn lập bản đồ các phần của codebase và đo kích thước của chúng, để tìm module nên tách trước.
coupling-analysis
7.1kGiúp agent của bạn kiểm tra mức độ phụ thuộc chặt chẽ giữa các phần của codebase, và nên nới lỏng những kết nối nào trước.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.