blueprinteventbus-integration
實作事件驅動架構
大型應用程式中的模組通常會變得緊密耦合,使得更新困難且容易出錯。本技能提供模式和程式碼範例,實作 BlueprintEventBus 以透過事件實現鬆散耦合。
스킬 ZIP 다운로드
Claude에서 업로드
설정 → 기능 → 스킬 → 스킬 업로드로 이동
토글을 켜고 사용 시작
테스트해 보기
"blueprinteventbus-integration" 사용 중입니다. Help me publish a task.assigned event when a user assigns a task to another team member.
예상 결과:
- Type the event payload: { type: 'task.assigned', blueprintId, actor, data: { task, assignee, assigneeType } }
- Inject BlueprintEventBus and call publish()
- Subscription triggers notifications
- Event metadata tracks assignment history
"blueprinteventbus-integration" 사용 중입니다. How do I listen for all events in a specific Blueprint?
예상 결과:
- Use subscribeToBlueprintEvents(blueprintId) method
- Filter combined with takeUntilDestroyed() for cleanup
- Handle all event types with subscribeAll() pattern
- Update UI reactively when any event occurs
"blueprinteventbus-integration" 사용 중입니다. Create an event for when a file is uploaded to the Blueprint
예상 결과:
- Event type follows [module].[action] pattern: file.uploaded
- Payload includes blueprintId, actor, and file data
- Metadata captures file size and mime type
- Subscribers can trigger processing or notifications
보안 감사
안전Documentation-only skill containing TypeScript code examples for Angular event-driven patterns. All 99 static findings are false positives triggered by pattern-matching errors: (1) Hash strings in JSON metadata (content_hash, tree_hash) flagged as weak cryptographic algorithms, (2) GitHub source_url flagged as hardcoded URL vulnerability, (3) TypeScript template literal backticks flagged as shell backtick execution, (4) Domain event names like task.assigned flagged as C2/reconnaissance keywords, and (5) Angular lifecycle hooks flagged as system reconnaissance. This is pure documentation with no executable code, network calls, file system access, or security-sensitive patterns.
위험 요인
🌐 네트워크 접근 (1)
📁 파일 시스템 액세스 (1)
⚙️ 외부 명령어 (42)
품질 점수
만들 수 있는 것
新增事件驅動模式
在 Angular 服務中實作 BlueprintEventBus,以實現模組間的解耦通訊。
標準化事件命名
建立跨團隊的 [模組].[動作] 命名慣例,以確保事件結構的一致性。
連接 UI 和後端
使用事件在後端操作完成時觸發通知並更新 UI。
이 프롬프트를 사용해 보세요
顯示如何在 Angular 服務中注入 BlueprintEventBus,並發布具有 blueprintId 和 actor 欄位的 task.created 事件。
撰寫 Angular 元件程式碼,訂閱任務事件,但只對來自特定 Blueprint 的事件做出反應,使用 input() 和 takeUntilDestroyed()。
建立 AuditLogService,在全域訂閱所有事件,並將具有完整事件中繼資料的事件記錄到儲存庫中。
實作 TaskWorkflowService,監聽 task.completed 事件,並自動更新相依任務及通知相關人員。
모범 사례
- 始終在事件中包含 blueprintId 以啟用 Blueprint 特定的過濾
- 使用 takeUntilDestroyed() 防止元件中的記憶體洩漏
- 在成功操作後發布事件以維持一致性
피하기
- 不要使用 EventBus 進行簡單的父子元件通訊;請改用 @Output
- 避免造成無限迴圈的事件循環鏈
- 不要將事件用於同步的請求-回應模式;請直接使用服務