Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Many Brain One Task?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/colinmollenhour-many-brain-one-task-dotfiles)
---
name: many-brain-one-task
user-invocable: false
description: 'Run the same task with multiple agents for reviews, critiques, or model comparison.'
allowed-tools: Read, Write, Agent, Bash(bun *), Bash(cr *), Bash(pi *), Bash(grok *), Bash(claude *), Bash(codex *), Bash(botctl *), Bash(opencode *), Bash(which *), Bash(command -v *), Bash(curl *), Bash(jq *), Bash(mkdir *), Bash(cp *)
---
# Many Brain One Task
Solicit independent opinions from multiple models. **Parent session is a thin control plane** — disk under `.tmp/<run-id>/` is durable memory. Do **not** invent per-run launch/harvest scripts; use the bundled drivers.
Full harness matrices, retry policy, sandbox gotchas, and delivery contracts: [reference.md](reference.md).
## Default flow
1. **Resolve participants** from `--profile X`, task type (`code-review`), or [defaults.md](defaults.md) / [code-review.md](code-review.md). Write `.tmp/<run-id>/participants.json`.
2. **Init run dir**
```bash
bun "${CLAUDE_SKILL_DIR}/mbot-run.ts" init --run-dir .tmp/<run-id>
```
3. **Write prompts** under `prompts/`. For role fan-out use:
```bash
bun "${CLAUDE_SKILL_DIR}/assemble-prompts.ts" \
--append .tmp/<run-id>/context/bucket-index.md \
--out-dir .tmp/<run-id>/prompts \
.tmp/<run-id>/context/role-state.md:b1-state.full.md \
…
```
Repeated `--append` is cumulative. Discovery outputs also get [roles/issue-form.md](roles/issue-form.md) automatically (skipped for merits).
Role templates for ultra: [roles/](roles/).
4. **Write `plan.json`** with one entry per harness-owned slot (`opencode` / `grok`; `occtl` is a legacy alias of `opencode`). Native Claude `Agent` slots use `harness: "external"` — launch those via the Agent tool yourself; still list them so harvest scores their `.out`. **On an OpenCode host there are no `external` slots**: every participant, Claude models included, is an `opencode` slot with a `colin-mbot-*` agent.
5. **OpenCode preflight + launch + harvest.** `mbot-run` speaks HTTP for both generations: OpenCode 2 on `/api`, OpenCode 1 on `/session` and `/config/providers`. Do not drive OpenCode from this skill.
```bash
# Optional explicit preflight (launch probes automatically when slots use opencode).
# Default is an HTTP/binary probe; add --deep for a real model round trip.
bun "${CLAUDE_SKILL_DIR}/mbot-run.ts" smoke \
--run-dir .tmp/<run-id> \
--attach http://127.0.0.1:4096 \
--model openai/gpt-6.1-sol
bun "${CLAUDE_SKILL_DIR}/mbot-run.ts" launch --plan .tmp/<run-id>/plan.json --detach
bun "${CLAUDE_SKILL_DIR}/mbot-run.ts" barrier --run-dir .tmp/<run-id>
bun "${CLAUDE_SKILL_DIR}/mbot-run.ts" harvest --run-dir .tmp/<run-id>
bun "${CLAUDE_SKILL_DIR}/mbot-run.ts" candidates --run-dir .tmp/<run-id>
bun "${CLAUDE_SKILL_DIR}/mbot-run.ts" usage --run-dir .tmp/<run-id>
```
Use `launch --detach` then `barrier` for multi-slot or long-running plans on every host. A shell timeout can interrupt a blocking launch before server cleanup. A blocking single-wave launch needs a host Bash timeout longer than its slot budget. `barrier` exits nonzero when any slot failed or the launcher died.
Plan knobs: `"concurrency": 3` (default when OpenCode attach is used), `"opencode_mode": "auto"|"attach"|"local"|"skip"`, `"attach": "http://127.0.0.1:4096"` (keeps attach mode). Already-set `OPENCODE_SERVER_HOST` / `OPENCODE_SERVER_PORT` / `OPENCODE_SERVER_PASSWORD` win over that attach URL. GPT OpenCode slots default `--variant high` and `--agent colin-mbot-gpt-sol`; **every other family must set `"agent"` and `"model"` on the slot** (`colin-mbot-opus` + `anthropic/claude-opus-5-5`, `colin-mbot-grok` + `xai/grok-4.7`, …). Prompt/out may be `prompts/x.md` or `.tmp/<id>/prompts/x.md` — do not double-prefix. Further launches **merge** into `plan.json` (they do not clobber prior slots).
Local OpenCode server readiness defaults to 30 seconds; set `"opencode_ready_timeout_ms"` on the plan or a slot when cold starts need longer.
Direct Grok CLI slots pin `grok-4.7`, allow 20 minutes each by default, and use concurrency 2 when no other harness sets the default. Use `"grok_timeout_ms"` on the plan or `"timeout_ms"` on a slot to override. Omit `barrier --timeout-ms` to let it budget all concurrency waves. If the Grok CLI is unauthenticated, use an OpenCode slot with `xai/grok-4.7` until CLI login is restored.
Meta records `actual_harness` (`opencode-v1` or `opencode-v2`, never the `occtl` alias), `attach_mode`, `actual_model`, `started_at`, `ended_at`, `wall_ms`, `session_id`, `session_file`, and `cost_usd` (Grok JSON, or the OpenCode session cost). Harvest salvages a timed-out session from its latest assistant message and **must not** overwrite per-slot `ended_at`.
6. **Summarize from disk** — read `harvest.json` / `results/*.meta.json` / `agentsview-usage.json` only. Never paste full `.out` bodies into chat. Attribute via `meta.actual_model`. `mbot-run usage` talks to agentsview over `AGENTSVIEW_URL` (HTTP) when the CLI is not on PATH.
## OpenCode reliability (hard)
1. **All flags before `--`** in every OpenCode invocation. After `--` is only the harness footer text.
2. **Preflight before fan-out** — `launch` probes the attach server (OpenCode 2: `GET /api/info` and `GET /api/model`; OpenCode 1: `GET /config/providers`) or, locally, `opencode --version`; no model call unless `"smoke_deep": true`. `/config/providers` on a v2 server is the web UI, not the catalog. Unreachable attach → local spawn; neither → OpenCode slots fail-closed (`opencode_mode=skip`). A slot whose attach run can't connect re-runs locally once (`meta.attach_fallback`) and later slots skip attach, unless `opencode_mode` is `attach`.
3. **Never wait on `test -s empty.out`** and never `sleep N; rg VERDICT`. Use `mbot-run barrier`.
4. **Cap attach concurrency** (default 3) to avoid shared-server stalls.
5. **Pin model ids** from the attach catalog (`/api/model` on v2, `/config/providers` on v1) when available (`openai/gpt-6.1-sol` preferred when listed).
6. **OpenCode host `launch --detach`** (new process group). Wrapping a blocking launch in the default 120s bash tool kills the batch. Claude Code keeps blocking launch.
## Host harness routing (hard)
- **Claude Code host:** Claude participants use the native `Agent` tool (then `botctl prompt`, then `claude` CLI); everything else goes through `mbot-run`.
- **OpenCode host: keep everything inside OpenCode.** Every participant — Claude included — is an `mbot-run` slot with a `colin-mbot-*` agent. Do not shell out to `claude` / `botctl` / `grok`, and do not use the OpenCode `task` tool for participant slots. Shell-outs only when the profile pins a CLI or the agent file is missing from `~/.opencode/agents/`. A containerised host may not ship `grok` / `botctl` / `pi` at all — `command -v` before planning a CLI route.
## Built-in defaults (when no profile)
- Opus @ high effort (Claude host: native Agent / botctl / claude CLI — OpenCode host: `colin-mbot-opus`)
- GPT via OpenCode @ high
- Grok @ high (Claude host: `grok` CLI — OpenCode host or missing CLI: `colin-mbot-grok`)
- Backup: **Grok only** — no experimental models unless the user names them
## Delivery contracts (do not mix)
| Owner | Mechanisms | Body |
|---|---|---|
| **Harness-owned** | `mbot-run` (OpenCode + Grok) | Full review = final assistant message / stdout. Harness writes `--out`. |
| **Agent-owned** | Native Claude `Agent` only | Child **Write**s full body to slot path; returns ≤500-char status |
Never tell OpenCode/Grok to Write the harness `--out` path.
## OpenCode single-slot fallback
One OpenCode participant still goes through `mbot-run` (a one-slot `plan.json`). Do not drive that session yourself — that skips harvest and timeout salvage.
## Retry (summary)
Max one retry per slot; prefer profile backup over second same-model retry. New `--out` path + rewrite any baked path in the prompt. Exit 124 with rich body = success. Details: [reference.md](reference.md#retry-policy).
## Hard rules
- `.tmp/` lives **inside the project root** (OpenCode rejects paths outside it).
- Only the **orchestrator** writes `STATE.json` (mbot-run updates it; subagents never do).
- Do **not** write ad-hoc `launch-*.ts` / `harvest.ts` / `batch.ts` / `extract-issues.ts` under the run dir or `/tmp` — use `mbot-run` (`candidates` after harvest).
- Do **not** shell out to `opencode` from the parent session for MBOT slots. `mbot-run` owns the HTTP API. Timeout recovery lives in `mbot-run harvest`.