Skill: Agent Messaging (bus local A2A)
Patrón extraído de Prime Agent (SE-347): agent_message.send(...) con roles
(parent/child/steer/follow_up) y receipts (delivered/queued), broadcast y ack.
Savia lo implementa sobre ficheros JSONL en ~/.savia/msg (CRIT-001: sin red,
sin proveedor cloud).
Authoritative Paths
Lee estos paths antes de actuar.
| Para |
Lee este path |
| Script del bus |
scripts/agent-messaging.sh |
| Colas (runtime) |
~/.savia/msg/ |
| Protocolo handoff existente |
docs/agent-notes-protocol.md |
| Lección origen |
output/research/prime-agent-eval/lecciones-prime-agent-20260827.md |
Modelo
- inbox por receptor:
~/.savia/msg/inbox/<agente>.jsonl
- ledger global:
~/.savia/msg/ledger.jsonl
- Mensaje:
{id, ts, from, to, role, message, status, ack_at}
- Receipts:
queued (ledger) → delivered (en inbox) → read (ack)
- Roles:
parent (de orquestador a subagente), child (de subagente a
orquestador), steer (redirección), follow_up (default)
Cuándo usar
- Un orquestador quiere delegar a N subagentes y recoger respuestas después
(complementa
parallel-dispatch, que recoge por fichero).
- Un agente quiere notificar a otro sin esperar su turno ni pasar por el user.
- Sustituye al handoff por notas cuando necesitas estado (leído/entregado).
Uso
# enviar (stdout = id; estado en stderr)
bash scripts/agent-messaging.sh send --to dev --role child --message "revisa la API" --from orchestrator
# broadcast a todas las inbox conocidas
bash scripts/agent-messaging.sh send --to all --broadcast --message "standup" --role steer
# listar inbox (--unread)
bash scripts/agent-messaging.sh list --inbox dev --unread
# acusar recibo (receipt -> read)
bash scripts/agent-messaging.sh ack --id <msgid> --as dev
# estado
bash scripts/agent-messaging.sh status --id <msgid>
Reglas
- CRIT-001: las colas viven en
~/.savia/msg (disco propio). Nunca en el repo.
- Un agente NO debe leer el inbox de otro (solo el suyo o el que le corresponda).
- No uses el bus para datos N3+ fuera de disco propio — el bus es local, pero el
contenido sigue sujeto a confidencialidad por nivel.
- Compatible con
agent-notes-protocol.md para handoff formal (el bus es el
canal, las notas el contenido estructurado).
Related
scripts/agent-messaging.sh · parallel-dispatch (recoger por fichero) ·
agent-notes-protocol.md (handoff formal)
1---2layer: peripheral3name: agent-messaging4description: "Usar cuando un agente debe enviar un mensaje a otro agente con roles y receipts, sin pasar por el usuario. Triggers: mensaje a otro agente, agent-message, notify agent, inbox."5metadata:6 source: https://skillmd.com/skills/gonzalezpazmonica/agent-messaging7 # --- metadata.savia.* (SE-333) ---8 savia.category: orchestration9 savia.maturity: stable10 savia.context: standalone11 savia.context_cost: low12 savia.priority: medium13 savia.tags: "messaging, agent-to-agent, a2a, receipts, orchestration"14 savia.trigger_keywords: "mensaje a agente, notify, inbox, agent-message"15---1617# Skill: Agent Messaging (bus local A2A)1819Patrón extraído de Prime Agent (SE-347): `agent_message.send(...)` con roles20(parent/child/steer/follow_up) y receipts (delivered/queued), broadcast y ack.21Savia lo implementa sobre ficheros JSONL en `~/.savia/msg` (CRIT-001: sin red,22sin proveedor cloud).2324## Authoritative Paths2526> Lee estos paths antes de actuar.2728| Para | Lee este path |29|---|---|30| Script del bus | `scripts/agent-messaging.sh` |31| Colas (runtime) | `~/.savia/msg/` |32| Protocolo handoff existente | `docs/agent-notes-protocol.md` |33| Lección origen | `output/research/prime-agent-eval/lecciones-prime-agent-20260827.md` |3435## Modelo3637- **inbox por receptor**: `~/.savia/msg/inbox/<agente>.jsonl`38- **ledger global**: `~/.savia/msg/ledger.jsonl`39- Mensaje: `{id, ts, from, to, role, message, status, ack_at}`40- Receipts: `queued` (ledger) → `delivered` (en inbox) → `read` (ack)41- Roles: `parent` (de orquestador a subagente), `child` (de subagente a42 orquestador), `steer` (redirección), `follow_up` (default)4344## Cuándo usar4546- Un orquestador quiere delegar a N subagentes y recoger respuestas después47 (complementa `parallel-dispatch`, que recoge por fichero).48- Un agente quiere notificar a otro sin esperar su turno ni pasar por el user.49- Sustituye al handoff por notas cuando necesitas *estado* (leído/entregado).5051## Uso5253```bash54# enviar (stdout = id; estado en stderr)55bash scripts/agent-messaging.sh send --to dev --role child --message "revisa la API" --from orchestrator56# broadcast a todas las inbox conocidas57bash scripts/agent-messaging.sh send --to all --broadcast --message "standup" --role steer58# listar inbox (--unread)59bash scripts/agent-messaging.sh list --inbox dev --unread60# acusar recibo (receipt -> read)61bash scripts/agent-messaging.sh ack --id <msgid> --as dev62# estado63bash scripts/agent-messaging.sh status --id <msgid>64```6566## Reglas6768- CRIT-001: las colas viven en `~/.savia/msg` (disco propio). Nunca en el repo.69- Un agente NO debe leer el inbox de otro (solo el suyo o el que le corresponda).70- No uses el bus para datos N3+ fuera de disco propio — el bus es local, pero el71 contenido sigue sujeto a confidencialidad por nivel.72- Compatible con `agent-notes-protocol.md` para handoff formal (el bus es el73 canal, las notas el contenido estructurado).7475## Related7677- `scripts/agent-messaging.sh` · `parallel-dispatch` (recoger por fichero) ·78 `agent-notes-protocol.md` (handoff formal)