Back to list
nahisaho

musubix-domain-inference

by nahisaho

8🍴 1📅 Jan 24, 2026

SKILL.md


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:

  1. Detects project domain from requirements/descriptions
  2. Recommends optimal components for that domain
  3. Suggests architecture patterns

Supported Domains (62)

Business (8)

DomainDescriptionKey Components
ecommerceEC・通販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)

DomainDescriptionKey Components
healthcareヘルスケアPatientService, DiagnosticService, AppointmentManager
pharmacy薬局PrescriptionManager, MedicineInventory, DosageCalculator
veterinary動物病院PetService, VetScheduleService, VaccinationTracker

Service (20+)

DomainDescriptionKey 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)

DomainDescriptionKey Components
iotIoTDeviceManager, TelemetryProcessor, AlertService
securityセキュリティAuthService, PermissionManager, AuditLogger
aiAIModelService, 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 CategoryArchitecture StyleScaling Strategy
BusinessLayered + DDDVertical with caching
TechnologyMicroservicesHorizontal scaling
HealthcareLayered + AuditVertical with compliance
ServiceLayeredVertical 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 | 発注管理 |
  • musubix-c4-design - Create architecture with inferred components
  • musubix-code-generation - Generate code for components
  • musubix-sdd-workflow - Full workflow with domain awareness

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon