[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74B0HFQ3K1VXRWDERB60CJM":3,"skill-same:01M74B0HFQ3K1VXRWDERB60CJM":43},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M74B0HFQ3K1VXRWDERB60CJM","V3 DDD Architecture",null,"Domain-Driven Design architecture for claude-flow v3. Implements modular, bounded context architecture with clean separation of concerns and microkernel pattern.","aicreator350\u002FaurionOFFICIELLE","aicreator350","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F217751428?v=4","01M731QVHB22WCM6PDX5VFN1RV","01M731QVJ0TAD058M1SW9MY548",0,"MIT","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002F_archive\u002Fskills\u002Fv3-ddd-architecture\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: \"V3 DDD Architecture\"\ndescription: \"Domain-Driven Design architecture for claude-flow v3. Implements modular, bounded context architecture with clean separation of concerns and microkernel pattern.\"\n---\n\n# V3 DDD Architecture\n\n## What This Skill Does\n\nDesigns and implements Domain-Driven Design (DDD) architecture for claude-flow v3, decomposing god objects into bounded contexts, implementing clean architecture patterns, and enabling modular, testable code structure.\n\n## Quick Start\n\n```bash\n# Initialize DDD architecture analysis\nTask(\"Architecture analysis\", \"Analyze current architecture and design DDD boundaries\", \"core-architect\")\n\n# Domain modeling (parallel)\nTask(\"Domain decomposition\", \"Break down orchestrator god object into domains\", \"core-architect\")\nTask(\"Context mapping\", \"Map bounded contexts and relationships\", \"core-architect\")\nTask(\"Interface design\", \"Design clean domain interfaces\", \"core-architect\")\n```\n\n## DDD Implementation Strategy\n\n### Current Architecture Analysis\n```\n├── PROBLEMATIC: core\u002Forchestrator.ts (1,440 lines - GOD OBJECT)\n│   ├── Task management responsibilities\n│   ├── Session management responsibilities\n│   ├── Health monitoring responsibilities\n│   ├── Lifecycle management responsibilities\n│   └── Event coordination responsibilities\n│\n└── TARGET: Modular DDD Architecture\n    ├── core\u002Fdomains\u002F\n    │   ├── task-management\u002F\n    │   ├── session-management\u002F\n    │   ├── health-monitoring\u002F\n    │   ├── lifecycle-management\u002F\n    │   └── event-coordination\u002F\n    └── core\u002Fshared\u002F\n        ├── interfaces\u002F\n        ├── value-objects\u002F\n        └── domain-events\u002F\n```\n\n### Domain Boundaries\n\n#### 1. Task Management Domain\n```typescript\n\u002F\u002F core\u002Fdomains\u002Ftask-management\u002F\ninterface TaskManagementDomain {\n  \u002F\u002F Entities\n  Task: TaskEntity;\n  TaskQueue: TaskQueueEntity;\n\n  \u002F\u002F Value Objects\n  TaskId: TaskIdVO;\n  TaskStatus: TaskStatusVO;\n  Priority: PriorityVO;\n\n  \u002F\u002F Services\n  TaskScheduler: TaskSchedulingService;\n  TaskValidator: TaskValidationService;\n\n  \u002F\u002F Repository\n  TaskRepository: ITaskRepository;\n}\n```\n\n#### 2. Session Management Domain\n```typescript\n\u002F\u002F core\u002Fdomains\u002Fsession-management\u002F\ninterface SessionManagementDomain {\n  \u002F\u002F Entities\n  Session: SessionEntity;\n  SessionState: SessionStateEntity;\n\n  \u002F\u002F Value Objects\n  SessionId: SessionIdVO;\n  SessionStatus: SessionStatusVO;\n\n  \u002F\u002F Services\n  SessionLifecycle: SessionLifecycleService;\n  SessionPersistence: SessionPersistenceService;\n\n  \u002F\u002F Repository\n  SessionRepository: ISessionRepository;\n}\n```\n\n#### 3. Health Monitoring Domain\n```typescript\n\u002F\u002F core\u002Fdomains\u002Fhealth-monitoring\u002F\ninterface HealthMonitoringDomain {\n  \u002F\u002F Entities\n  HealthCheck: HealthCheckEntity;\n  Metric: MetricEntity;\n\n  \u002F\u002F Value Objects\n  HealthStatus: HealthStatusVO;\n  Threshold: ThresholdVO;\n\n  \u002F\u002F Services\n  HealthCollector: HealthCollectionService;\n  AlertManager: AlertManagementService;\n\n  \u002F\u002F Repository\n  MetricsRepository: IMetricsRepository;\n}\n```\n\n## Microkernel Architecture Pattern\n\n### Core Kernel\n```typescript\n\u002F\u002F core\u002Fkernel\u002Fclaude-flow-kernel.ts\nexport class ClaudeFlowKernel {\n  private domains: Map\u003Cstring, Domain> = new Map();\n  private eventBus: DomainEventBus;\n  private dependencyContainer: Container;\n\n  async initialize(): Promise\u003Cvoid> {\n    \u002F\u002F Load core domains\n    await this.loadDomain('task-management', new TaskManagementDomain());\n    await this.loadDomain('session-management', new SessionManagementDomain());\n    await this.loadDomain('health-monitoring', new HealthMonitoringDomain());\n\n    \u002F\u002F Wire up domain events\n    this.setupDomainEventHandlers();\n  }\n\n  async loadDomain(name: string, domain: Domain): Promise\u003Cvoid> {\n    await domain.initialize(this.dependencyContainer);\n    this.domains.set(name, domain);\n  }\n\n  getDomain\u003CT extends Domain>(name: string): T {\n    const domain = this.domains.get(name);\n    if (!domain) {\n      throw new DomainNotLoadedError(name);\n    }\n    return domain as T;\n  }\n}\n```\n\n### Plugin Architecture\n```typescript\n\u002F\u002F core\u002Fplugins\u002F\ninterface DomainPlugin {\n  name: string;\n  version: string;\n  dependencies: string[];\n\n  initialize(kernel: ClaudeFlowKernel): Promise\u003Cvoid>;\n  shutdown(): Promise\u003Cvoid>;\n}\n\n\u002F\u002F Example: Swarm Coordination Plugin\nexport class SwarmCoordinationPlugin implements DomainPlugin {\n  name = 'swarm-coordination';\n  version = '3.0.0';\n  dependencies = ['task-management', 'session-management'];\n\n  async initialize(kernel: ClaudeFlowKernel): Promise\u003Cvoid> {\n    const taskDomain = kernel.getDomain\u003CTaskManagementDomain>('task-management');\n    const sessionDomain = kernel.getDomain\u003CSessionManagementDomain>('session-management');\n\n    \u002F\u002F Register swarm coordination services\n    this.swarmCoordinator = new UnifiedSwarmCoordinator(taskDomain, sessionDomain);\n    kernel.registerService('swarm-coordinator', this.swarmCoordinator);\n  }\n}\n```\n\n## Domain Events & Integration\n\n### Event-Driven Communication\n```typescript\n\u002F\u002F core\u002Fshared\u002Fdomain-events\u002F\nabstract class DomainEvent {\n  public readonly eventId: string;\n  public readonly aggregateId: string;\n  public readonly occurredOn: Date;\n  public readonly eventVersion: number;\n\n  constructor(aggregateId: string) {\n    this.eventId = crypto.randomUUID();\n    this.aggregateId = aggregateId;\n    this.occurredOn = new Date();\n    this.eventVersion = 1;\n  }\n}\n\n\u002F\u002F Task domain events\nexport class TaskAssignedEvent extends DomainEvent {\n  constructor(\n    taskId: string,\n    public readonly agentId: string,\n    public readonly priority: Priority\n  ) {\n    super(taskId);\n  }\n}\n\nexport class TaskCompletedEvent extends DomainEvent {\n  constructor(\n    taskId: string,\n    public readonly result: TaskResult,\n    public readonly duration: number\n  ) {\n    super(taskId);\n  }\n}\n\n\u002F\u002F Event handlers\n@EventHandler(TaskCompletedEvent)\nexport class TaskCompletedHandler {\n  constructor(\n    private metricsRepository: IMetricsRepository,\n    private sessionService: SessionLifecycleService\n  ) {}\n\n  async handle(event: TaskCompletedEvent): Promise\u003Cvoid> {\n    \u002F\u002F Update metrics\n    await this.metricsRepository.recordTaskCompletion(\n      event.aggregateId,\n      event.duration\n    );\n\n    \u002F\u002F Update session state\n    await this.sessionService.markTaskCompleted(\n      event.aggregateId,\n      event.result\n    );\n  }\n}\n```\n\n## Clean Architecture Layers\n\n```typescript\n\u002F\u002F Architecture layers\n┌─────────────────────────────────────────┐\n│              Presentation               │  ← CLI, API, UI\n├─────────────────────────────────────────┤\n│              Application                │  ← Use Cases, Commands\n├─────────────────────────────────────────┤\n│               Domain                    │  ← Entities, Services, Events\n├─────────────────────────────────────────┤\n│            Infrastructure               │  ← DB, MCP, External APIs\n└─────────────────────────────────────────┘\n\n\u002F\u002F Dependency direction: Outside → Inside\n\u002F\u002F Domain layer has NO external dependencies\n```\n\n### Application Layer (Use Cases)\n```typescript\n\u002F\u002F core\u002Fapplication\u002Fuse-cases\u002F\nexport class AssignTaskUseCase {\n  constructor(\n    private taskRepository: ITaskRepository,\n    private agentRepository: IAgentRepository,\n    private eventBus: DomainEventBus\n  ) {}\n\n  async execute(command: AssignTaskCommand): Promise\u003CTaskResult> {\n    \u002F\u002F 1. Validate command\n    await this.validateCommand(command);\n\n    \u002F\u002F 2. Load aggregates\n    const task = await this.taskRepository.findById(command.taskId);\n    const agent = await this.agentRepository.findById(command.agentId);\n\n    \u002F\u002F 3. Business logic (in domain)\n    task.assignTo(agent);\n\n    \u002F\u002F 4. Persist changes\n    await this.taskRepository.save(task);\n\n    \u002F\u002F 5. Publish domain events\n    task.getUncommittedEvents().forEach(event =>\n      this.eventBus.publish(event)\n    );\n\n    \u002F\u002F 6. Return result\n    return TaskResult.success(task);\n  }\n}\n```\n\n## Module Configuration\n\n### Bounded Context Modules\n```typescript\n\u002F\u002F core\u002Fdomains\u002Ftask-management\u002Fmodule.ts\nexport const taskManagementModule = {\n  name: 'task-management',\n\n  entities: [\n    TaskEntity,\n    TaskQueueEntity\n  ],\n\n  valueObjects: [\n    TaskIdVO,\n    TaskStatusVO,\n    PriorityVO\n  ],\n\n  services: [\n    TaskSchedulingService,\n    TaskValidationService\n  ],\n\n  repositories: [\n    { provide: ITaskRepository, useClass: SqliteTaskRepository }\n  ],\n\n  eventHandlers: [\n    TaskAssignedHandler,\n    TaskCompletedHandler\n  ]\n};\n```\n\n## Migration Strategy\n\n### Phase 1: Extract Domain Services\n```typescript\n\u002F\u002F Extract services from orchestrator.ts\nconst extractionPlan = {\n  week1: [\n    'TaskManager → task-management domain',\n    'SessionManager → session-management domain'\n  ],\n  week2: [\n    'HealthMonitor → health-monitoring domain',\n    'LifecycleManager → lifecycle-management domain'\n  ],\n  week3: [\n    'EventCoordinator → event-coordination domain',\n    'Wire up domain events'\n  ]\n};\n```\n\n### Phase 2: Implement Clean Interfaces\n```typescript\n\u002F\u002F Clean separation with dependency injection\nexport class TaskController {\n  constructor(\n    @Inject('AssignTaskUseCase') private assignTask: AssignTaskUseCase,\n    @Inject('CompleteTaskUseCase') private completeTask: CompleteTaskUseCase\n  ) {}\n\n  async assign(request: AssignTaskRequest): Promise\u003CTaskResponse> {\n    const command = AssignTaskCommand.fromRequest(request);\n    const result = await this.assignTask.execute(command);\n    return TaskResponse.fromResult(result);\n  }\n}\n```\n\n### Phase 3: Plugin System\n```typescript\n\u002F\u002F Enable plugin-based extensions\nconst pluginSystem = {\n  core: ['task-management', 'session-management', 'health-monitoring'],\n  optional: ['swarm-coordination', 'learning-integration', 'performance-monitoring']\n};\n```\n\n## Testing Strategy\n\n### Domain Testing (London School TDD)\n```typescript\n\u002F\u002F Pure domain logic testing\ndescribe('Task Entity', () => {\n  let task: TaskEntity;\n  let mockAgent: jest.Mocked\u003CAgentEntity>;\n\n  beforeEach(() => {\n    task = new TaskEntity(TaskId.create(), 'Test task');\n    mockAgent = createMock\u003CAgentEntity>();\n  });\n\n  it('should assign to agent when valid', () => {\n    mockAgent.canAcceptTask.mockReturnValue(true);\n\n    task.assignTo(mockAgent);\n\n    expect(task.assignedAgent).toBe(mockAgent);\n    expect(task.status.value).toBe('assigned');\n  });\n\n  it('should emit TaskAssignedEvent when assigned', () => {\n    mockAgent.canAcceptTask.mockReturnValue(true);\n\n    task.assignTo(mockAgent);\n\n    const events = task.getUncommittedEvents();\n    expect(events).toHaveLength(1);\n    expect(events[0]).toBeInstanceOf(TaskAssignedEvent);\n  });\n});\n```\n\n## Success Metrics\n\n- [ ] **God Object Elimination**: orchestrator.ts (1,440 lines) → 5 focused domains (\u003C300 lines each)\n- [ ] **Bounded Context Isolation**: 100% domain independence\n- [ ] **Plugin Architecture**: Core + optional modules loading\n- [ ] **Clean Architecture**: Dependency inversion maintained\n- [ ] **Event-Driven Communication**: Loose coupling between domains\n- [ ] **Test Coverage**: >90% domain logic coverage\n\n## Related V3 Skills\n\n- `v3-core-implementation` - Implementation of DDD domains\n- `v3-memory-unification` - AgentDB integration within bounded contexts\n- `v3-swarm-coordination` - Swarm coordination as domain plugin\n- `v3-performance-optimization` - Performance optimization across domains\n\n## Usage Examples\n\n### Complete Domain Extraction\n```bash\n# Full DDD architecture implementation\nTask(\"DDD architecture implementation\",\n     \"Extract orchestrator into DDD domains with clean architecture\",\n     \"core-architect\")\n```\n\n### Plugin Development\n```bash\n# Create domain plugin\nnpm run create:plugin -- --name swarm-coordination --template domain\n```","# V3 DDD Architecture\n\n## What This Skill Does\n\nDesigns and implements Domain-Driven Design (DDD) architecture for claude-flow v3, decomposing god objects into bounded contexts, implementing clean architecture patterns, and enabling modular, testable code structure.\n\n## Quick Start\n\n```bash\n# Initialize DDD architecture analysis\nTask(\"Architecture analysis\", \"Analyze current architecture and design DDD boundaries\", \"core-architect\")\n\n# Domain modeling (parallel)\nTask(\"Domain decomposition\", \"Break down orchestrator god object into domains\", \"core-architect\")\nTask(\"Context mapping\", \"Map bounded contexts and relationships\", \"core-architect\")\nTask(\"Interface design\", \"Design clean domain interfaces\", \"core-architect\")\n```\n\n## DDD Implementation Strategy\n\n### Current Architecture Analysis\n```\n├── PROBLEMATIC: core\u002Forchestrator.ts (1,440 lines - GOD OBJECT)\n│   ├── Task management responsibilities\n│   ├── Session management responsibilities\n│   ├── Health monitoring responsibilities\n│   ├── Lifecycle management responsibilities\n│   └── Event coordination responsibilities\n│\n└── TARGET: Modular DDD Architecture\n    ├── core\u002Fdomains\u002F\n    │   ├── task-management\u002F\n    │   ├── session-management\u002F\n    │   ├── health-monitoring\u002F\n    │   ├── lifecycle-management\u002F\n    │   └── event-coordination\u002F\n    └── core\u002Fshared\u002F\n        ├── interfaces\u002F\n        ├── value-objects\u002F\n        └── domain-events\u002F\n```\n\n### Domain Boundaries\n\n#### 1. Task Management Domain\n```typescript\n\u002F\u002F core\u002Fdomains\u002Ftask-management\u002F\ninterface TaskManagementDomain {\n  \u002F\u002F Entities\n  Task: TaskEntity;\n  TaskQueue: TaskQueueEntity;\n\n  \u002F\u002F Value Objects\n  TaskId: TaskIdVO;\n  TaskStatus: TaskStatusVO;\n  Priority: PriorityVO;\n\n  \u002F\u002F Services\n  TaskScheduler: TaskSchedulingService;\n  TaskValidator: TaskValidationService;\n\n  \u002F\u002F Repository\n  TaskRepository: ITaskRepository;\n}\n```\n\n#### 2. Session Management Domain\n```typescript\n\u002F\u002F core\u002Fdomains\u002Fsession-management\u002F\ninterface SessionManagementDomain {\n  \u002F\u002F Entities\n  Session: SessionEntity;\n  SessionState: SessionStateEntity;\n\n  \u002F\u002F Value Objects\n  SessionId: SessionIdVO;\n  SessionStatus: SessionStatusVO;\n\n  \u002F\u002F Services\n  SessionLifecycle: SessionLifecycleService;\n  SessionPersistence: SessionPersistenceService;\n\n  \u002F\u002F Repository\n  SessionRepository: ISessionRepository;\n}\n```\n\n#### 3. Health Monitoring Domain\n```typescript\n\u002F\u002F core\u002Fdomains\u002Fhealth-monitoring\u002F\ninterface HealthMonitoringDomain {\n  \u002F\u002F Entities\n  HealthCheck: HealthCheckEntity;\n  Metric: MetricEntity;\n\n  \u002F\u002F Value Objects\n  HealthStatus: HealthStatusVO;\n  Threshold: ThresholdVO;\n\n  \u002F\u002F Services\n  HealthCollector: HealthCollectionService;\n  AlertManager: AlertManagementService;\n\n  \u002F\u002F Repository\n  MetricsRepository: IMetricsRepository;\n}\n```\n\n## Microkernel Architecture Pattern\n\n### Core Kernel\n```typescript\n\u002F\u002F core\u002Fkernel\u002Fclaude-flow-kernel.ts\nexport class ClaudeFlowKernel {\n  private domains: Map\u003Cstring, Domain> = new Map();\n  private eventBus: DomainEventBus;\n  private dependencyContainer: Container;\n\n  async initialize(): Promise\u003Cvoid> {\n    \u002F\u002F Load core domains\n    await this.loadDomain('task-management', new TaskManagementDomain());\n    await this.loadDomain('session-management', new SessionManagementDomain());\n    await this.loadDomain('health-monitoring', new HealthMonitoringDomain());\n\n    \u002F\u002F Wire up domain events\n    this.setupDomainEventHandlers();\n  }\n\n  async loadDomain(name: string, domain: Domain): Promise\u003Cvoid> {\n    await domain.initialize(this.dependencyContainer);\n    this.domains.set(name, domain);\n  }\n\n  getDomain\u003CT extends Domain>(name: string): T {\n    const domain = this.domains.get(name);\n    if (!domain) {\n      throw new DomainNotLoadedError(name);\n    }\n    return domain as T;\n  }\n}\n```\n\n### Plugin Architecture\n```typescript\n\u002F\u002F core\u002Fplugins\u002F\ninterface DomainPlugin {\n  name: string;\n  version: string;\n  dependencies: string[];\n\n  initialize(kernel: ClaudeFlowKernel): Promise\u003Cvoid>;\n  shutdown(): Promise\u003Cvoid>;\n}\n\n\u002F\u002F Example: Swarm Coordination Plugin\nexport class SwarmCoordinationPlugin implements DomainPlugin {\n  name = 'swarm-coordination';\n  version = '3.0.0';\n  dependencies = ['task-management', 'session-management'];\n\n  async initialize(kernel: ClaudeFlowKernel): Promise\u003Cvoid> {\n    const taskDomain = kernel.getDomain\u003CTaskManagementDomain>('task-management');\n    const sessionDomain = kernel.getDomain\u003CSessionManagementDomain>('session-management');\n\n    \u002F\u002F Register swarm coordination services\n    this.swarmCoordinator = new UnifiedSwarmCoordinator(taskDomain, sessionDomain);\n    kernel.registerService('swarm-coordinator', this.swarmCoordinator);\n  }\n}\n```\n\n## Domain Events & Integration\n\n### Event-Driven Communication\n```typescript\n\u002F\u002F core\u002Fshared\u002Fdomain-events\u002F\nabstract class DomainEvent {\n  public readonly eventId: string;\n  public readonly aggregateId: string;\n  public readonly occurredOn: Date;\n  public readonly eventVersion: number;\n\n  constructor(aggregateId: string) {\n    this.eventId = crypto.randomUUID();\n    this.aggregateId = aggregateId;\n    this.occurredOn = new Date();\n    this.eventVersion = 1;\n  }\n}\n\n\u002F\u002F Task domain events\nexport class TaskAssignedEvent extends DomainEvent {\n  constructor(\n    taskId: string,\n    public readonly agentId: string,\n    public readonly priority: Priority\n  ) {\n    super(taskId);\n  }\n}\n\nexport class TaskCompletedEvent extends DomainEvent {\n  constructor(\n    taskId: string,\n    public readonly result: TaskResult,\n    public readonly duration: number\n  ) {\n    super(taskId);\n  }\n}\n\n\u002F\u002F Event handlers\n@EventHandler(TaskCompletedEvent)\nexport class TaskCompletedHandler {\n  constructor(\n    private metricsRepository: IMetricsRepository,\n    private sessionService: SessionLifecycleService\n  ) {}\n\n  async handle(event: TaskCompletedEvent): Promise\u003Cvoid> {\n    \u002F\u002F Update metrics\n    await this.metricsRepository.recordTaskCompletion(\n      event.aggregateId,\n      event.duration\n    );\n\n    \u002F\u002F Update session state\n    await this.sessionService.markTaskCompleted(\n      event.aggregateId,\n      event.result\n    );\n  }\n}\n```\n\n## Clean Architecture Layers\n\n```typescript\n\u002F\u002F Architecture layers\n┌─────────────────────────────────────────┐\n│              Presentation               │  ← CLI, API, UI\n├─────────────────────────────────────────┤\n│              Application                │  ← Use Cases, Commands\n├─────────────────────────────────────────┤\n│               Domain                    │  ← Entities, Services, Events\n├─────────────────────────────────────────┤\n│            Infrastructure               │  ← DB, MCP, External APIs\n└─────────────────────────────────────────┘\n\n\u002F\u002F Dependency direction: Outside → Inside\n\u002F\u002F Domain layer has NO external dependencies\n```\n\n### Application Layer (Use Cases)\n```typescript\n\u002F\u002F core\u002Fapplication\u002Fuse-cases\u002F\nexport class AssignTaskUseCase {\n  constructor(\n    private taskRepository: ITaskRepository,\n    private agentRepository: IAgentRepository,\n    private eventBus: DomainEventBus\n  ) {}\n\n  async execute(command: AssignTaskCommand): Promise\u003CTaskResult> {\n    \u002F\u002F 1. Validate command\n    await this.validateCommand(command);\n\n    \u002F\u002F 2. Load aggregates\n    const task = await this.taskRepository.findById(command.taskId);\n    const agent = await this.agentRepository.findById(command.agentId);\n\n    \u002F\u002F 3. Business logic (in domain)\n    task.assignTo(agent);\n\n    \u002F\u002F 4. Persist changes\n    await this.taskRepository.save(task);\n\n    \u002F\u002F 5. Publish domain events\n    task.getUncommittedEvents().forEach(event =>\n      this.eventBus.publish(event)\n    );\n\n    \u002F\u002F 6. Return result\n    return TaskResult.success(task);\n  }\n}\n```\n\n## Module Configuration\n\n### Bounded Context Modules\n```typescript\n\u002F\u002F core\u002Fdomains\u002Ftask-management\u002Fmodule.ts\nexport const taskManagementModule = {\n  name: 'task-management',\n\n  entities: [\n    TaskEntity,\n    TaskQueueEntity\n  ],\n\n  valueObjects: [\n    TaskIdVO,\n    TaskStatusVO,\n    PriorityVO\n  ],\n\n  services: [\n    TaskSchedulingService,\n    TaskValidationService\n  ],\n\n  repositories: [\n    { provide: ITaskRepository, useClass: SqliteTaskRepository }\n  ],\n\n  eventHandlers: [\n    TaskAssignedHandler,\n    TaskCompletedHandler\n  ]\n};\n```\n\n## Migration Strategy\n\n### Phase 1: Extract Domain Services\n```typescript\n\u002F\u002F Extract services from orchestrator.ts\nconst extractionPlan = {\n  week1: [\n    'TaskManager → task-management domain',\n    'SessionManager → session-management domain'\n  ],\n  week2: [\n    'HealthMonitor → health-monitoring domain',\n    'LifecycleManager → lifecycle-management domain'\n  ],\n  week3: [\n    'EventCoordinator → event-coordination domain',\n    'Wire up domain events'\n  ]\n};\n```\n\n### Phase 2: Implement Clean Interfaces\n```typescript\n\u002F\u002F Clean separation with dependency injection\nexport class TaskController {\n  constructor(\n    @Inject('AssignTaskUseCase') private assignTask: AssignTaskUseCase,\n    @Inject('CompleteTaskUseCase') private completeTask: CompleteTaskUseCase\n  ) {}\n\n  async assign(request: AssignTaskRequest): Promise\u003CTaskResponse> {\n    const command = AssignTaskCommand.fromRequest(request);\n    const result = await this.assignTask.execute(command);\n    return TaskResponse.fromResult(result);\n  }\n}\n```\n\n### Phase 3: Plugin System\n```typescript\n\u002F\u002F Enable plugin-based extensions\nconst pluginSystem = {\n  core: ['task-management', 'session-management', 'health-monitoring'],\n  optional: ['swarm-coordination', 'learning-integration', 'performance-monitoring']\n};\n```\n\n## Testing Strategy\n\n### Domain Testing (London School TDD)\n```typescript\n\u002F\u002F Pure domain logic testing\ndescribe('Task Entity', () => {\n  let task: TaskEntity;\n  let mockAgent: jest.Mocked\u003CAgentEntity>;\n\n  beforeEach(() => {\n    task = new TaskEntity(TaskId.create(), 'Test task');\n    mockAgent = createMock\u003CAgentEntity>();\n  });\n\n  it('should assign to agent when valid', () => {\n    mockAgent.canAcceptTask.mockReturnValue(true);\n\n    task.assignTo(mockAgent);\n\n    expect(task.assignedAgent).toBe(mockAgent);\n    expect(task.status.value).toBe('assigned');\n  });\n\n  it('should emit TaskAssignedEvent when assigned', () => {\n    mockAgent.canAcceptTask.mockReturnValue(true);\n\n    task.assignTo(mockAgent);\n\n    const events = task.getUncommittedEvents();\n    expect(events).toHaveLength(1);\n    expect(events[0]).toBeInstanceOf(TaskAssignedEvent);\n  });\n});\n```\n\n## Success Metrics\n\n- [ ] **God Object Elimination**: orchestrator.ts (1,440 lines) → 5 focused domains (\u003C300 lines each)\n- [ ] **Bounded Context Isolation**: 100% domain independence\n- [ ] **Plugin Architecture**: Core + optional modules loading\n- [ ] **Clean Architecture**: Dependency inversion maintained\n- [ ] **Event-Driven Communication**: Loose coupling between domains\n- [ ] **Test Coverage**: >90% domain logic coverage\n\n## Related V3 Skills\n\n- `v3-core-implementation` - Implementation of DDD domains\n- `v3-memory-unification` - AgentDB integration within bounded contexts\n- `v3-swarm-coordination` - Swarm coordination as domain plugin\n- `v3-performance-optimization` - Performance optimization across domains\n\n## Usage Examples\n\n### Complete Domain Extraction\n```bash\n# Full DDD architecture implementation\nTask(\"DDD architecture implementation\",\n     \"Extract orchestrator into DDD domains with clean architecture\",\n     \"core-architect\")\n```\n\n### Plugin Development\n```bash\n# Create domain plugin\nnpm run create:plugin -- --name swarm-coordination --template domain\n```",{"name":5,"description":7},"main","5593cf3c72898ea9fc67225d452fe38f866ba6dd",".claude\u002F_archive\u002Fskills\u002Fv3-ddd-architecture","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE","https:\u002F\u002Fgithub.com\u002Faicreator350","2026-05-18 03:39:30",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add aicreator350\u002FaurionOFFICIELLE --skill \"V3 DDD Architecture\"",{"tool":35,"command":36},"bunx","bunx skills add aicreator350\u002FaurionOFFICIELLE --skill \"V3 DDD Architecture\"",{"tool":38,"command":39},"pnpm","pnpm dlx skills add aicreator350\u002FaurionOFFICIELLE --skill \"V3 DDD Architecture\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002F_archive\u002Fskills\u002Fv3-ddd-architecture\u002FSKILL.md",true,[],[44,53,60,67,74,81],{"skillNo":45,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":48,"licenseFileUrl":49,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M74CAJWR9WB6DX1HF2V461Y0","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":18},"01M74CAFWC2H75GJ81B39C9RSW","web-design-guidelines","Review UI code for Web Interface Guidelines compliance. Use when asked to \"review my UI\", \"check accessibility\", \"audit design\", \"review UX\", or \"check my site against best practices\".","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M74CA9N2HTGCKJ93AE9NQMHA","vercel-react-view-transitions","Guide for implementing smooth, native-feeling animations using React's View Transition API (`\u003CViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter\u002Fexit of components, animate list reorder, implement directional (forward\u002Fback) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-react-view-transitions\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M74CA364D4EVDXZZQRVK1Z73","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M74C9YQZX1GVS18V0AYCYPZE","vercel-composition-patterns","React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-composition-patterns\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M74C9SEYD6F764Q1JACZX3A6","vercel-cli-with-tokens","Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. \"deploy to vercel\", \"set up vercel\", \"add environment variables to vercel\".","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-cli-with-tokens\u002FSKILL.md",[],[]]