Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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).
.claude/skills/tech-leads-club-domain-identification-grouping/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 118% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 245% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 291% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 206% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 197% | 0% |
This skill groups architectural components into logical domains (business areas) to prepare for creating domain services in a service-based architecture.
Request analysis of your codebase:
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 alignmentExample 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 assignmentExample 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 planApply this skill when:
A domain is a logical grouping of components that:
Examples:
One-to-Many: A single domain contains multiple components
Domain: Customer
├── Component: Customer Profile
├── Component: Billing Payment
├── Component: Billing History
└── Component: Support ContractDomains are physically manifested through namespace structure:
Before Domain Alignment:
services/billing/payment
services/billing/history
services/customer/profile
services/supportcontractAfter Domain Alignment:
services/customer/billing/payment
services/customer/billing/history
services/customer/profile
services/customer/supportcontractNotice how all customer-related functionality is grouped under .customer domain.
Analyze the codebase to identify distinct business domains:
Example Domain Identification:
markdown## Identified Domains 1. **Ticketing Domain** (ss.ticket) - Ticket creation, assignment, routing, completion - Customer surveys - Knowledge base 2. **Customer Domain** (ss.customer) - Customer profile - Billing and payment - Support contracts 3. **Reporting Domain** (ss.reporting) - Ticket reports - Expert reports - Financial reports 4. **Admin Domain** (ss.admin) - User maintenance - Expert profile management 5. **Shared Domain** (ss.shared) - Login - Notification
Assign each component to an appropriate domain:
Example Component Grouping:
markdown## Component Domain Assignment ### Ticketing Domain (ss.ticket) - Ticket Shared (ss.ticket.shared) - Ticket Maintenance (ss.ticket.maintenance) - Ticket Completion (ss.ticket.completion) - Ticket Assign (ss.ticket.assign) - Ticket Route (ss.ticket.route) - KB Maintenance (ss.ticket.kb.maintenance) - KB Search (ss.ticket.kb.search) - Survey (ss.ticket.survey) ### Customer Domain (ss.customer) - Customer Profile (ss.customer.profile) - Billing Payment (ss.customer.billing.payment) - Billing History (ss.customer.billing.history) - Support Contract (ss.customer.supportcontract) ### Reporting Domain (ss.reporting) - Reporting Shared (ss.reporting.shared) - Ticket Reports (ss.reporting.tickets) - Expert Reports (ss.reporting.experts) - Financial Reports (ss.reporting.financial)
Ensure components fit well in their assigned domains:
Validation Checklist:
Align component namespaces with identified domains:
services/billing/paymentservices/customer/billing/payment.customer domain nodeExample Namespace Refactoring:
markdown## Namespace Refactoring Plan ### Customer Domain Alignment | Component | Current Namespace | Target Namespace | Action | | ---------------- | ------------------- | --------------------------- | ------------- | | Billing Payment | ss.billing.payment | ss.customer.billing.payment | Add .customer | | Billing History | ss.billing.history | ss.customer.billing.history | Add .customer | | Customer Profile | ss.customer.profile | ss.customer.profile | No change | | Support Contract | ss.supportcontract | ss.customer.supportcontract | Add .customer | ### Ticketing Domain Alignment | Component | Current Namespace | Target Namespace | Action | | -------------- | ----------------- | ------------------------ | ----------- | | KB Maintenance | ss.kb.maintenance | ss.ticket.kb.maintenance | Add .ticket | | KB Search | ss.kb.search | ss.ticket.kb.search | Add .ticket | | Survey | ss.survey | ss.ticket.survey | Add .ticket |
Visualize domain structure and component groupings:
Example Domain Map:
markdown## Domain Map
┌─────────────────────────────────────┐ │ Ticketing Domain (ss.ticket) │ ├─────────────────────────────────────┤ │ • Ticket Shared │ │ • Ticket Maintenance │ │ • Ticket Completion │ │ • Ticket Assign │ │ • Ticket Route │ │ • KB Maintenance │ │ • KB Search │ │ • Survey │ └─────────────────────────────────────┘ │ │ uses ▼ ┌─────────────────────────────────────┐ │ Customer Domain (ss.customer) │ ├─────────────────────────────────────┤ │ • Customer Profile │ │ • Billing Payment │ │ • Billing History │ │ • Support Contract │ └─────────────────────────────────────┘
`## Output Format ### Domain Identification Report
Business Capability: Manages customer relationships, billing, and support contracts
Components:
Component Count: 4 Total Size: ~15,000 statements (18% of codebase)
Domain Cohesion: ✅ High
Boundaries:
`### Component Domain Assignment Table
| Component | Current Namespace | Assigned Domain | Target Namespace | | ------------------ | --------------------- | --------------- | --------------------------------- | | Customer Profile | ss.customer.profile | Customer | ss.customer.profile (no change) | | Billing Payment | ss.billing.payment | Customer | ss.customer.billing.payment | | Ticket Maintenance | ss.ticket.maintenance | Ticketing | ss.ticket.maintenance (no change) | | KB Maintenance | ss.kb.maintenance | Ticketing | ss.ticket.kb.maintenance | | Reporting Shared | ss.reporting.shared | Reporting | ss.reporting.shared (no change) |
### Namespace Refactoring Plan
Customer Domain Alignment
Components to Refactor:
ss.billing.payment → ss.customer.billing.paymentss.billing.history → ss.customer.billing.historyss.supportcontract → ss.customer.supportcontractSteps:
Expected Impact:
.customer domain
### Domain Map Visualization
Customer Domain (ss.customer)
├── Customer Profile
├── Billing Payment
├── Billing History
└── Support Contract
Ticketing Domain (ss.ticket)
├── Ticket Shared
├── Ticket Maintenance
├── Ticket Completion
├── Ticket Assign
├── Ticket Route
├── KB Maintenance
├── KB Search
└── Survey
Reporting Domain (ss.reporting)
├── Reporting Shared
├── Ticket Reports
├── Expert Reports
└── Financial Reports
Admin Domain (ss.admin)
├── User Maintenance
└── Expert Profile
Shared Domain (ss.shared)
├── Login
└── Notification
Ticketing Domain
│ uses
├─→ Shared Domain (Login, Notification)
└─→ Customer Domain (Customer Profile)
Customer Domain
│ uses
└─→ Shared Domain (Login, Notification)
Reporting Domain
│ uses
├─→ Ticketing Domain (Ticket data)
├─→ Customer Domain (Customer data)
└─→ Shared Domain (Login)
## Analysis Checklist
**Domain Identification**:
- [ ] Analyzed component responsibilities
- [ ] Identified business capabilities
- [ ] Identified distinct business domains
- [ ] Validated domains with stakeholders
**Component Grouping**:
- [ ] Assigned each component to a domain
- [ ] Analyzed component relationships
- [ ] Ensured components fit domain vocabulary
- [ ] Handled edge cases (shared components, unclear assignments)
**Domain Validation**:
- [ ] Checked cohesion within domains
- [ ] Verified domain boundaries are clear
- [ ] Ensured all components assigned
- [ ] Validated with stakeholders
**Namespace Refactoring**:
- [ ] Compared current vs target namespaces
- [ ] Identified components needing refactoring
- [ ] Created refactoring plan
- [ ] Prioritized refactoring work
**Domain Mapping**:
- [ ] Created domain diagram
- [ ] Documented domain structure
- [ ] Created domain inventory table
- [ ] Documented domain relationships
## Implementation Notes
### For Node.js/Express Applications
Domains typically organized in `services/` directory:
services/ ├── customer/ ← Customer Domain │ ├── profile/ │ ├── billing/ │ │ ├── payment/ │ │ └── history/ │ └── supportcontract/ ├── ticket/ ← Ticketing Domain │ ├── shared/ │ ├── maintenance/ │ ├── assign/ │ └── route/ └── reporting/ ← Reporting Domain ├── shared/ ├── tickets/ └── experts/
### For Java Applications
Domains identified by package structure:
com.company.customer ← Customer Domain ├── profile ├── billing │ ├── payment │ └── history └── supportcontract
com.company.ticket ← Ticketing Domain ├── shared ├── maintenance ├── assign └── route
### Domain Identification Strategies
**Strategy 1: Business Capability Analysis**
- Identify what business capabilities the system provides
- Group components by capability
- Example: "Customer Management" capability → Customer Domain
**Strategy 2: Vocabulary Analysis**
- Identify business vocabulary used by components
- Group components sharing same vocabulary
- Example: Components using "billing", "payment", "invoice" → Financial Domain
**Strategy 3: Relationship Analysis**
- Identify components frequently used together
- Group components with strong relationships
- Example: Components that share data/workflows → Same Domain
**Strategy 4: Stakeholder Collaboration**
- Work with product owners/business analysts
- Use their understanding of business areas
- Validate domain boundaries with them
## Fitness Functions
After creating domains, create automated checks:
### Domain Namespace Governance
// Ensure components belong to correct domain function validateDomainNamespaces(components, domainRules) { const violations = ]
components.forEach((comp) => { const domain = identifyDomain(comp.namespace) const expectedDomain = domainRulescomp.name]
if (domain !== expectedDomain) { violations.push({ component: comp.name, currentDomain: domain, expectedDomain: expectedDomain, namespace: comp.namespace, }) } })
return violations }
### Domain Boundary Enforcement
// Prevent components from accessing other domains directly function enforceDomainBoundaries(components) { const violations = ]
components.forEach((comp) => { comp.imports.forEach((imp) => { const importedDomain = identifyDomain(imp) const componentDomain = identifyDomain(comp.namespace)
if (importedDomain !== componentDomain && importedDomain !== 'shared') { violations.push({ component: comp.name, domain: componentDomain, importsFrom: imp, importedDomain: importedDomain, issue: 'Cross-domain direct dependency', }) } }) })
return violations }
## Best Practices
### Do's ✅
- Collaborate with business stakeholders to identify domains
- Group components by business capability, not technical layers
- Ensure domains represent distinct business areas
- Validate domain boundaries with stakeholders
- Refactor namespaces to align with domains
- Create clear domain documentation
- Use business language in domain names
### Don'ts ❌
- Don't create domains based on technical layers (services, controllers, models)
- Don't force components into domains where they don't fit
- Don't skip stakeholder validation
- Don't create too many small domains (aim for 3-7 domains)
- Don't create domains that are too large (monolithic domains)
- Don't ignore components that don't fit (analyze why)
- Don't skip namespace refactoring (critical for clarity)
## Common Domain Patterns
### Typical Domains in Business Applications
- **Customer Domain**: Customer management, profiles, relationships
- **Product Domain**: Product catalog, inventory, pricing
- **Order Domain**: Order processing, fulfillment, shipping
- **Billing Domain**: Invoicing, payments, financial transactions
- **Reporting Domain**: Reports, analytics, dashboards
- **Admin Domain**: User management, system configuration
- **Shared Domain**: Common functionality (login, notification, utilities)
### Domain Size Guidelines
- **Small Domain**: 2-4 components
- **Medium Domain**: 5-8 components
- **Large Domain**: 9-15 components
- **Too Large**: >15 components (consider splitting)
## Next Steps
After creating component domains:
1. **Apply Create Domain Services Pattern** - Extract domains to separate services
2. **Plan Service Extraction** - Create migration plan for domain services
3. **Implement Domain Services** - Move domains to separately deployed services
4. **Monitor Domain Boundaries** - Use fitness functions to enforce boundaries
## Notes
- Domains should represent business capabilities, not technical layers
- Domain identification requires collaboration with business stakeholders
- Namespace refactoring is critical for domain clarity
- Domains prepare the codebase for service-based architecture
- Well-formed domains make service extraction easier
- Domain boundaries should be clear and well-documented| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 13,665 | 14,483 | +6% | 1 | 1 | 0% | 2,095 | 6,907 | +230% | 0 | 0 | — |
case-01 | fail→fail | 16,689 | 13,718 | -18% | 1 | 1 | 0% | 3,110 | 6,985 | +125% | 0 | 0 | — |
case-02 | fail→pass | 18,462 | 17,087 | -7% | 1 | 1 | 0% | 3,390 | 7,386 | +118% | 0 | 0 | — |
case-03 | fail→fail | 16,283 | 12,158 | -25% | 1 | 1 | 0% | 2,516 | 6,368 | +153% | 0 | 0 | — |
case-04 | fail→fail | 9,135 | 30,333 | +232% | 1 | 1 | 0% | 1,639 | 5,896 | +260% | 0 | 0 | — |
case-06 | fail→pass | 12,054 | 11,302 | -6% | 1 | 1 | 0% | 1,864 | 6,431 | +245% | 0 | 0 | — |
case-07 | fail→pass | 10,870 | 13,529 | +24% | 1 | 1 | 0% | 1,789 | 6,994 | +291% | 0 | 0 | — |
case-08 | fail→pass | 10,088 | 3,531 | -65% | 1 | 1 | 0% | 1,638 | 5,015 | +206% | 0 | 0 | — |
case-09 | pass→pass | 12,877 | 10,245 | -20% | 1 | 1 | 0% | 2,139 | 6,159 | +188% | 0 | 0 | — |
case-10 | fail→fail | 15,565 | 18,619 | +20% | 1 | 1 | 0% | 2,553 | 7,486 | +193% | 0 | 0 | — |
case-11 | fail→fail | 15,115 | 12,979 | -14% | 1 | 1 | 0% | 2,534 | 6,749 | +166% | 0 | 0 | — |
case-12 | fail→pass | 12,252 | 10,132 | -17% | 1 | 1 | 0% | 2,064 | 6,136 | +197% | 0 | 0 | — |
case-13 | fail→pass | 55,033 | 12,269 | -78% | 1 | 1 | 0% | 2,120 | 6,611 | +212% | 0 | 0 | — |
case-14 | fail→pass | 10,075 | 6,888 | -32% | 1 | 1 | 0% | 1,788 | 5,749 | +222% | 0 | 0 | — |
case-15 | pass→pass | 6,517 | 7,880 | +21% | 1 | 1 | 0% | 1,167 | 5,936 | +409% | 0 | 0 | — |
case-16 | fail→pass | 17,160 | 14,082 | -18% | 1 | 1 | 0% | 3,314 | 7,585 | +129% | 0 | 0 | — |
case-17 | pass→pass | 7,825 | 4,142 | -47% | 1 | 1 | 0% | 1,287 | 5,168 | +302% | 0 | 0 | — |
case-18 | fail→pass | 7,651 | 4,073 | -47% | 1 | 1 | 0% | 1,258 | 5,056 | +302% | 0 | 0 | — |
case-19 | pass→pass | 11,449 | 3,982 | -65% | 1 | 1 | 0% | 2,002 | 5,174 | +158% | 0 | 0 | — |
case-20 | fail→fail | 20,824 | 17,122 | -18% | 1 | 1 | 0% | 4,656 | 8,499 | +83% | 0 | 0 | — |
case-21 | fail→fail | 8,793 | 13,392 | +52% | 1 | 1 | 0% | 1,442 | 6,940 | +381% | 0 | 0 | — |
case-22 | fail→fail | 18,214 | 26,795 | +47% | 1 | 1 | 0% | 3,513 | 10,303 | +193% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +41 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.