[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73PVF97YF3EQZWJQ0ZX5KC2":3,"skill-same:01M73PVF97YF3EQZWJQ0ZX5KC2":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M73PVF97YF3EQZWJQ0ZX5KC2","blueprinteventbus-integration",null,"Implement event-driven communication using BlueprintEventBus for cross-module coordination. Use this skill when modules need to communicate without tight coupling, broadcasting domain events (task.created, member.added), subscribing to events with proper lifecycle management, and implementing event-driven workflows. Ensures events follow naming conventions ([module].[action]), include Blueprint context, and use takeUntilDestroyed() for automatic cleanup.","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fblueprinteventbus-integration\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: blueprinteventbus-integration\ndescription: \"Implement event-driven communication using BlueprintEventBus for cross-module coordination. Use this skill when modules need to communicate without tight coupling, broadcasting domain events (task.created, member.added), subscribing to events with proper lifecycle management, and implementing event-driven workflows. Ensures events follow naming conventions ([module].[action]), include Blueprint context, and use takeUntilDestroyed() for automatic cleanup.\"\nlicense: \"MIT\"\n---\n\n# BlueprintEventBus Integration Skill\n\nThis skill helps implement event-driven architecture using BlueprintEventBus.\n\n## Core Principles\n\n### Event-Driven Architecture\n- **Decoupling**: Modules communicate via events, not direct calls\n- **Blueprint Context**: All events include Blueprint information\n- **Type Safety**: Events are strongly typed with TypeScript\n- **Lifecycle Management**: Automatic subscription cleanup\n\n### When to Use EventBus\n\n✅ **DO use EventBus for:**\n- Cross-module communication\n- Broadcasting state changes to multiple listeners\n- Audit logging and activity tracking\n- Notification triggers\n- Workflow orchestration\n\n❌ **DON'T use EventBus for:**\n- Simple parent-child component communication (use @Output)\n- Direct service-to-service calls within same module\n- Synchronous data fetching\n- Request-response patterns (use Services)\n\n## Event Structure\n\n### Base Event Interface\n\n```typescript\ninterface BlueprintEvent\u003CT = any> {\n  type: string; \u002F\u002F Format: [module].[action]\n  blueprintId: string;\n  timestamp: Date;\n  actor: string; \u002F\u002F User ID who triggered event\n  data: T;\n  metadata?: Record\u003Cstring, any>;\n}\n```\n\n### Event Naming Convention\n\n```\n[module].[action]\n```\n\nExamples:\n- `task.created`\n- `task.updated`\n- `task.deleted`\n- `task.assigned`\n- `member.added`\n- `member.removed`\n- `file.uploaded`\n- `blueprint.archived`\n\n## Publishing Events\n\n### Basic Event Publishing\n\n```typescript\nimport { inject } from '@angular\u002Fcore';\nimport { BlueprintEventBus } from '@core\u002Fservices\u002Fblueprint-event-bus.service';\n\n@Injectable({ providedIn: 'root' })\nexport class TaskService {\n  private eventBus = inject(BlueprintEventBus);\n  private taskRepository = inject(TaskRepository);\n  \n  async createTask(blueprintId: string, task: CreateTaskDto): Promise\u003CTask> {\n    \u002F\u002F 1. Execute business logic\n    const created = await this.taskRepository.create(blueprintId, task);\n    \n    \u002F\u002F 2. Publish domain event\n    this.eventBus.publish({\n      type: 'task.created',\n      blueprintId,\n      timestamp: new Date(),\n      actor: this.getCurrentUserId(),\n      data: created\n    });\n    \n    return created;\n  }\n  \n  async updateTask(taskId: string, updates: Partial\u003CTask>): Promise\u003CTask> {\n    const task = await this.taskRepository.findById(taskId);\n    if (!task) throw new Error('Task not found');\n    \n    const updated = await this.taskRepository.update(taskId, updates);\n    \n    \u002F\u002F Publish update event with before\u002Fafter data\n    this.eventBus.publish({\n      type: 'task.updated',\n      blueprintId: task.blueprintId,\n      timestamp: new Date(),\n      actor: this.getCurrentUserId(),\n      data: updated,\n      metadata: {\n        before: task,\n        changes: updates\n      }\n    });\n    \n    return updated;\n  }\n}\n```\n\n### Typed Event Publishing\n\n```typescript\n\u002F\u002F Define event types\ninterface TaskCreatedEvent extends BlueprintEvent\u003CTask> {\n  type: 'task.created';\n}\n\ninterface TaskAssignedEvent extends BlueprintEvent\u003C{\n  task: Task;\n  assignee: string;\n  assigneeType: 'user' | 'team' | 'partner';\n}> {\n  type: 'task.assigned';\n}\n\n\u002F\u002F Publish with type safety\nthis.eventBus.publish\u003CTaskCreatedEvent>({\n  type: 'task.created',\n  blueprintId: created.blueprintId,\n  timestamp: new Date(),\n  actor: this.getCurrentUserId(),\n  data: created\n});\n```\n\n## Subscribing to Events\n\n### Basic Subscription\n\n```typescript\nimport { Component, inject, signal, DestroyRef } from '@angular\u002Fcore';\nimport { takeUntilDestroyed } from '@angular\u002Fcore\u002Frxjs-interop';\nimport { BlueprintEventBus } from '@core\u002Fservices\u002Fblueprint-event-bus.service';\n\n@Component({\n  selector: 'app-task-list',\n  template: `...`\n})\nexport class TaskListComponent {\n  private eventBus = inject(BlueprintEventBus);\n  private destroyRef = inject(DestroyRef);\n  \n  tasks = signal\u003CTask[]>([]);\n  \n  ngOnInit(): void {\n    \u002F\u002F Subscribe to task.created events\n    this.eventBus.subscribe('task.created')\n      .pipe(takeUntilDestroyed(this.destroyRef))\n      .subscribe(event => {\n        console.log('New task created:', event.data);\n        this.tasks.update(tasks => [...tasks, event.data]);\n      });\n  }\n}\n```\n\n### Filtered Subscription (Blueprint-specific)\n\n```typescript\nimport { filter } from 'rxjs\u002Foperators';\n\n@Component({\n  selector: 'app-blueprint-tasks',\n  template: `...`\n})\nexport class BlueprintTasksComponent {\n  private eventBus = inject(BlueprintEventBus);\n  private destroyRef = inject(DestroyRef);\n  \n  blueprintId = input.required\u003Cstring>();\n  tasks = signal\u003CTask[]>([]);\n  \n  ngOnInit(): void {\n    \u002F\u002F Only listen to events in current Blueprint\n    this.eventBus.subscribe('task.created')\n      .pipe(\n        filter(event => event.blueprintId === this.blueprintId()),\n        takeUntilDestroyed(this.destroyRef)\n      )\n      .subscribe(event => {\n        this.tasks.update(tasks => [...tasks, event.data]);\n      });\n    \n    \u002F\u002F Listen to updates\n    this.eventBus.subscribe('task.updated')\n      .pipe(\n        filter(event => event.blueprintId === this.blueprintId()),\n        takeUntilDestroyed(this.destroyRef)\n      )\n      .subscribe(event => {\n        this.tasks.update(tasks =>\n          tasks.map(t => t.id === event.data.id ? event.data : t)\n        );\n      });\n    \n    \u002F\u002F Listen to deletions\n    this.eventBus.subscribe('task.deleted')\n      .pipe(\n        filter(event => event.blueprintId === this.blueprintId()),\n        takeUntilDestroyed(this.destroyRef)\n      )\n      .subscribe(event => {\n        this.tasks.update(tasks =>\n          tasks.filter(t => t.id !== event.data.id)\n        );\n      });\n  }\n}\n```\n\n### Multiple Event Types\n\n```typescript\nimport { merge } from 'rxjs';\n\nngOnInit(): void {\n  \u002F\u002F Listen to multiple event types\n  merge(\n    this.eventBus.subscribe('task.created'),\n    this.eventBus.subscribe('task.updated'),\n    this.eventBus.subscribe('task.deleted')\n  )\n    .pipe(\n      filter(event => event.blueprintId === this.blueprintId()),\n      takeUntilDestroyed(this.destroyRef)\n    )\n    .subscribe(event => {\n      console.log('Task event:', event.type, event.data);\n      this.refreshTasks();\n    });\n}\n```\n\n## Common Use Cases\n\n### 1. Audit Logging\n\n```typescript\n@Injectable({ providedIn: 'root' })\nexport class AuditLogService {\n  private eventBus = inject(BlueprintEventBus);\n  private auditLogRepository = inject(AuditLogRepository);\n  \n  constructor() {\n    \u002F\u002F Listen to ALL events for audit trail\n    this.eventBus.subscribeAll()\n      .pipe(takeUntilDestroyed())\n      .subscribe(event => {\n        this.logEvent(event);\n      });\n  }\n  \n  private async logEvent(event: BlueprintEvent): Promise\u003Cvoid> {\n    await this.auditLogRepository.create({\n      eventType: event.type,\n      blueprintId: event.blueprintId,\n      actor: event.actor,\n      timestamp: event.timestamp,\n      data: event.data,\n      metadata: event.metadata\n    });\n  }\n}\n```\n\n### 2. Notification System\n\n```typescript\n@Injectable({ providedIn: 'root' })\nexport class NotificationService {\n  private eventBus = inject(BlueprintEventBus);\n  private notificationRepository = inject(NotificationRepository);\n  \n  constructor() {\n    \u002F\u002F Listen to events that trigger notifications\n    this.setupNotificationListeners();\n  }\n  \n  private setupNotificationListeners(): void {\n    \u002F\u002F Task assigned → notify assignee\n    this.eventBus.subscribe('task.assigned')\n      .pipe(takeUntilDestroyed())\n      .subscribe(async event => {\n        await this.notifyUser(event.data.assignee, {\n          title: 'New Task Assigned',\n          message: `You have been assigned: ${event.data.task.title}`,\n          blueprintId: event.blueprintId\n        });\n      });\n    \n    \u002F\u002F Member added → notify member\n    this.eventBus.subscribe('member.added')\n      .pipe(takeUntilDestroyed())\n      .subscribe(async event => {\n        await this.notifyUser(event.data.userId, {\n          title: 'Added to Blueprint',\n          message: `You have been added to ${event.data.blueprintName}`,\n          blueprintId: event.blueprintId\n        });\n      });\n  }\n}\n```\n\n### 3. Real-time UI Updates\n\n```typescript\n@Component({\n  selector: 'app-activity-feed',\n  template: `\n    \u003Cdiv class=\"activity-feed\">\n      @for (activity of activities(); track activity.id) {\n        \u003Cdiv class=\"activity-item\">\n          \u003Cspan class=\"timestamp\">{{ activity.timestamp | date }}\u003C\u002Fspan>\n          \u003Cspan class=\"message\">{{ activity.message }}\u003C\u002Fspan>\n        \u003C\u002Fdiv>\n      }\n    \u003C\u002Fdiv>\n  `\n})\nexport class ActivityFeedComponent {\n  private eventBus = inject(BlueprintEventBus);\n  private destroyRef = inject(DestroyRef);\n  \n  blueprintId = input.required\u003Cstring>();\n  activities = signal\u003CActivity[]>([]);\n  \n  ngOnInit(): void {\n    \u002F\u002F Listen to all events in Blueprint\n    this.eventBus.subscribeAll()\n      .pipe(\n        filter(event => event.blueprintId === this.blueprintId()),\n        takeUntilDestroyed(this.destroyRef)\n      )\n      .subscribe(event => {\n        this.addActivity({\n          id: crypto.randomUUID(),\n          type: event.type,\n          message: this.formatEventMessage(event),\n          timestamp: event.timestamp\n        });\n      });\n  }\n  \n  private formatEventMessage(event: BlueprintEvent): string {\n    switch (event.type) {\n      case 'task.created':\n        return `Task \"${event.data.title}\" was created`;\n      case 'task.assigned':\n        return `Task assigned to ${event.data.assignee}`;\n      case 'member.added':\n        return `${event.data.userName} joined the Blueprint`;\n      default:\n        return `Event: ${event.type}`;\n    }\n  }\n  \n  private addActivity(activity: Activity): void {\n    this.activities.update(activities => [activity, ...activities].slice(0, 50));\n  }\n}\n```\n\n### 4. Workflow Orchestration\n\n```typescript\n@Injectable({ providedIn: 'root' })\nexport class TaskWorkflowService {\n  private eventBus = inject(BlueprintEventBus);\n  private taskRepository = inject(TaskRepository);\n  private notificationService = inject(NotificationService);\n  \n  constructor() {\n    this.setupWorkflows();\n  }\n  \n  private setupWorkflows(): void {\n    \u002F\u002F When task is completed → trigger follow-up actions\n    this.eventBus.subscribe('task.completed')\n      .pipe(takeUntilDestroyed())\n      .subscribe(async event => {\n        const task = event.data;\n        \n        \u002F\u002F 1. Check if task has dependencies\n        const dependentTasks = await this.taskRepository\n          .findDependentTasks(task.id);\n        \n        \u002F\u002F 2. Update dependent tasks\n        for (const depTask of dependentTasks) {\n          await this.taskRepository.update(depTask.id, {\n            status: 'ready'\n          });\n        }\n        \n        \u002F\u002F 3. Notify stakeholders\n        await this.notificationService.notifyTaskCompletion(task);\n      });\n  }\n}\n```\n\n## Event Bus Service Implementation\n\nReference implementation:\n\n```typescript\nimport { Injectable } from '@angular\u002Fcore';\nimport { Subject, Observable } from 'rxjs';\nimport { filter } from 'rxjs\u002Foperators';\n\nexport interface BlueprintEvent\u003CT = any> {\n  type: string;\n  blueprintId: string;\n  timestamp: Date;\n  actor: string;\n  data: T;\n  metadata?: Record\u003Cstring, any>;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class BlueprintEventBus {\n  private eventStream = new Subject\u003CBlueprintEvent>();\n  \n  \u002F**\n   * Publish event to all subscribers\n   *\u002F\n  publish\u003CT = any>(event: BlueprintEvent\u003CT>): void {\n    this.eventStream.next(event);\n  }\n  \n  \u002F**\n   * Subscribe to specific event type\n   *\u002F\n  subscribe\u003CT = any>(eventType: string): Observable\u003CBlueprintEvent\u003CT>> {\n    return this.eventStream.asObservable().pipe(\n      filter(event => event.type === eventType)\n    );\n  }\n  \n  \u002F**\n   * Subscribe to all events\n   *\u002F\n  subscribeAll(): Observable\u003CBlueprintEvent> {\n    return this.eventStream.asObservable();\n  }\n  \n  \u002F**\n   * Subscribe to events in specific Blueprint\n   *\u002F\n  subscribeToBlueprintEvents(blueprintId: string): Observable\u003CBlueprintEvent> {\n    return this.eventStream.asObservable().pipe(\n      filter(event => event.blueprintId === blueprintId)\n    );\n  }\n}\n```\n\n## Testing EventBus Integration\n\n```typescript\ndescribe('EventBus Integration', () => {\n  let eventBus: BlueprintEventBus;\n  let taskService: TaskService;\n  \n  beforeEach(() => {\n    eventBus = TestBed.inject(BlueprintEventBus);\n    taskService = TestBed.inject(TaskService);\n  });\n  \n  it('should publish event when task is created', (done) => {\n    \u002F\u002F Subscribe to event\n    eventBus.subscribe('task.created').subscribe(event => {\n      expect(event.type).toBe('task.created');\n      expect(event.data.title).toBe('Test Task');\n      done();\n    });\n    \n    \u002F\u002F Create task (triggers event)\n    taskService.createTask('blueprint1', { title: 'Test Task' });\n  });\n  \n  it('should filter events by Blueprint', (done) => {\n    let receivedEvents = 0;\n    \n    eventBus.subscribeAll()\n      .pipe(filter(event => event.blueprintId === 'blueprint1'))\n      .subscribe(() => {\n        receivedEvents++;\n      });\n    \n    \u002F\u002F Publish events to different Blueprints\n    eventBus.publish({\n      type: 'task.created',\n      blueprintId: 'blueprint1',\n      timestamp: new Date(),\n      actor: 'user1',\n      data: {}\n    });\n    \n    eventBus.publish({\n      type: 'task.created',\n      blueprintId: 'blueprint2',\n      timestamp: new Date(),\n      actor: 'user1',\n      data: {}\n    });\n    \n    setTimeout(() => {\n      expect(receivedEvents).toBe(1);\n      done();\n    }, 100);\n  });\n});\n```\n\n## Checklist\n\nWhen integrating EventBus:\n\n- [ ] Events follow naming convention ([module].[action])\n- [ ] Events include blueprintId\n- [ ] Events include timestamp and actor\n- [ ] Subscriptions use takeUntilDestroyed()\n- [ ] Filter events by Blueprint when needed\n- [ ] Use typed events for type safety\n- [ ] Publish events AFTER successful operations\n- [ ] Don't use EventBus for request-response\n- [ ] Test event publishing and subscription\n- [ ] Document event types and data structures\n\n## References\n\n- [Architecture Guide](.github\u002Finstructions\u002Fng-ng-events(GigHub)-architecture.instructions.md)\n- [Blueprint Integration](.\u002Fblueprint-integration\u002FSKILL.md)\n- [Global Event Bus Documentation](docs\u002F⭐️\u002FGlobal Event Bus.md)\n","# BlueprintEventBus Integration Skill\n\nThis skill helps implement event-driven architecture using BlueprintEventBus.\n\n## Core Principles\n\n### Event-Driven Architecture\n- **Decoupling**: Modules communicate via events, not direct calls\n- **Blueprint Context**: All events include Blueprint information\n- **Type Safety**: Events are strongly typed with TypeScript\n- **Lifecycle Management**: Automatic subscription cleanup\n\n### When to Use EventBus\n\n✅ **DO use EventBus for:**\n- Cross-module communication\n- Broadcasting state changes to multiple listeners\n- Audit logging and activity tracking\n- Notification triggers\n- Workflow orchestration\n\n❌ **DON'T use EventBus for:**\n- Simple parent-child component communication (use @Output)\n- Direct service-to-service calls within same module\n- Synchronous data fetching\n- Request-response patterns (use Services)\n\n## Event Structure\n\n### Base Event Interface\n\n```typescript\ninterface BlueprintEvent\u003CT = any> {\n  type: string; \u002F\u002F Format: [module].[action]\n  blueprintId: string;\n  timestamp: Date;\n  actor: string; \u002F\u002F User ID who triggered event\n  data: T;\n  metadata?: Record\u003Cstring, any>;\n}\n```\n\n### Event Naming Convention\n\n```\n[module].[action]\n```\n\nExamples:\n- `task.created`\n- `task.updated`\n- `task.deleted`\n- `task.assigned`\n- `member.added`\n- `member.removed`\n- `file.uploaded`\n- `blueprint.archived`\n\n## Publishing Events\n\n### Basic Event Publishing\n\n```typescript\nimport { inject } from '@angular\u002Fcore';\nimport { BlueprintEventBus } from '@core\u002Fservices\u002Fblueprint-event-bus.service';\n\n@Injectable({ providedIn: 'root' })\nexport class TaskService {\n  private eventBus = inject(BlueprintEventBus);\n  private taskRepository = inject(TaskRepository);\n  \n  async createTask(blueprintId: string, task: CreateTaskDto): Promise\u003CTask> {\n    \u002F\u002F 1. Execute business logic\n    const created = await this.taskRepository.create(blueprintId, task);\n    \n    \u002F\u002F 2. Publish domain event\n    this.eventBus.publish({\n      type: 'task.created',\n      blueprintId,\n      timestamp: new Date(),\n      actor: this.getCurrentUserId(),\n      data: created\n    });\n    \n    return created;\n  }\n  \n  async updateTask(taskId: string, updates: Partial\u003CTask>): Promise\u003CTask> {\n    const task = await this.taskRepository.findById(taskId);\n    if (!task) throw new Error('Task not found');\n    \n    const updated = await this.taskRepository.update(taskId, updates);\n    \n    \u002F\u002F Publish update event with before\u002Fafter data\n    this.eventBus.publish({\n      type: 'task.updated',\n      blueprintId: task.blueprintId,\n      timestamp: new Date(),\n      actor: this.getCurrentUserId(),\n      data: updated,\n      metadata: {\n        before: task,\n        changes: updates\n      }\n    });\n    \n    return updated;\n  }\n}\n```\n\n### Typed Event Publishing\n\n```typescript\n\u002F\u002F Define event types\ninterface TaskCreatedEvent extends BlueprintEvent\u003CTask> {\n  type: 'task.created';\n}\n\ninterface TaskAssignedEvent extends BlueprintEvent\u003C{\n  task: Task;\n  assignee: string;\n  assigneeType: 'user' | 'team' | 'partner';\n}> {\n  type: 'task.assigned';\n}\n\n\u002F\u002F Publish with type safety\nthis.eventBus.publish\u003CTaskCreatedEvent>({\n  type: 'task.created',\n  blueprintId: created.blueprintId,\n  timestamp: new Date(),\n  actor: this.getCurrentUserId(),\n  data: created\n});\n```\n\n## Subscribing to Events\n\n### Basic Subscription\n\n```typescript\nimport { Component, inject, signal, DestroyRef } from '@angular\u002Fcore';\nimport { takeUntilDestroyed } from '@angular\u002Fcore\u002Frxjs-interop';\nimport { BlueprintEventBus } from '@core\u002Fservices\u002Fblueprint-event-bus.service';\n\n@Component({\n  selector: 'app-task-list',\n  template: `...`\n})\nexport class TaskListComponent {\n  private eventBus = inject(BlueprintEventBus);\n  private destroyRef = inject(DestroyRef);\n  \n  tasks = signal\u003CTask[]>([]);\n  \n  ngOnInit(): void {\n    \u002F\u002F Subscribe to task.created events\n    this.eventBus.subscribe('task.created')\n      .pipe(takeUntilDestroyed(this.destroyRef))\n      .subscribe(event => {\n        console.log('New task created:', event.data);\n        this.tasks.update(tasks => [...tasks, event.data]);\n      });\n  }\n}\n```\n\n### Filtered Subscription (Blueprint-specific)\n\n```typescript\nimport { filter } from 'rxjs\u002Foperators';\n\n@Component({\n  selector: 'app-blueprint-tasks',\n  template: `...`\n})\nexport class BlueprintTasksComponent {\n  private eventBus = inject(BlueprintEventBus);\n  private destroyRef = inject(DestroyRef);\n  \n  blueprintId = input.required\u003Cstring>();\n  tasks = signal\u003CTask[]>([]);\n  \n  ngOnInit(): void {\n    \u002F\u002F Only listen to events in current Blueprint\n    this.eventBus.subscribe('task.created')\n      .pipe(\n        filter(event => event.blueprintId === this.blueprintId()),\n        takeUntilDestroyed(this.destroyRef)\n      )\n      .subscribe(event => {\n        this.tasks.update(tasks => [...tasks, event.data]);\n      });\n    \n    \u002F\u002F Listen to updates\n    this.eventBus.subscribe('task.updated')\n      .pipe(\n        filter(event => event.blueprintId === this.blueprintId()),\n        takeUntilDestroyed(this.destroyRef)\n      )\n      .subscribe(event => {\n        this.tasks.update(tasks =>\n          tasks.map(t => t.id === event.data.id ? event.data : t)\n        );\n      });\n    \n    \u002F\u002F Listen to deletions\n    this.eventBus.subscribe('task.deleted')\n      .pipe(\n        filter(event => event.blueprintId === this.blueprintId()),\n        takeUntilDestroyed(this.destroyRef)\n      )\n      .subscribe(event => {\n        this.tasks.update(tasks =>\n          tasks.filter(t => t.id !== event.data.id)\n        );\n      });\n  }\n}\n```\n\n### Multiple Event Types\n\n```typescript\nimport { merge } from 'rxjs';\n\nngOnInit(): void {\n  \u002F\u002F Listen to multiple event types\n  merge(\n    this.eventBus.subscribe('task.created'),\n    this.eventBus.subscribe('task.updated'),\n    this.eventBus.subscribe('task.deleted')\n  )\n    .pipe(\n      filter(event => event.blueprintId === this.blueprintId()),\n      takeUntilDestroyed(this.destroyRef)\n    )\n    .subscribe(event => {\n      console.log('Task event:', event.type, event.data);\n      this.refreshTasks();\n    });\n}\n```\n\n## Common Use Cases\n\n### 1. Audit Logging\n\n```typescript\n@Injectable({ providedIn: 'root' })\nexport class AuditLogService {\n  private eventBus = inject(BlueprintEventBus);\n  private auditLogRepository = inject(AuditLogRepository);\n  \n  constructor() {\n    \u002F\u002F Listen to ALL events for audit trail\n    this.eventBus.subscribeAll()\n      .pipe(takeUntilDestroyed())\n      .subscribe(event => {\n        this.logEvent(event);\n      });\n  }\n  \n  private async logEvent(event: BlueprintEvent): Promise\u003Cvoid> {\n    await this.auditLogRepository.create({\n      eventType: event.type,\n      blueprintId: event.blueprintId,\n      actor: event.actor,\n      timestamp: event.timestamp,\n      data: event.data,\n      metadata: event.metadata\n    });\n  }\n}\n```\n\n### 2. Notification System\n\n```typescript\n@Injectable({ providedIn: 'root' })\nexport class NotificationService {\n  private eventBus = inject(BlueprintEventBus);\n  private notificationRepository = inject(NotificationRepository);\n  \n  constructor() {\n    \u002F\u002F Listen to events that trigger notifications\n    this.setupNotificationListeners();\n  }\n  \n  private setupNotificationListeners(): void {\n    \u002F\u002F Task assigned → notify assignee\n    this.eventBus.subscribe('task.assigned')\n      .pipe(takeUntilDestroyed())\n      .subscribe(async event => {\n        await this.notifyUser(event.data.assignee, {\n          title: 'New Task Assigned',\n          message: `You have been assigned: ${event.data.task.title}`,\n          blueprintId: event.blueprintId\n        });\n      });\n    \n    \u002F\u002F Member added → notify member\n    this.eventBus.subscribe('member.added')\n      .pipe(takeUntilDestroyed())\n      .subscribe(async event => {\n        await this.notifyUser(event.data.userId, {\n          title: 'Added to Blueprint',\n          message: `You have been added to ${event.data.blueprintName}`,\n          blueprintId: event.blueprintId\n        });\n      });\n  }\n}\n```\n\n### 3. Real-time UI Updates\n\n```typescript\n@Component({\n  selector: 'app-activity-feed',\n  template: `\n    \u003Cdiv class=\"activity-feed\">\n      @for (activity of activities(); track activity.id) {\n        \u003Cdiv class=\"activity-item\">\n          \u003Cspan class=\"timestamp\">{{ activity.timestamp | date }}\u003C\u002Fspan>\n          \u003Cspan class=\"message\">{{ activity.message }}\u003C\u002Fspan>\n        \u003C\u002Fdiv>\n      }\n    \u003C\u002Fdiv>\n  `\n})\nexport class ActivityFeedComponent {\n  private eventBus = inject(BlueprintEventBus);\n  private destroyRef = inject(DestroyRef);\n  \n  blueprintId = input.required\u003Cstring>();\n  activities = signal\u003CActivity[]>([]);\n  \n  ngOnInit(): void {\n    \u002F\u002F Listen to all events in Blueprint\n    this.eventBus.subscribeAll()\n      .pipe(\n        filter(event => event.blueprintId === this.blueprintId()),\n        takeUntilDestroyed(this.destroyRef)\n      )\n      .subscribe(event => {\n        this.addActivity({\n          id: crypto.randomUUID(),\n          type: event.type,\n          message: this.formatEventMessage(event),\n          timestamp: event.timestamp\n        });\n      });\n  }\n  \n  private formatEventMessage(event: BlueprintEvent): string {\n    switch (event.type) {\n      case 'task.created':\n        return `Task \"${event.data.title}\" was created`;\n      case 'task.assigned':\n        return `Task assigned to ${event.data.assignee}`;\n      case 'member.added':\n        return `${event.data.userName} joined the Blueprint`;\n      default:\n        return `Event: ${event.type}`;\n    }\n  }\n  \n  private addActivity(activity: Activity): void {\n    this.activities.update(activities => [activity, ...activities].slice(0, 50));\n  }\n}\n```\n\n### 4. Workflow Orchestration\n\n```typescript\n@Injectable({ providedIn: 'root' })\nexport class TaskWorkflowService {\n  private eventBus = inject(BlueprintEventBus);\n  private taskRepository = inject(TaskRepository);\n  private notificationService = inject(NotificationService);\n  \n  constructor() {\n    this.setupWorkflows();\n  }\n  \n  private setupWorkflows(): void {\n    \u002F\u002F When task is completed → trigger follow-up actions\n    this.eventBus.subscribe('task.completed')\n      .pipe(takeUntilDestroyed())\n      .subscribe(async event => {\n        const task = event.data;\n        \n        \u002F\u002F 1. Check if task has dependencies\n        const dependentTasks = await this.taskRepository\n          .findDependentTasks(task.id);\n        \n        \u002F\u002F 2. Update dependent tasks\n        for (const depTask of dependentTasks) {\n          await this.taskRepository.update(depTask.id, {\n            status: 'ready'\n          });\n        }\n        \n        \u002F\u002F 3. Notify stakeholders\n        await this.notificationService.notifyTaskCompletion(task);\n      });\n  }\n}\n```\n\n## Event Bus Service Implementation\n\nReference implementation:\n\n```typescript\nimport { Injectable } from '@angular\u002Fcore';\nimport { Subject, Observable } from 'rxjs';\nimport { filter } from 'rxjs\u002Foperators';\n\nexport interface BlueprintEvent\u003CT = any> {\n  type: string;\n  blueprintId: string;\n  timestamp: Date;\n  actor: string;\n  data: T;\n  metadata?: Record\u003Cstring, any>;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class BlueprintEventBus {\n  private eventStream = new Subject\u003CBlueprintEvent>();\n  \n  \u002F**\n   * Publish event to all subscribers\n   *\u002F\n  publish\u003CT = any>(event: BlueprintEvent\u003CT>): void {\n    this.eventStream.next(event);\n  }\n  \n  \u002F**\n   * Subscribe to specific event type\n   *\u002F\n  subscribe\u003CT = any>(eventType: string): Observable\u003CBlueprintEvent\u003CT>> {\n    return this.eventStream.asObservable().pipe(\n      filter(event => event.type === eventType)\n    );\n  }\n  \n  \u002F**\n   * Subscribe to all events\n   *\u002F\n  subscribeAll(): Observable\u003CBlueprintEvent> {\n    return this.eventStream.asObservable();\n  }\n  \n  \u002F**\n   * Subscribe to events in specific Blueprint\n   *\u002F\n  subscribeToBlueprintEvents(blueprintId: string): Observable\u003CBlueprintEvent> {\n    return this.eventStream.asObservable().pipe(\n      filter(event => event.blueprintId === blueprintId)\n    );\n  }\n}\n```\n\n## Testing EventBus Integration\n\n```typescript\ndescribe('EventBus Integration', () => {\n  let eventBus: BlueprintEventBus;\n  let taskService: TaskService;\n  \n  beforeEach(() => {\n    eventBus = TestBed.inject(BlueprintEventBus);\n    taskService = TestBed.inject(TaskService);\n  });\n  \n  it('should publish event when task is created', (done) => {\n    \u002F\u002F Subscribe to event\n    eventBus.subscribe('task.created').subscribe(event => {\n      expect(event.type).toBe('task.created');\n      expect(event.data.title).toBe('Test Task');\n      done();\n    });\n    \n    \u002F\u002F Create task (triggers event)\n    taskService.createTask('blueprint1', { title: 'Test Task' });\n  });\n  \n  it('should filter events by Blueprint', (done) => {\n    let receivedEvents = 0;\n    \n    eventBus.subscribeAll()\n      .pipe(filter(event => event.blueprintId === 'blueprint1'))\n      .subscribe(() => {\n        receivedEvents++;\n      });\n    \n    \u002F\u002F Publish events to different Blueprints\n    eventBus.publish({\n      type: 'task.created',\n      blueprintId: 'blueprint1',\n      timestamp: new Date(),\n      actor: 'user1',\n      data: {}\n    });\n    \n    eventBus.publish({\n      type: 'task.created',\n      blueprintId: 'blueprint2',\n      timestamp: new Date(),\n      actor: 'user1',\n      data: {}\n    });\n    \n    setTimeout(() => {\n      expect(receivedEvents).toBe(1);\n      done();\n    }, 100);\n  });\n});\n```\n\n## Checklist\n\nWhen integrating EventBus:\n\n- [ ] Events follow naming convention ([module].[action])\n- [ ] Events include blueprintId\n- [ ] Events include timestamp and actor\n- [ ] Subscriptions use takeUntilDestroyed()\n- [ ] Filter events by Blueprint when needed\n- [ ] Use typed events for type safety\n- [ ] Publish events AFTER successful operations\n- [ ] Don't use EventBus for request-response\n- [ ] Test event publishing and subscription\n- [ ] Document event types and data structures\n\n## References\n\n- [Architecture Guide](.github\u002Finstructions\u002Fng-ng-events(GigHub)-architecture.instructions.md)\n- [Blueprint Integration](.\u002Fblueprint-integration\u002FSKILL.md)\n- [Global Event Bus Documentation](docs\u002F⭐️\u002FGlobal Event Bus.md)\n",{"name":5,"license":15,"description":7},"master","63f17866001c5ca854bf2fa0b678ce277133de5b","skills\u002Fmarketplace\u002Fblueprinteventbus-integration",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill blueprinteventbus-integration",{"tool":40,"command":41},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill blueprinteventbus-integration",{"tool":43,"command":44},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill blueprinteventbus-integration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fblueprinteventbus-integration\u002FSKILL.md",true,[48],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"skill-report.json","REFERENCE","参考文档",49800,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fblueprinteventbus-integration\u002Fskill-report.json",[55,63,70,77,84,91],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":62},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":62},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":62},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":62},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":62},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":62},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]