Identifies subdomains and suggests bounded contexts in any codebase following DDD Strategic Design...
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, *HandlerControllers/Resolvers (entry points)
*Controller, *Resolver, API endpointsFor 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: