AGENTS.md
packages/omo-opencode/src/features/team-mode/AGENTS.mdAGENTS.md
Quality
70/100
Scores the file, not the repository.Length
1,062 words
13 headings · 5 code blocksRepository
67k
— · pushed 0 days agoLast changed
2 days ago
First indexed 2 days ago.1# team-mode — Parallel Multi-Agent Coordination23**Generated:** 2026-05-1545## OVERVIEW67Spawns coordinated agent teams with shared mailbox, task list, optional tmux layout, and graceful lifecycle. Modeled after Claude Code Agent Teams. **OFF by default.** Enable via `team_mode.enabled` in `.omo/omo.jsonc`; restart OpenCode after enabling. Harness-neutral registry/mailbox/tasklist/state/worktree/tmux-layout primitives are extracted to [`packages/team-core/`](../../../../../packages/team-core); this directory remains the OpenCode adapter for session spawning, hooks, tools, and config integration.89User docs: [`docs/guide/team-mode.md`](../../../../../docs/guide/team-mode.md).1011## CONFIG1213Full schema: [`src/config/schema/team-mode.ts`](../../config/schema/team-mode.ts).1415```jsonc16{17 "team_mode": {18 "enabled": false, // gate19 "tmux_visualization": false, // optional tmux pane layout20 "max_parallel_members": 4, // 1..821 "max_members": 8, // 1..8 hard cap22 "max_messages_per_run": 10000, // 1..∞23 "max_wall_clock_minutes": 120, // 1..∞24 "max_member_turns": 500, // 1..∞25 "base_dir": null, // optional override of ~/.omo/teams or <project>/.omo/teams26 "message_payload_max_bytes": 32768, // 1024..∞ — per-message payload cap27 "recipient_unread_max_bytes": 262144, // 1024..∞ — per-recipient inbox cap28 "mailbox_poll_interval_ms": 3000 // 500..∞ — recipient poll cadence29 }30}31```3233## 12 TEAM_* TOOLS3435Registered via [`src/plugin/tool-registry.ts`](../../plugin/tool-registry.ts) `teamModeToolsRecord` only when enabled.3637| Tool | Source File | Purpose |38|------|-------------|---------|39| `team_create` | `tools/lifecycle.ts` | Spawn team + member sessions from named or inline TeamSpec |40| `team_delete` | `tools/lifecycle.ts` | Tear down state, mailbox, tasklist, worktrees, optional tmux |41| `team_shutdown_request` | `tools/lifecycle.ts` | Member or lead requests its own shutdown |42| `team_approve_shutdown` | `tools/lifecycle.ts` | Lead acks shutdown |43| `team_reject_shutdown` | `tools/lifecycle.ts` | Lead rejects shutdown with reason |44| `team_send_message` | `tools/messaging.ts` | Send to member name or `*` broadcast |45| `team_task_create` | `tools/tasks.ts` | Create task on shared list |46| `team_task_list` | `tools/tasks.ts` | List tasks (filter by status / owner) |47| `team_task_update` | `tools/tasks.ts` | Claim / complete / delete (atomic file lock) |48| `team_task_get` | `tools/tasks.ts` | Fetch single task |49| `team_status` | `tools/query.ts` | Full team run status (members, tasks, mailbox) |50| `team_list` | `tools/query.ts` | List declared + active teams |5152## ELIGIBLE AGENTS5354[`AGENT_ELIGIBILITY_REGISTRY`](types.ts) in `types.ts` — three verdict tiers, each with its own rejection message:5556| Verdict | Agents | Notes |57|---------|--------|-------|58| `eligible` | sisyphus, atlas, sisyphus-junior | Three only |59| `conditional` | hephaestus | Lacks `teammate: "allow"` permission by default. Either apply D-36 patch (add `teammate: "allow"` in `tool-config-handler.ts`) or use `subagent_type: "sisyphus"` instead |60| `hard-reject` | oracle, librarian, explore, multimodal-looker, metis, momus, prometheus | Read-only or plan-mode-only — cannot write to mailbox; use `task` (delegate-task) instead |6162Hard-reject agents throw at TeamSpec parse with a specific message ("Agent 'X' is read-only…"). The error message points members at delegate-task as the right escape hatch.6364## MEMBER KINDS6566```jsonc67{68 "members": [69 { "kind": "subagent_type", "name": "scout", "subagent_type": "sisyphus" },70 { "kind": "category", "name": "writer", "category": "writing", "prompt": "Write release notes" }71 ]72}73```7475- `kind: "subagent_type"` — direct agent. `prompt` optional.76- `kind: "category"` — routed through `sisyphus-junior` with the chosen category model. `prompt` REQUIRED.7778## MODULE LAYOUT7980```81team-mode/82├── index.ts # barrel and adapter exports83├── types.ts # OpenCode-facing re-exports/wrappers for team-core schemas plus AGENT_ELIGIBILITY_REGISTRY84├── deps.ts # checkTeamModeDependencies (git, tmux availability)85├── member-parser.ts # member validation against eligibility registry86├── member-guidance.ts # auto-injected guidance per member kind87├── member-session-resolution.ts88├── member-session-routing.ts89├── resolve-caller-team-lead.ts # determine if a session is acting as lead90├── team-session-registry.ts # spawn-race-safe sessionID → team/member lookups91├── team-registry/ # adapter shim over team-core team spec loading92│ ├── loader.ts93│ ├── paths.ts # ensureBaseDirs, resolveBaseDir94│ └── validator.ts95├── team-state-store/ # adapter shim over team-core durable runtime state.json with atomic locks96├── team-runtime/ # create/status/shutdown lifecycle97├── team-mailbox/ # adapter shim over team-core async messaging (send / poll / ack / inbox)98├── team-tasklist/ # adapter shim over team-core CRUD + claiming + dependencies99├── team-worktree/ # adapter shim over team-core git worktree primitives100├── team-layout-tmux/ # adapter shim over team-core optional pane layout101└── tools/ # 12 team_* tool implementations + tests102```103104## STORAGE LAYOUT105106```107~/.omo/teams/{name}/ # user scope108<project>/.omo/teams/{name}/ # project scope (wins on collision)109 ├── config.json # TeamSpec110 ├── state.json # runtime: members, sessionIDs, lifecycle111 ├── mailbox/ # one .jsonl per recipient112 ├── tasklist.jsonl # shared task list113 └── worktrees/{member-name}/ # git worktree per member114```115116## LIFECYCLE117118```1191. team_create120 → load TeamSpec → validate eligibility → spawn member sessions121 → init mailbox + tasklist + worktrees → optional tmux layout1222. Lead delegates via team_send_message + team_task_create1233. Members claim tasks (team_task_update status="claimed") → execute → report (team_send_message)1244. team_shutdown_request → team_approve_shutdown / team_reject_shutdown1255. team_delete → cleanup state, mailbox, tasklist, worktrees, panes126```127128## KEY INVARIANTS1291301. **Spawn-race-safe resolution:** every team spawn calls `registerTeamSession(sessionId, entry)` synchronously when sessionID is known; every hook resolving sessionID calls `lookupTeamSession` BEFORE `loadRuntimeState` to avoid the spawn-race window.1312. **Deferred ack:** messages are fire-and-forget; recipient acks via separate call.1323. **Locked tasks:** task claiming uses atomic file locks; concurrent claims resolve safely.1334. **Atomic writes:** state changes write to temp file then rename.1345. **Eligible agents only:** rejection at parse, never at runtime.1356. **No nested teams:** members CANNOT call `team_create`.136137## INTEGRATION POINTS138139| Where | What |140|-------|------|141| [`src/index.ts`](../../index.ts) (entry) | `checkTeamModeDependencies()` + `ensureBaseDirs()` if `team_mode.enabled` |142| [`src/plugin/tool-registry.ts`](../../plugin/tool-registry.ts) `teamModeToolsRecord` | Registers 12 `team_*` tools |143| [`create-transform-hooks.ts`](../../plugin/hooks/create-transform-hooks.ts) | Conditionally builds `teamModeStatusInjector` (`team-mode-status-injector` hook) and `teamMailboxInjector` (`team-mailbox-injector` hook) — both Transform tier |144| [`create-tool-guard-hooks.ts`](../../plugin/hooks/create-tool-guard-hooks.ts) | Conditionally builds `teamToolGating` (`team-tool-gating` hook) — Tool Guard tier |145| [`src/plugin/event.ts`](../../plugin/event.ts) | Registers 4 team-session-event handlers from `src/hooks/team-session-events/`: `team-idle-wake-hint`, `team-lead-orphan-handler`, `team-member-error-handler`, `team-member-status-handler` |146| [`src/cli/doctor/checks/team-mode.ts`](../../cli/doctor/checks/team-mode.ts) | Doctor check for team-mode prerequisites |147| [`src/features/builtin-skills/skills/team-mode.ts`](../builtin-skills/skills/team-mode.ts) | Built-in skill documenting the 12 tools — gated on `team_mode.enabled` |148149## WHERE TO LOOK150151| Task | Location |152|------|----------|153| Add new team tool | `tools/` + register in [`src/plugin/tool-registry.ts`](../../plugin/tool-registry.ts) `teamModeToolsRecord` |154| Modify member eligibility | `types.ts` `AGENT_ELIGIBILITY_REGISTRY` |155| Change storage format | `types.ts` Zod schemas |156| Add worktree behavior | `team-worktree/manager.ts` |157| Modify tmux layout | `team-layout-tmux/layout.ts` |158| Task lifecycle changes | `team-tasklist/` |159| Mailbox protocol changes | `team-mailbox/` |160| Recover orphaned runs | `team-state-store/resume.ts` |161162## ANTI-PATTERNS163164- Never bypass `team-session-registry` — direct `loadRuntimeState` lookups will hit the spawn-race window.165- Never write team state files without the atomic lock from `team-state-store/locks.ts`.166- Never substitute `task` (delegate-task) for `team_*` tools when the user explicitly asks for team-mode work — they are not equivalent.167- Never allow members to call `team_create` (nested teams are forbidden by `team-tool-gating` hook).168
Also in code-yeongyu/oh-my-openagent
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/features/claude-code-agent-loader/AGENTS.md · 67k | AGENTS.md | archdeploymentagent-behaviour | 62/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/features/claude-code-mcp-loader/AGENTS.md · 67k | AGENTS.md | lint-formatarchsecuritydeployment+1 | 66/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/tools/background-task/AGENTS.md · 67k | AGENTS.md | arch | 70/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentscript/AGENTS.md · 67k | AGENTS.md | buildtestarchdeployment | 80/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/features/claude-code-plugin-loader/AGENTS.md · 67k | AGENTS.md | archdeploymentagent-behaviour | 70/100 | 2 days ago | |
| code-yeongyu/oh-my-openagent.agents/AGENTS.md · 67k | AGENTS.md | stylearchtesting-strategydatabase | 64/100 | 2 days ago | |
| code-yeongyu/oh-my-openagent.opencode/AGENTS.md · 67k | AGENTS.md | stylearchdo-not | 71/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentAGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+11 | 84/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentassets/AGENTS.md · 67k | AGENTS.md | buildteststylearch | 88/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentbin/AGENTS.md · 67k | AGENTS.md | teststylearch | 64/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/AGENTS.md · 67k | AGENTS.md | buildtestlint-formatstyle+3 | 83/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/agents-md-core/AGENTS.md · 67k | AGENTS.md | archdependenciesapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/boulder-state/AGENTS.md · 67k | AGENTS.md | archapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/claude-code-compat-core/AGENTS.md · 67k | AGENTS.md | archagent-behaviour | 56/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/comment-checker-core/AGENTS.md · 67k | AGENTS.md | archdependenciesapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/delegate-core/AGENTS.md · 67k | AGENTS.md | stylearchdependenciesapi | 60/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/git-bash-mcp/AGENTS.md · 67k | AGENTS.md | buildtestlint-formatarch+1 | 82/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/hashline-core/AGENTS.md · 67k | AGENTS.md | archtypesdependenciesapi | 48/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/lsp-core/AGENTS.md · 67k | AGENTS.md | archmonorepo | 43/100 | 2 days ago | |
| code-yeongyu/oh-my-openagentpackages/lsp-daemon/AGENTS.md · 67k | AGENTS.md | buildtestlint-formatarch+1 | 89/100 | today |
Diff against packages/omo-opencode/src/features/claude-code-agent-loader/AGENTS.md Diff against packages/omo-opencode/src/features/claude-code-mcp-loader/AGENTS.md Diff against packages/omo-opencode/src/tools/background-task/AGENTS.md Diff against script/AGENTS.md Diff against packages/omo-opencode/src/features/claude-code-plugin-loader/AGENTS.md Diff against .agents/AGENTS.md Diff against .opencode/AGENTS.md Diff against AGENTS.md Diff against assets/AGENTS.md Diff against bin/AGENTS.md Diff against packages/AGENTS.md Diff against packages/agents-md-core/AGENTS.md Diff against packages/boulder-state/AGENTS.md Diff against packages/claude-code-compat-core/AGENTS.md Diff against packages/comment-checker-core/AGENTS.md Diff against packages/delegate-core/AGENTS.md Diff against packages/git-bash-mcp/AGENTS.md Diff against packages/hashline-core/AGENTS.md Diff against packages/lsp-core/AGENTS.md Diff against packages/lsp-daemon/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago |
