Skip to main content Skills Marktplatz Entdecken und erkunden Sie KI-Skills, die von der Community erstellt wurden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Prompt kopierenPrompt-Details anzeigen Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
npx skills add https://github.com/ruvnet/agentic-flow --skill v3-ddd-architectureDer Befehl bleibt in einer Zeile. Scrollen Sie horizontal, um ihn vor dem Kopieren vollständig zu prüfen.
Sie bevorzugen eine lokale Kopie? Laden Sie die Dateien herunter, die SkillsMP derzeit vorliegen.
ZIP herunterladen Herunterladen... Mehr aus diesem Repository
Verwandte Berufe SOC
Basierend auf der SOC-Berufsklassifikation
name V3 DDD Architecture description Domain-Driven Design architecture for claude-flow v3. Implements modular, bounded context architecture with clean separation of concerns and microkernel pattern.
V3 DDD Architecture
What This Skill Does
Designs 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.
Quick Start
Task("Architecture analysis" , "Analyze current architecture and design DDD boundaries" , "core-architect" )
Task("Domain decomposition" , "Break down orchestrator god object into domains" , "core-architect" )
Task("Context mapping" , "Map bounded contexts and relationships" , "core-architect" )
Task("Interface design" , "Design clean domain interfaces" , "core-architect" )
DDD Implementation Strategy
Current Architecture Analysis
├── PROBLEMATIC: core/orchestrator.ts (1,440 lines - GOD OBJECT)
│ ├── Task management responsibilities
│ ├── Session management responsibilities
│ ├── Health monitoring responsibilities
│ ├── Lifecycle management responsibilities
│ └── Event coordination responsibilities
│
└── TARGET: Modular DDD Architecture
├── core/domains/
│ ├── task-management/
│ ├── session-management/
│ ├── health-monitoring/
│ ├── lifecycle-management/
│ └── event-coordination/
└── core/shared/
├── interfaces/
├── value-objects/
└── domain-events/
Domain Boundaries
1. Task Management Domain
interface TaskManagementDomain {
Task : TaskEntity ;
TaskQueue : TaskQueueEntity ;
TaskId : TaskIdVO ;
TaskStatus : TaskStatusVO ;
Priority : PriorityVO ;
TaskScheduler : TaskSchedulingService ;
TaskValidator : TaskValidationService ;
TaskRepository : ITaskRepository ;
}
2. Session Management Domain
interface SessionManagementDomain {
Session : SessionEntity ;
SessionState : SessionStateEntity ;
SessionId : SessionIdVO ;
SessionStatus : SessionStatusVO ;
SessionLifecycle : SessionLifecycleService ;
SessionPersistence : SessionPersistenceService ;
SessionRepository : ISessionRepository ;
}
3. Health Monitoring Domain
interface HealthMonitoringDomain {
HealthCheck : HealthCheckEntity ;
Metric : MetricEntity ;
HealthStatus : HealthStatusVO ;
Threshold : ThresholdVO ;
HealthCollector : HealthCollectionService ;
AlertManager : AlertManagementService ;
MetricsRepository : IMetricsRepository ;
}
Microkernel Architecture Pattern
Core Kernel
export class ClaudeFlowKernel {
private domains : Map <string , Domain > = new Map ();
private eventBus : DomainEventBus ;
private dependencyContainer : Container ;
async initialize (): Promise <void > {
await this .loadDomain ("task-management" , new TaskManagementDomain ());
await this .loadDomain ("session-management" , new SessionManagementDomain ());
await this .loadDomain ("health-monitoring" , new HealthMonitoringDomain ());
this .setupDomainEventHandlers ();
}
async loadDomain (name : string , domain : Domain ): Promise <void > {
await domain.initialize (this .dependencyContainer );
this .domains .set (name, domain);
}
getDomain<T extends Domain >(name : string ): T {
const domain = this .domains .get (name);
if (!domain) {
throw new DomainNotLoadedError (name);
}
return domain as T;
}
}
Plugin Architecture
interface DomainPlugin {
name : string ;
version : string ;
dependencies : string [];
initialize (kernel : ClaudeFlowKernel ): Promise <void >;
shutdown (): Promise <void >;
}
export class SwarmCoordinationPlugin implements DomainPlugin {
name = "swarm-coordination" ;
version = "3.0.0" ;
dependencies = ["task-management" , "session-management" ];
async initialize (kernel : ClaudeFlowKernel ): Promise <void > {
const taskDomain =
kernel.getDomain <TaskManagementDomain >("task-management" );
const sessionDomain =
kernel.getDomain <SessionManagementDomain >("session-management" );
this .swarmCoordinator = new UnifiedSwarmCoordinator (
taskDomain,
sessionDomain,
);
kernel.registerService ("swarm-coordinator" , this .swarmCoordinator );
}
}
Domain Events & Integration
Event-Driven Communication
abstract class DomainEvent {
public readonly eventId : string ;
public readonly aggregateId : string ;
public readonly occurredOn : Date ;
public readonly eventVersion : number ;
constructor (aggregateId : string ) {
this .eventId = crypto.randomUUID ();
this .aggregateId = aggregateId;
this .occurredOn = new Date ();
this .eventVersion = 1 ;
}
}
export class TaskAssignedEvent extends DomainEvent {
constructor (
taskId : string ,
public readonly agentId : string ,
public readonly priority : Priority ,
) {
super (taskId);
}
}
export class TaskCompletedEvent extends DomainEvent {
constructor (
taskId : string ,
public readonly result : TaskResult ,
public readonly duration : number ,
) {
super (taskId);
}
}
@EventHandler (TaskCompletedEvent )
export class TaskCompletedHandler {
constructor (
private metricsRepository : IMetricsRepository ,
private sessionService : SessionLifecycleService ,
) {}
async handle (event : TaskCompletedEvent ): Promise <void > {
await this .metricsRepository .recordTaskCompletion (
event.aggregateId ,
event.duration ,
);
await this .sessionService .markTaskCompleted (
event.aggregateId ,
event.result ,
);
}
}
Clean Architecture Layers
┌─────────────────────────────────────────┐
│ Presentation │ ← CLI , API , UI
├─────────────────────────────────────────┤
│ Application │ ← Use Cases , Commands
├─────────────────────────────────────────┤
│ Domain │ ← Entities , Services , Events
├─────────────────────────────────────────┤
│ Infrastructure │ ← DB , MCP , External APIs
└─────────────────────────────────────────┘
Application Layer (Use Cases)
export class AssignTaskUseCase {
constructor (
private taskRepository : ITaskRepository ,
private agentRepository : IAgentRepository ,
private eventBus : DomainEventBus ,
) {}
async execute (command : AssignTaskCommand ): Promise <TaskResult > {
await this .validateCommand (command);
const task = await this .taskRepository .findById (command.taskId );
const agent = await this .agentRepository .findById (command.agentId );
task.assignTo (agent);
await this .taskRepository .save (task);
task
.getUncommittedEvents ()
.forEach ((event ) => this .eventBus .publish (event));
return TaskResult .success (task);
}
}
Module Configuration
Bounded Context Modules
export const taskManagementModule = {
name : "task-management" ,
entities : [TaskEntity , TaskQueueEntity ],
valueObjects : [TaskIdVO , TaskStatusVO , PriorityVO ],
services : [TaskSchedulingService , TaskValidationService ],
repositories : [{ provide : ITaskRepository , useClass : SqliteTaskRepository }],
eventHandlers : [TaskAssignedHandler , TaskCompletedHandler ],
};
Migration Strategy
Phase 1: Extract Domain Services
const extractionPlan = {
week1 : [
"TaskManager → task-management domain" ,
"SessionManager → session-management domain" ,
],
week2 : [
"HealthMonitor → health-monitoring domain" ,
"LifecycleManager → lifecycle-management domain" ,
],
week3 : [
"EventCoordinator → event-coordination domain" ,
"Wire up domain events" ,
],
};
Phase 2: Implement Clean Interfaces
export class TaskController {
constructor (
@Inject ("AssignTaskUseCase" ) private assignTask : AssignTaskUseCase ,
@Inject ("CompleteTaskUseCase" ) private completeTask : CompleteTaskUseCase ,
) {}
async assign (request : AssignTaskRequest ): Promise <TaskResponse > {
const command = AssignTaskCommand .fromRequest (request);
const result = await this .assignTask .execute (command);
return TaskResponse .fromResult (result);
}
}
Phase 3: Plugin System
const pluginSystem = {
core : ["task-management" , "session-management" , "health-monitoring" ],
optional : [
"swarm-coordination" ,
"learning-integration" ,
"performance-monitoring" ,
],
};
Testing Strategy
Domain Testing (London School TDD)
describe ("Task Entity" , () => {
let task : TaskEntity ;
let mockAgent : jest.Mocked <AgentEntity >;
beforeEach (() => {
task = new TaskEntity (TaskId .create (), "Test task" );
mockAgent = createMock<AgentEntity >();
});
it ("should assign to agent when valid" , () => {
mockAgent.canAcceptTask .mockReturnValue (true );
task.assignTo (mockAgent);
expect (task.assignedAgent ).toBe (mockAgent);
expect (task.status .value ).toBe ("assigned" );
});
it ("should emit TaskAssignedEvent when assigned" , () => {
mockAgent.canAcceptTask .mockReturnValue (true );
task.assignTo (mockAgent);
const events = task.getUncommittedEvents ();
expect (events).toHaveLength (1 );
expect (events[0 ]).toBeInstanceOf (TaskAssignedEvent );
});
});
Success Metrics
Related V3 Skills
v3-core-implementation - Implementation of DDD domains
v3-memory-unification - AgentDB integration within bounded contexts
v3-swarm-coordination - Swarm coordination as domain plugin
v3-performance-optimization - Performance optimization across domains
Usage Examples
Complete Domain Extraction
Task("DDD architecture implementation" ,
"Extract orchestrator into DDD domains with clean architecture" ,
"core-architect" )
Plugin Development
npm run create:plugin -- --name swarm-coordination --template domain