---
name: "agent-swarm-message-bus"
description: "Coordinate distributed agent swarms with asynchronous pub/sub event message buses."
metadata:
  author: "OpenAI Swarm"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "build agent swarm message bus"
  - "coordinate agents with pub sub"
  - "broadcast agent events"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Autonomous Agent Swarm Event Bus & State Broker

Architects multi-agent swarm messaging: publish/subscribe topics, agent task bidding, event stream persistence (Redis Streams, NATS), and deadlock detection across autonomous agent networks.

## When to Invoke
Invoke this skill whenever you need to:
- build agent swarm message bus
- coordinate agents with pub sub
- broadcast agent events

## Execution SOP & Rules
1. Use lightweight message brokers (Redis Streams, NATS) for decoupled agent communication.
2. Define strict message schemas with id, timestamp, sender, topic, and payload attributes.
3. Implement message deduplication and acknowledgement (ACK) to prevent lost task assignments.
4. Detect circular messaging loops and enforce maximum hop counts on routed agent tasks.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
