collab
Skill251 starsChanged 3 months agoMITView on GitHub
Start a collaborative AI team (Codex + Claude) to work on a task together. Use when the user says "werk samen met Codex", "collab", "team onderzoek", "laat Codex en Claude samenwerken", or wants multiple AI agents to analyze, research, or solve something together autonomously.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- resonatingloop/hmmariumtheir own version, first seen Nov 8, 2026
- raine/consult-llm-mcptheir own version, first seen Oct 8, 2026
- Hokken/collab-skilltheir own version, first seen Sep 26, 2026
- dylanroscover/Embodytheir own version, first seen Sep 5, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- dylanroscover/Embody★ 213same name
- raine/consult-llm-mcp★ 148same name
- Hokken/collab-skill★ 2same name
- resonatingloop/hmmarium★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 6 are distinctive, and 12 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Language rule: ALWAYS respond in the same language the user used to invoke /collab.
- Very specific: line 20
Every script lives in __ENSEMBLE_DIR__/scripts/ and MUST be called with its full path and .sh extension.
- Very specific: line 44
All collab artifacts live in /tmp/ensemble/<TEAM_ID>/:
- Very specific: line 96
When configured, healthCommand checks which agents are currently usable and catches an unavailable CLI before launch.
- Very specific: line 99
Only pass this when the user explicitly names agents in the task (for example, "use agy and claude").
- Distinctive: line 120
Leave it empty if the task does not fit cleanly.
- Very specific: line 126
Do not read /tmp/collab-team-id.txt unless you have no launch output: it is a single global file that a concurrent collab overwrites.
- Very specific: line 129
Check that the launch actually succeeded: before doing Step 2. collab-launch.sh can fail after the team already exists: exit 3 means a team …
- Very specific: line 164
Use collab-poll.sh — a single-shot poller that tracks state automatically and gives clean output.
- Distinctive: line 178
After each poll, present the new messages to the user like this:
- Distinctive: line 184
Use markdown bold for agent names.
- Very specific: line 189
If 3+ polls QUIET: --sleep 30 (agents in deep work)
- Very specific: line 213
Run with run_in_background: true, timeout: 600000.
- Distinctive: line 215
When done: summarize + cleanup poller/bridge PIDs.
- Very specific: line 221
Explicit sentinel (preferred): EVERY active agent sends a team-say whose entire content is <<COLLAB_DONE>>.
- Distinctive: line 251
Do not modify project code during a collab session unless the user explicitly asks
- Very specific: line 252
Do not truncate or remove messages.jsonl
- Very specific: line 263
Use generic commands such as "rosterCommand": "my-brain roster".
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Collab: Autonomous AI Team Collaboration
Language rule: ALWAYS respond in the same language the user used to invoke /collab. If the user writes in English, all your output (status updates, summaries, everything) must be in English. If Dutch, respond in Dutch. Never mix languages.
For a single review, a team is often overkill; use single-agent delegation if available.
Launch a Codex + Claude team. Runtime files are namespaced under /tmp/ensemble/<TEAM_ID>/.
Script Paths
Every script lives in __ENSEMBLE_DIR__/scripts/ and MUST be called with its full path and
.sh extension. They are not on $PATH, and the permission allowlist installed by
setup-claude-code.sh only covers the full paths. Calling a bare collab-launch fails.
Set this once per session and reuse it:
ES="__ENSEMBLE_DIR__/scripts"| Script | Purpose |
collab-launch.sh | Start a team (runs preflight, opens the monitor, arms postcheck) |
collab-poll.sh | Single-shot message poll with seen-state tracking |
collab-status.sh | Dashboard of active and recent collabs |
collab-rescue.sh | Re-inject prompts when messages.jsonl stays empty |
collab-replay.sh | Replay a finished session in the terminal |
collab-livefeed.sh | Live colored feed (non-tmux) |
collab-cleanup.sh | Remove old finished runtime dirs (dry-run by default) |
open-herdr-monitor.sh | Open the monitor in a herdr pane, called by launch |
collab-preflight.sh | Auth/DNS/service checks, auto-run by launch |
collab-postcheck.sh | Agent health check ~30s after spawn, auto-armed by launch |
Path Convention
All collab artifacts live in /tmp/ensemble/<TEAM_ID>/:
messages.jsonl— agent + ensemble message logsummary.txt— written on disband by ensemble-servicebridge.pid,bridge.log— bridge processpoller.pid,feed.txt— background pollerpostcheck.log: output of the automatic post-spawn health checkprompts/,delivery/— agent prompt/delivery files.finished— written by ensemble-service AFTER summary.txtteam-id— team ID markersessions: this team's tmux session names, one per line, written by ensemble-service on every successful agent spawn; what postcheck and rescue use to only touch this team's panes
Workflow
Step 0: Detect environment
if [ "${HERDR_ENV:-}" = "1" ]; then
echo "HERDR"
elif [ -n "$TMUX" ]; then
echo "TMUX_YES"
elif [ "$(uname)" = "Darwin" ] && [ "${TERM_PROGRAM:-}" = "iTerm.app" ]; then
echo "ITERM_NATIVE"
else
echo "TMUX_NO"
fiFour monitor modes:
HERDR— inside a herdr workspace;collab-launch.shasks herdr for the splitTMUX_YES— already inside tmux;collab-launch.shopens a split pane rightITERM_NATIVE— macOS iTerm2 without tmux;collab-launch.shusesosascriptto open a native iTerm split pane (notmux attachneeded)TMUX_NO— fallback: detached tmux session the user must attach to
Check HERDR_ENV first, and never conclude "iTerm" from TERM_PROGRAM alone.
herdr owns the terminal and draws its own panes inside a host session, but passes
TERM_PROGRAM=iTerm.app straight through. An AppleScript split then opens a real iTerm
pane outside the layout the user is watching: it succeeds, reports success, and is never
seen. HERDR_ENV=1 is the reliable signal (HERDR_PANE_ID, HERDR_TAB_ID and
HERDR_WORKSPACE_ID name the exact pane).
Force a specific mode with COLLAB_MONITOR=herdr|tmux|iterm|none, change the herdr layout
with COLLAB_HERDR_MODE=split|tab, or the iTerm layout with
COLLAB_ITERM_MODE=split|tab|window (both default split).
Step 1: Launch the team
"$ES/collab-launch.sh" "$(pwd)" "$TASK_DESCRIPTION" [AGENTS] [TEMPLATE]Agent selection (3rd argument, optional). Comma-separated keys from agents.json;
the first one becomes lead. Default when omitted: codex (lead) + claude code (worker).
Available keys: codex, claude, grok, agy, gemini, glm, opencode (all defined in agents.json).
When configured, healthCommand checks which agents are currently usable
and catches an unavailable CLI before launch. An unknown key is not an error: resolveAgentProgram()
falls back to claude, so a typo silently spawns a second claude instead of failing.
Only pass this when the user explicitly names agents in the task (for example, "use agy and claude").
Preflight checks only the CLIs you name here, so a codex quota wall does not block a
grok,claude run. Naming agents explicitly also disables the auto-fallback: a dead agent
becomes a hard failure instead of a silent swap.
Also settable via COLLAB_AGENTS, for a preferred line-up you do not want to retype
(export COLLAB_AGENTS="codex,claude,grok"). Precedence: 3rd argument > COLLAB_AGENTS >
the default pair. Only the argument counts as naming your agents; COLLAB_AGENTS is a standing
preference and keeps the auto-fallback, with every swap printed as a warning.
Template selection (4th argument, optional). A key from collab-templates.json that
gives each agent an explicit role instead of the generic lead/worker prompt. Also settable
via COLLAB_TEMPLATE. Pick one when the task clearly matches:
| Template | Roles | Use when the task is |
review | REVIEWER + CRITIC | reviewing existing code |
implement | ARCHITECT + DEVELOPER | building a feature |
research | RESEARCHER-A + RESEARCHER-B | comparing options or exploring a topic |
debug | REPRODUCER + ANALYST | chasing a bug |
Leave it empty if the task does not fit cleanly. A wrong template is worse than none.
Extract TEAM_ID from the launch output (last line is TEAM_ID=<id>):
TEAM_ID=$(printf '%s\n' "$LAUNCH_OUTPUT" | sed -n 's/^TEAM_ID=//p' | tail -1)Do not read /tmp/collab-team-id.txt unless you have no launch output: it is a single
global file that a concurrent collab overwrites.
Check that the launch actually succeeded before doing Step 2. collab-launch.sh can fail
after the team already exists: exit 3 means a team was created but no message was exchanged
within the wait window, exit 4 means the bridge or poller died right after starting. Both
print a TEAM_ID= trailer anyway, but neither one printed Team is live!. Only tell the user
the team is live when that exact line is in the output. On exit 3, run
"$ES/collab-rescue.sh" "$TEAM_ID" before saying anything is running.
Step 1b: Health checks (automatic, do not re-run)
- Preflight runs inside
collab-launch.shbefore the team is created. It checks the service, agent CLI auth, and DNS. Non-zero exit means launch aborted with the fix command printed. Do not paper over it withCOLLAB_SKIP_PREFLIGHT=1unless the user asks. Exit codes:1service down,2service started in an unauthenticated shell (restart it),3claude CLI broken,4codex CLI broken,5DNS/network,6grok CLI broken,7health hook reports an unavailable requested agent or no healthy fallback. Exit7is also returned by the launcher; its message lists healthy alternatives. - Postcheck is armed automatically and fires ~25s after spawn. It only ever looks at this
team's own tmux sessions. If an agent is stuck in an error state, or zero messages were
exchanged in its wait window, it kills the team and writes the diagnosis to
/tmp/ensemble/<TEAM_ID>/postcheck.log. If a team dies within the first minute, read that file before guessing.
Step 2: Tell the user where the monitor is
HERDR: "Team is live in the new herdr pane on the right."TMUX_YES: "Team is live in the right tmux pane."ITERM_NATIVE: "Team is live in the new iTerm pane on the right."TMUX_NO: "tmux attach -t ensemble-$TEAM_ID— live TUI monitor (steer, disband, scroll)"
Step 3: Monitoring — the user MUST see the conversation
CRITICAL RULE: The user wants to SEE the team's conversation as it happens. Every poll result must be presented clearly and formatted as a readable conversation. Do NOT just dump raw output — format it as a proper dialogue.
If TMUX_NO: poll and PRESENT messages inline
Use collab-poll.sh — a single-shot poller that tracks state automatically and gives clean output.
Poll command:
"$ES/collab-poll.sh" "$TEAM_ID" --sleep <seconds>Output format: sender\tcontent lines, ending with one of:
---STATUS:ACTIVE— new messages were found---STATUS:QUIET— no new messages (agents in deep work)---STATUS:DONE— team finished, followed by summary.txt content---STATUS:WAITING— messages file not yet created
Presentation rules — THIS IS THE KEY PART: After each poll, present the new messages to the user like this:
codex-1: [message content]
claude-2: [message content]
Use markdown bold for agent names. Show the FULL message content (up to 500 chars), not truncated summaries. Between polls, add a brief status line like "Team is working... next check in 15s."
Polling cadence:
- First poll:
--sleep 10 - Normal:
--sleep 15to--sleep 20 - If 3+ polls QUIET:
--sleep 30(agents in deep work) - On
---STATUS:DONE: stop polling, present final summary
When done, present structured summary + clean up:
TEAM_ID="<id>" && RD="/tmp/ensemble/$TEAM_ID" && kill "$(cat "$RD/poller.pid" 2>/dev/null)" 2>/dev/null || true; kill "$(cat "$RD/bridge.pid" 2>/dev/null)" 2>/dev/null || true; tmux kill-session -t "ensemble-$TEAM_ID" 2>/dev/null || trueIf HERDR: background summary watcher
Same as TMUX_YES: the monitor pane is visible to the user, so don't inline-poll. Wait for
completion in the background and present the final summary. The monitor closes its own herdr
pane on exit (pane id in /tmp/ensemble/<TEAM_ID>/herdr-pane-id), so no tmux kill-session.
If ITERM_NATIVE: background summary watcher
Same as TMUX_YES: the monitor pane is visible to the user, so don't inline-poll. Wait for completion in the background (same snippet as below) and present the final summary when done. On cleanup, the iTerm pane lives on — the user closes it with q or Cmd+W. Do NOT try to tmux kill-session (no tmux session exists in this mode).
If TMUX_YES: background summary watcher
Monitor visible in right pane. Wait in background:
TEAM_ID="<id>" && RD="/tmp/ensemble/$TEAM_ID" && while [ ! -f "$RD/.finished" ] && [ ! -f "$RD/summary.txt" ]; do sleep 8; done && echo "COLLAB_COMPLETE" && cat "$RD/summary.txt" 2>/dev/nullRun with run_in_background: true, timeout: 600000.
When done: summarize + cleanup poller/bridge PIDs.
How a team ends
Auto-disband triggers on one of two paths:
- Explicit sentinel (preferred). EVERY active agent sends a team-say whose entire content
is
<<COLLAB_DONE>>. This bypasses the message-count minimum and the idle wait. The agent prompts already instruct this. The bar is every agent, not two, so a third agent is never cut off while its teammates close up. - Idle + completion signals. A safety net for teams that go quiet without sending the sentinel: it needs a minimum number of exchanged messages AND at least 60s of silence.
Ordinary words like "done" or "klaar" in a status update do not kill a team while the conversation is running. Do not warn agents to avoid those words.
Troubleshooting
Work through these in order before reporting a failure to the user.
| Symptom | Action |
| Team died within a minute | cat /tmp/ensemble/$TEAM_ID/postcheck.log, it names the broken agent |
Agents visible but messages.jsonl stays empty | "$ES/collab-rescue.sh" "$TEAM_ID", re-injects the prompts the service failed to deliver |
| Launch aborted before creating a team | Preflight printed the fix command; run it, then relaunch |
| Not sure what is still running | "$ES/collab-status.sh" |
/tmp filling up with old runs | "$ES/collab-cleanup.sh" (dry-run), then --force |
| Want to review a finished session | "$ES/collab-replay.sh" "$TEAM_ID", or open the auto-generated HTML replay |
Escalation. Two failed rescue or relaunch attempts on the same task is the limit. Stop,
report to the user what was tried, what the logs said (postcheck.log, bridge.log,
/tmp/ensemble-server.log), and ask how to proceed. Never keep relaunching a team that
fails the same way. Each retry spawns real CLI sessions and burns real tokens.
Important Notes
- Agents run with auto-accept permissions (configured in agents.json: codex
--dangerously-bypass-approvals-and-sandbox, claude--permission-mode auto). They should NEVER ask for file write approval. - Do not modify project code during a collab session unless the user explicitly asks
- Do not truncate or remove
messages.jsonl - Multiple collabs can run simultaneously — each has own
/tmp/ensemble/<TEAM_ID>/namespace team-say.shusesfcntl.flockfor atomic JSONL writesensemble-bridge.shhas single-instance guard, health check, exponential backoff.finishedandsummary.txtare written by ensemble-service, NOT by scripts- Bridge auto-stops when it sees
.finishedmarker
Optional external brain integration
Configuration supports rosterCommand, planCommand, eventsCommand,
replaceStalledAgents (default false), and maxReplacementsPerTeam (default 2).
Use generic commands such as "rosterCommand": "my-brain roster".
Environment overrides are ENSEMBLE_ROSTER_CMD, ENSEMBLE_PLAN_CMD,
ENSEMBLE_EVENTS_CMD, and ENSEMBLE_REPLACE_STALLED.
Hooks are trusted shell code invoked as /bin/bash -c '<cmd> "$@"' ensemble-<name> <args...>.
The entire process group is killed on timeout. Roster takes no arguments, has a
5-second timeout, and returns the healthCommand schema: agent keys mapped to
{ "status": "ok|down|limit|slow|unknown", "detail": "optional" }.
Plan receives task text as $1, has a 20-second timeout, and returns
{ "agents": ["codex", "mimo"], "template": "implement", "reason": "Complementary roles" }.
Extra plan fields are ignored. Explicit agents bypass planning; an explicit
template wins. Failed planning uses the default team.
Events take no arguments, receive exactly one JSON line on stdin followed by EOF,
and have a 5-second timeout. Delivery is nonblocking and nonfatal, with at most one
warning per team. Common fields: event, teamId, team, ISO-8601 ts.
Types: team_started (agents, cwd, branch), agent_ready and agent_done
(agent), agent_stalled and agent_failed (agent, detail), agent_replaced
(agent, replacement, detail), team_finished (status: ok|failed|stopped,
durationS, branch, cwd, detail). Unavailable fields are omitted.
Launch with COLLAB_WORKTREE=team for a shared local git worktree, or send
worktree: "team" through the API. All local agents share its branch
ensemble/<short-team-id>. The worktree is retained, never automatically merged.
Path and branch appear in the summary and finish event. Replacement checks local
sessions every 20 seconds and preserves role, directory, task, and bounded recent
context. It selects an unused fallbackOrder key with status ok, using roster,
then health, then no check. Remote replacements remain on the original host. MiMo (mimo) is
available as an explicit agent key.
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
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.

