agenthub-multiagent-mcp 1.46.0 → 1.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: multiagent-brainstorm
3
+ description: Brainstorm a design with another AgentHub agent, mostly autonomously. Use when you want two agents (e.g. krishi-dev ↔ sumit-mobile) to work through a topic together — a background subagent drives each side, polling the shared session and exchanging turns, pausing for a human only on real decisions, and concluding with a structured outcome that seeds an OpenSpec change.
4
+ license: MIT
5
+ ---
6
+
7
+ # Multi-Agent Brainstorm
8
+
9
+ Two AgentHub agents brainstorm a topic through a **server-tracked session**. Each
10
+ side is driven by a **fully autonomous background subagent** that polls the
11
+ session, reasons, and posts turns — surfacing to a human only when a decision
12
+ genuinely needs one. A concluded brainstorm produces a structured outcome that
13
+ seeds an OpenSpec change.
14
+
15
+ Requires the server kill switch `AGENTHUB_BRAINSTORM_ENABLED=true` (tools return
16
+ `brainstorm_disabled` otherwise) and `agent_register` first (the tools bind to
17
+ your project). Runs on the latest Sonnet fine — no special model needed.
18
+
19
+ ## Two roles
20
+
21
+ You are one of:
22
+
23
+ - **initiator** — your human said "brainstorm X with `<peer>`". You call
24
+ `brainstorm_open`, which delivers an invite to the peer.
25
+ - **responder** — you received a `[[BRAINSTORM INVITE]]` message (via your
26
+ auto-inbox at session start, or mid-session). Call `brainstorm_accept` and
27
+ mirror the initiator.
28
+
29
+ If you got a brainstorm invite in your inbox, run the **responder** flow below.
30
+ Otherwise, if the user asked you to brainstorm with someone, run **initiator**.
31
+
32
+ ## Initiator flow
33
+
34
+ 1. `brainstorm_open({ peer, topic, escalation })` — `escalation` is `local`
35
+ (default; you'll ask your local human via a decision prompt) or `slack` (the
36
+ subagent DMs the operator and polls for the reply). Note the returned
37
+ `session_id`.
38
+ 2. **Spawn the autonomous subagent** (see below) with role `initiator`,
39
+ the `session_id`, `after_seq=0`, the topic, and your human's framing.
40
+ 3. Wait. Handle any `NEED_HUMAN` return (see *Human escalation*).
41
+ 4. When the subagent reports `concluded`, run the **Conclusion → OpenSpec** step.
42
+
43
+ ## Responder flow
44
+
45
+ 1. `brainstorm_accept({ session_id })` (idempotent — safe if the invite was
46
+ redelivered).
47
+ 2. Spawn the autonomous subagent with role `responder`, the `session_id`,
48
+ `after_seq=0`, and the topic from the invite.
49
+ 3. Handle `NEED_HUMAN` the same way. When the subagent reports `concluded`, you're
50
+ done — **only the initiator authors the OpenSpec** (avoids double-proposing).
51
+
52
+ ## The autonomous subagent
53
+
54
+ Spawn it with the `Agent` tool (background). Give it this loop, verbatim in
55
+ spirit — it holds the whole transcript in its own context so your main session
56
+ stays clean:
57
+
58
+ ```
59
+ after_seq = 0
60
+ loop:
61
+ { turns, state, turn_count } = brainstorm_poll(session_id, after_seq)
62
+ after_seq = max(seq of turns, after_seq)
63
+
64
+ if state != "active":
65
+ return { done: state } # concluded | aborted | exhausted | abandoned
66
+
67
+ peer_turns = turns authored by the OTHER agent
68
+ if peer's latest turn.kind == "propose_conclude":
69
+ if you agree with their outcome:
70
+ brainstorm_conclude(session_id, outcome) # mutual consensus
71
+ else:
72
+ brainstorm_turn(session_id, "<why not yet, what's open>")
73
+ continue
74
+
75
+ if it's your turn (peer has posted since your last, or you're the initiator on seq 0):
76
+ reason about the dialogue and form your next contribution
77
+ if a decision here really needs a human (scope, tradeoff, commitment):
78
+ return { need_human: { question, digest, after_seq } }
79
+ else:
80
+ brainstorm_turn(session_id, "<your turn>")
81
+ # when you believe you're done, post kind="propose_conclude" with a draft outcome instead
82
+ continue
83
+
84
+ # nothing new and not your move → wait for the peer
85
+ backoff sleep (start ~5s, cap ~30s), then re-poll
86
+ # if last_turn_at is older than the silence deadline, brainstorm_close(state="abandoned")
87
+ ```
88
+
89
+ **Discipline:** one contribution per turn; stay on the topic; don't rubber-stamp
90
+ — push back when the design isn't right yet; propose_conclude only when the
91
+ problem, approach, and key decisions are actually settled.
92
+
93
+ ## Human escalation (return-and-resume)
94
+
95
+ A background subagent can't ask a human directly. When it returns
96
+ `{ need_human: { question, digest, after_seq } }`:
97
+
98
+ - **`escalation=local`** — ask your human with `AskUserQuestion` (include the
99
+ `digest` for context).
100
+ - **`escalation=slack`** — `slack_dm` the operator and poll your inbox for the
101
+ reply.
102
+
103
+ Then **resume the same subagent** (SendMessage to its agent id, context intact)
104
+ with the human's answer and the `after_seq` it gave you. It posts the
105
+ human-informed turn and continues. Do **not** spawn a fresh subagent — you'd lose
106
+ the transcript.
107
+
108
+ ## Peer is a headless daemon?
109
+
110
+ Employee daemons (eng-ic, expert, …) can't run a live loop — one inbound message
111
+ is one shift. If the peer never `brainstorm_accept`s but replies via ordinary
112
+ A2A, the subagent should **fall back to async round-trips**: post a turn, then
113
+ `check_inbox`/`brainstorm_poll` on a longer cadence, one shift per turn. The
114
+ session still tracks turns; you just can't expect a mirror subagent on their end.
115
+
116
+ ## Conclusion → OpenSpec (initiator only)
117
+
118
+ On `concluded`, `brainstorm_get(session_id)` returns the structured `outcome`
119
+ (`problem`, `agreed_approach`, `key_decisions`, `open_questions`,
120
+ `suggested_change_id`, `summary`). Then:
121
+
122
+ 1. **Render the outcome to your human** and ask (via `AskUserQuestion`): author
123
+ the OpenSpec now? — matches the repo's plan-first mandate; a human verifies the
124
+ agreed design before any spec is written.
125
+ 2. On approval, invoke the **`openspec:proposal`** skill seeded from the outcome
126
+ (use `suggested_change_id` as the change id), then `openspec_publish` to sync
127
+ to AgentHub (the mandate: a change on disk only isn't done).
128
+ 3. `brainstorm_link_change(session_id, change_id)` to stamp the change onto the
129
+ session — closes the traceability loop (brainstorm → change).
130
+
131
+ ## Stopping early
132
+
133
+ Either operator can halt: `brainstorm_close({ session_id, reason })` →
134
+ `aborted`. The safety backstops (`exhausted` at `max_turns`, `abandoned` on peer
135
+ silence) fire automatically so a runaway loop or an offline peer can't hang.
136
+
137
+ ## Tool reference
138
+
139
+ `brainstorm_open` · `brainstorm_accept` · `brainstorm_turn` · `brainstorm_poll` ·
140
+ `brainstorm_conclude` · `brainstorm_close` · `brainstorm_get` ·
141
+ `brainstorm_link_change`. Full design: the `multiagent-brainstorm-design` doc;
142
+ guide: `multiagent-brainstorm-guide`.
@@ -1 +0,0 @@
1
- {"active_at":"2026-06-20T12:20:44.058Z","category":"other"}