agentleFS
GoldziherGoldziher/basemind/skills/basemind-multi-agent-room/SKILL.md

basemind-multi-agent-room

Skill125 starsChanged 48 days agoMITView on GitHub

Orchestrate a team of subagents in shared threads. Each subagent acts under its own sub-identity (`as`), reads its own inbox, and cross-checks peers by posting to threads they are members of.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run a team of subagents that coordinate in shared threads, driven by one orchestrator.

    line 19
  2. Very specific:

    All subagents of one checkout share a principal.

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- AI-RULEZ :: GENERATED FILE — DO NOT EDIT Content-Hash: blake3:d85b007c1d994f89748a775d619758e63105be84f62c2e5578ab1f193df5f526 Source-Hash: blake3:607e3840e47d250c023513008342b4e723eff1841b0530d2a109acaf0dc5dbc6 Schema-Version: v1 -->

Multi-agent thread orchestration

Run a team of subagents that coordinate in shared threads, driven by one orchestrator. Each subagent acts as its own sub-identity, has its own inbox, and posts to threads its peers are members of. The tools are agent_post, agent_inbox and agent_threads, listed separately from the others; the basemind-comms skill has the full contract.

When to use it

  • Several reviewers need to see each other's work (code review, audit, cross-validation).
  • A subagent hands findings to a peer for verification.
  • The team needs one narrative, readable as a thread history.
  • Independent work runs in parallel and is synthesized afterwards.

Identity model

All subagents of one checkout share a principal. as: "<name>" ([a-z0-9_-]{1,32}) makes the call act as <principal>.<name>: a separate read position and inbox, the same membership. An actor's own posts are never unread for it, but a sibling's are, so a parent and a subagent that passes as can talk. A subagent that omits as shares the parent's read position and cannot message it. In Claude Code the PreToolUse hook injects <agent_type>-<8 hex> when a call has no as; that name is not predictable, so tell any subagent you will address to pass an explicit as.

Setup

  1. Open a thread. Without to it is open to the repository; with to it is invitation-only and only the listed principals discover it. A sub-identity named in to makes its principal the member.

    agent_post {subject: "review-pr-42", body: "Reviewing PR 42; post findings here.",
                paths: ["src/auth/"], as: "lead"}

    The reply carries the thread id (t-abcdef).

  2. Give each subagent a name and the thread id. Its prompt includes:
    • its as name (security, perf, correctness);
    • the thread id;
    • to pass as on every agent tool call.
  3. Members join. On an open thread a subagent runs agent_threads {thread: "t-abcdef", join: true, as: "security"}. Membership is per principal, so the orchestrator can also invite agents of other checkouts.

Broadcast vs targeted hand-off

  • Thread post: everyone on the thread sees it. Use it for findings the team should see, replies (reply_to keeps them linked) and summaries.
  • Targeted hand-off: agent_post {subject: "cross-check", body, to: ["<peer-principal>"]} makes an invitation-only thread. to names principals; it cannot name only yourself. Use it to ask one peer to validate a finding.

Reading and synthesis

The orchestrator:

  1. Lets subagents post in parallel.
  2. Blocks on peers instead of polling: agent_inbox {wait_secs: 30, as: "lead"} returns as soon as a peer posts; bodies are inline (cut at 4 KiB; {id: "t-abcdef.4"} reads one whole).
  3. Reads a thread's full history: agent_inbox {thread: "t-abcdef", unread: false}.
  4. Looks without consuming: peek: true.
  5. Synthesizes the findings into a verdict or report.

Reading marks messages read for that actor only. A reply that does not fit the 16 KiB budget returns more: true; read again.

Example: security and performance cross-check

Orchestrator:

agent_post {subject: "review-auth-pr", body: "Review the diff.", as: "lead"}
# spawn "security" and "perf" with: thread id, their `as` name, the rule to pass `as` on every call

Subagent security:

agent_threads {thread: "t-abcdef", join: true, as: "security"}
agent_post {thread: "t-abcdef", body: "Parameter X is quoted; no injection.", as: "security"}
agent_inbox {as: "security"}

Subagent perf:

agent_threads {thread: "t-abcdef", join: true, as: "perf"}
agent_post {thread: "t-abcdef", body: "New validation adds ~2 ms.", as: "perf"}
agent_post {reply_to: "t-abcdef.2", body: "Sanitization looks solid.", as: "perf"}

Orchestrator synthesis:

agent_inbox {wait_secs: 30, as: "lead"}
agent_inbox {thread: "t-abcdef", unread: false, as: "lead"}

Cleanup

Archive a finished thread with agent_threads {thread, archive: true} (creator only); an archived thread cannot be posted to or reopened. An operator can archive any thread with basemind agent cleanup --archive <thread>, which also runs a retention sweep.

CLI parity

basemind agent post --body … --thread <t> --as security, basemind agent inbox --thread <t> --unread false --as lead, basemind agent threads --thread <t> --join --as perf. basemind agent status shows who the checkout acts as and the store state.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.