MUSUBIX Domain Inference Skill
This skill guides you through automatic domain detection and component recommendations.
Overview
MUSUBIX supports 62 domains with 224 predefined components. The domain inference system automatically:
- Detects project domain from requirements/descriptions
- Recommends optimal components for that domain
- Suggests architecture patterns
Supported Domains (62)
Business (8)
| Domain |
Description |
Key Components |
| ecommerce |
EC・通販 |
CartService, ProductCatalog, OrderProcessor |
| finance |
金融 |
AccountService, TransactionManager, LedgerService |
| crm |
顧客管理 |
CustomerService, LeadManager, OpportunityTracker |
| hr |
人事 |
EmployeeService, PayrollCalculator, AttendanceTracker |
| marketing |
マーケティング |
CampaignManager, AudienceSegmenter, AnalyticsService |
| inventory |
在庫管理 |
StockManager, ReorderService, WarehouseController |
| payment |
決済 |
PaymentGateway, RefundProcessor, InvoiceGenerator |
| subscription |
サブスク |
PlanManager, BillingService, RenewalProcessor |
Healthcare (3)
| Domain |
Description |
Key Components |
| healthcare |
ヘルスケア |
PatientService, DiagnosticService, AppointmentManager |
| pharmacy |
薬局 |
PrescriptionManager, MedicineInventory, DosageCalculator |
| veterinary |
動物病院 |
PetService, VetScheduleService, VaccinationTracker |
Service (20+)
| Domain |
Description |
Key Components |
| booking |
予約 |
ReservationService, SlotManager, AvailabilityChecker |
| hotel |
ホテル |
RoomService, CheckInManager, HousekeepingScheduler |
| restaurant |
飲食店 |
MenuManager, TableService, KitchenOrderSystem |
| gym |
フィットネス |
MembershipService, ClassScheduler, TrainerAssignment |
| delivery |
配送 |
DeliveryService, RouteOptimizer, TrackingManager |
| parking |
駐車場 |
SpaceManager, EntryExitController, FeeCalculator |
Technology (8)
| Domain |
Description |
Key Components |
| iot |
IoT |
DeviceManager, TelemetryProcessor, AlertService |
| security |
セキュリティ |
AuthService, PermissionManager, AuditLogger |
| ai |
AI |
ModelService, InferenceEngine, TrainingPipeline |
| analytics |
分析 |
ReportGenerator, MetricsCollector, DashboardService |
Domain Detection
Automatic Detection
MUSUBIX analyzes text for domain keywords:
import { domainDetector } from '@nahisaho/musubix-core';
const result = domainDetector.detect(`
ペットの予約管理システムを作りたい。
獣医師のスケジュール管理と、ワクチン接種記録も必要。
`);
// Result:
// {
// primaryDomain: { id: 'veterinary', name: 'Veterinary', nameJa: '動物病院' },
// confidence: 0.92,
// matchedKeywords: ['ペット', '獣医', 'ワクチン', '予約'],
// suggestedComponents: ['PetService', 'ReservationService', 'VetScheduleService']
// }
CLI Usage
# Analyze requirements file
npx musubix design patterns --detect-domain storage/specs/REQ-001.md
# Get component recommendations
npx musubix design generate storage/specs/REQ-001.md --infer-components
Component Inference
Domain-Specific Components
Each domain has predefined components with:
- Type: Service, Repository, Controller, Factory, etc.
- Layer: Presentation, Application, Domain, Infrastructure
- Dependencies: Required collaborators
- Patterns: Recommended design patterns
- Methods: Domain-specific operations
Example: Veterinary Domain
const veterinaryComponents = [
{
name: 'PetService',
type: 'service',
layer: 'application',
description: 'ペット管理のビジネスロジック',
dependencies: ['PetRepository', 'PetHistoryRepository'],
patterns: ['Service'],
methods: [
{ name: 'register', returnType: 'Promise<Pet>' },
{ name: 'update', returnType: 'Promise<Pet>' },
{ name: 'getByOwner', returnType: 'Promise<Pet[]>' },
{ name: 'getHistory', returnType: 'Promise<PetHistory[]>' },
]
},
{
name: 'ReservationService',
type: 'service',
layer: 'application',
methods: [
{ name: 'create', returnType: 'Promise<Reservation>' },
{ name: 'confirm', returnType: 'Promise<Reservation>' },
{ name: 'cancel', returnType: 'Promise<Reservation>' },
{ name: 'getAvailableSlots', returnType: 'Promise<TimeSlot[]>' },
]
},
// ...more components
];
Architecture Recommendations
Based on domain, MUSUBIX recommends:
| Domain Category |
Architecture Style |
Scaling Strategy |
| Business |
Layered + DDD |
Vertical with caching |
| Technology |
Microservices |
Horizontal scaling |
| Healthcare |
Layered + Audit |
Vertical with compliance |
| Service |
Layered |
Vertical with caching |
Multi-Domain Projects
For projects spanning multiple domains:
const result = domainDetector.detect(`
ECサイトで商品を販売し、配送追跡も行いたい。
在庫管理とサブスクリプション機能も必要。
`);
// Result:
// {
// primaryDomain: { id: 'ecommerce' },
// secondaryDomains: [
// { id: 'delivery' },
// { id: 'inventory' },
// { id: 'subscription' }
// ]
// }
Using in Design Documents
# DES-SHOP-001: ECサイト設計
## ドメイン分析
- **主ドメイン**: ecommerce
- **副ドメイン**: inventory, payment, delivery
## 推奨コンポーネント
### ecommerce ドメイン
| コンポーネント | 種別 | 責務 |
|---------------|------|------|
| CartService | Service | カート管理 |
| ProductCatalog | Service | 商品カタログ |
| OrderProcessor | Service | 注文処理 |
### inventory ドメイン
| コンポーネント | 種別 | 責務 |
|---------------|------|------|
| StockManager | Service | 在庫管理 |
| ReorderService | Service | 発注管理 |
Related Skills
musubix-c4-design - Create architecture with inferred components
musubix-code-generation - Generate code for components
musubix-sdd-workflow - Full workflow with domain awareness
1---2name: musubix-domain-inference3description: Guide for automatic domain detection and component inference. Use this when asked to identify the domain of a project and get recommended components for that domain.4license: MIT5---67# MUSUBIX Domain Inference Skill89This skill guides you through automatic domain detection and component recommendations.1011## Overview1213MUSUBIX supports **62 domains** with **224 predefined components**. The domain inference system automatically:14151. Detects project domain from requirements/descriptions162. Recommends optimal components for that domain173. Suggests architecture patterns1819## Supported Domains (62)2021### Business (8)22| Domain | Description | Key Components |23|--------|-------------|----------------|24| ecommerce | EC・通販 | CartService, ProductCatalog, OrderProcessor |25| finance | 金融 | AccountService, TransactionManager, LedgerService |26| crm | 顧客管理 | CustomerService, LeadManager, OpportunityTracker |27| hr | 人事 | EmployeeService, PayrollCalculator, AttendanceTracker |28| marketing | マーケティング | CampaignManager, AudienceSegmenter, AnalyticsService |29| inventory | 在庫管理 | StockManager, ReorderService, WarehouseController |30| payment | 決済 | PaymentGateway, RefundProcessor, InvoiceGenerator |31| subscription | サブスク | PlanManager, BillingService, RenewalProcessor |3233### Healthcare (3)34| Domain | Description | Key Components |35|--------|-------------|----------------|36| healthcare | ヘルスケア | PatientService, DiagnosticService, AppointmentManager |37| pharmacy | 薬局 | PrescriptionManager, MedicineInventory, DosageCalculator |38| veterinary | 動物病院 | PetService, VetScheduleService, VaccinationTracker |3940### Service (20+)41| Domain | Description | Key Components |42|--------|-------------|----------------|43| booking | 予約 | ReservationService, SlotManager, AvailabilityChecker |44| hotel | ホテル | RoomService, CheckInManager, HousekeepingScheduler |45| restaurant | 飲食店 | MenuManager, TableService, KitchenOrderSystem |46| gym | フィットネス | MembershipService, ClassScheduler, TrainerAssignment |47| delivery | 配送 | DeliveryService, RouteOptimizer, TrackingManager |48| parking | 駐車場 | SpaceManager, EntryExitController, FeeCalculator |4950### Technology (8)51| Domain | Description | Key Components |52|--------|-------------|----------------|53| iot | IoT | DeviceManager, TelemetryProcessor, AlertService |54| security | セキュリティ | AuthService, PermissionManager, AuditLogger |55| ai | AI | ModelService, InferenceEngine, TrainingPipeline |56| analytics | 分析 | ReportGenerator, MetricsCollector, DashboardService |5758## Domain Detection5960### Automatic Detection6162MUSUBIX analyzes text for domain keywords:6364```typescript65import { domainDetector } from '@nahisaho/musubix-core';6667const result = domainDetector.detect(`68 ペットの予約管理システムを作りたい。69 獣医師のスケジュール管理と、ワクチン接種記録も必要。70`);7172// Result:73// {74// primaryDomain: { id: 'veterinary', name: 'Veterinary', nameJa: '動物病院' },75// confidence: 0.92,76// matchedKeywords: ['ペット', '獣医', 'ワクチン', '予約'],77// suggestedComponents: ['PetService', 'ReservationService', 'VetScheduleService']78// }79```8081### CLI Usage8283```bash84# Analyze requirements file85npx musubix design patterns --detect-domain storage/specs/REQ-001.md8687# Get component recommendations88npx musubix design generate storage/specs/REQ-001.md --infer-components89```9091## Component Inference9293### Domain-Specific Components9495Each domain has predefined components with:96- **Type**: Service, Repository, Controller, Factory, etc.97- **Layer**: Presentation, Application, Domain, Infrastructure98- **Dependencies**: Required collaborators99- **Patterns**: Recommended design patterns100- **Methods**: Domain-specific operations101102### Example: Veterinary Domain103104```typescript105const veterinaryComponents = [106 {107 name: 'PetService',108 type: 'service',109 layer: 'application',110 description: 'ペット管理のビジネスロジック',111 dependencies: ['PetRepository', 'PetHistoryRepository'],112 patterns: ['Service'],113 methods: [114 { name: 'register', returnType: 'Promise<Pet>' },115 { name: 'update', returnType: 'Promise<Pet>' },116 { name: 'getByOwner', returnType: 'Promise<Pet[]>' },117 { name: 'getHistory', returnType: 'Promise<PetHistory[]>' },118 ]119 },120 {121 name: 'ReservationService',122 type: 'service',123 layer: 'application',124 methods: [125 { name: 'create', returnType: 'Promise<Reservation>' },126 { name: 'confirm', returnType: 'Promise<Reservation>' },127 { name: 'cancel', returnType: 'Promise<Reservation>' },128 { name: 'getAvailableSlots', returnType: 'Promise<TimeSlot[]>' },129 ]130 },131 // ...more components132];133```134135## Architecture Recommendations136137Based on domain, MUSUBIX recommends:138139| Domain Category | Architecture Style | Scaling Strategy |140|-----------------|-------------------|------------------|141| Business | Layered + DDD | Vertical with caching |142| Technology | Microservices | Horizontal scaling |143| Healthcare | Layered + Audit | Vertical with compliance |144| Service | Layered | Vertical with caching |145146## Multi-Domain Projects147148For projects spanning multiple domains:149150```typescript151const result = domainDetector.detect(`152 ECサイトで商品を販売し、配送追跡も行いたい。153 在庫管理とサブスクリプション機能も必要。154`);155156// Result:157// {158// primaryDomain: { id: 'ecommerce' },159// secondaryDomains: [160// { id: 'delivery' },161// { id: 'inventory' },162// { id: 'subscription' }163// ]164// }165```166167## Using in Design Documents168169```markdown170# DES-SHOP-001: ECサイト設計171172## ドメイン分析173- **主ドメイン**: ecommerce174- **副ドメイン**: inventory, payment, delivery175176## 推奨コンポーネント177178### ecommerce ドメイン179| コンポーネント | 種別 | 責務 |180|---------------|------|------|181| CartService | Service | カート管理 |182| ProductCatalog | Service | 商品カタログ |183| OrderProcessor | Service | 注文処理 |184185### inventory ドメイン186| コンポーネント | 種別 | 責務 |187|---------------|------|------|188| StockManager | Service | 在庫管理 |189| ReorderService | Service | 発注管理 |190```191192## Related Skills193194- `musubix-c4-design` - Create architecture with inferred components195- `musubix-code-generation` - Generate code for components196- `musubix-sdd-workflow` - Full workflow with domain awareness