بنقرة واحدة
team
N coordinated agents on shared task list using Claude Code native teams, with git worktree isolation per executor
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
N coordinated agents on shared task list using Claude Code native teams, with git worktree isolation per executor
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Manage OMA skills — list, add, remove, search, and edit skills
Socratic deep interview with mathematical ambiguity gating before autonomous execution
Remove AI slop - low-quality, generic, or verbose content. Use for "clean up", "remove fluff", and "make concise".
Consensus planning - agree before executing. Use for "ralplan", "consensus", "pre-execution review".
Setup routing and environment configuration. Use for "setup", "configure", and "get started".
QA cycling - test, verify, fix, repeat until quality. Use for "quality assurance", "test driven", and "verify thoroughly".
| name | team |
| description | N coordinated agents on shared task list using Claude Code native teams, with git worktree isolation per executor |
| aliases | [] |
| level | 4 |
Spawn N coordinated agents working on a shared task list using Claude Code's native team tools. Each executor gets its own isolated git worktree to prevent file conflicts.
/oh-my-claudecode:team N "task description"
/oh-my-claudecode:team "task description"
User: "/team 3 fix all TypeScript errors"
|
v
[TEAM ORCHESTRATOR (Lead)]
|
+-- TeamCreate("fix-ts-errors")
| -> lead becomes team-lead@fix-ts-errors
|
+-- Analyze & decompose task into subtasks
|
+-- For each executor:
| -> createExecutorWorktree(executorId, teamName, repoRoot)
| -> creates .omc/worktrees/{team}/{executor}/ on branch oma-team/{team}/{executor}
|
+-- TaskCreate x N (one per subtask)
| -> tasks #1, #2, #3 with dependencies
|
+-- TaskUpdate x N (pre-assign owners)
|
+-- Task(team_name="fix-ts-errors", name="executor-N") x N
| -> spawns teammates, each in their own worktree
|
+-- Monitor loop
|
+-- On shutdown:
-> cleanupTeamWorktrees(teamName, repoRoot)
-> removes all executor worktrees and branches
Each executor operates in its own git worktree at:
{repoRoot}/.omc/worktrees/{teamName}/{executorId}/
With an isolated branch:
oma-team/{teamName}/{executorId}
Before spawning: createExecutorWorktree(executorId, teamName, repoRoot, baseBranch?)
baseBranch (default: main).omc/state/team-bridge/{teamName}/worktrees.jsonDuring execution: Executor operates exclusively in its worktree. No file conflicts with other executors.
After completion: removeExecutorWorktree(executorId, teamName, repoRoot)
Team shutdown: cleanupTeamWorktrees(teamName, repoRoot)
import {
createExecutorWorktree,
removeExecutorWorktree,
listWorktrees,
cleanupTeamWorktrees,
} from './skills/team/worktree-manager.mjs';
// Create worktree for an executor
const info = await createExecutorWorktree('executor-1', 'fix-ts-errors', repoRoot, 'main');
// info.path -> /path/to/repo/.omc/worktrees/fix-ts-errors/executor-1
// info.branch -> oma-team/fix-ts-errors/executor-1
// info.executorId -> 'executor-1'
// info.teamName -> 'fix-ts-errors'
// List active worktrees
const paths = listWorktrees('fix-ts-errors', repoRoot);
// ['/path/to/repo/.omc/worktrees/fix-ts-errors/executor-1', ...]
// Remove a single executor worktree
await removeExecutorWorktree('executor-1', 'fix-ts-errors', repoRoot);
// Remove all team worktrees (on team shutdown)
await cleanupTeamWorktrees('fix-ts-errors', repoRoot);
Worktree metadata is persisted at:
.omc/state/team-bridge/{teamName}/worktrees.json
Format:
[
{
"path": "/repo/.omc/worktrees/fix-ts-errors/executor-1",
"branch": "oma-team/fix-ts-errors/executor-1",
"executorId": "executor-1",
"teamName": "fix-ts-errors",
"createdAt": "2026-04-05T12:00:00.000Z"
}
]
.. rejection)Extract N (agent count, 1-20) and task description.
Break the task into N independent subtasks (file-scoped or module-scoped to avoid conflicts).
Call TeamCreate:
{
"team_name": "fix-ts-errors",
"description": "Fix all TypeScript errors across the project"
}
Write OMC state:
state_write(mode="team", active=true, current_phase="team-exec", state={
"team_name": "fix-ts-errors",
"agent_count": 3,
"task": "fix all TypeScript errors",
"stage_history": "team-plan"
})
For each executor before spawning:
import { createExecutorWorktree } from '../../skills/team/worktree-manager.mjs';
const worktreeRoot = '/path/to/repo';
for (let i = 1; i <= agentCount; i++) {
const executorId = `executor-${i}`;
const info = await createExecutorWorktree(executorId, teamName, worktreeRoot, 'main');
// Pass info.path as the workingDirectory for the executor
}
Call TaskCreate for each subtask. Pre-assign owners via TaskUpdate(taskId, owner) to avoid race conditions.
Spawn each executor with their assigned worktree path:
{
"subagent_type": "oh-my-claudecode:executor",
"team_name": "fix-ts-errors",
"name": "executor-1",
"prompt": "<worker-preamble + assigned tasks>",
"workingDirectory": "/repo/.omc/worktrees/fix-ts-errors/executor-1"
}
Worker preamble:
You are a TEAM EXECUTOR in team "{team_name}". Your name is "{executor_name}".
You are working in an isolated git worktree at {worktree_path}.
You report to the team lead ("team-lead").
== WORK PROTOCOL ==
1. CLAIM: Call TaskList to see your assigned tasks (owner = "{executor_name}").
Pick the first task with status "pending" that is assigned to you.
Call TaskUpdate to set status "in_progress".
2. WORK: Execute the task using your tools (Read, Write, Edit, Bash).
Do NOT spawn sub-agents. Do NOT delegate. Work directly in your worktree.
3. COMPLETE: When done, mark the task completed:
{"taskId": "ID", "status": "completed"}
4. REPORT: Notify the lead via SendMessage:
{"type": "message", "recipient": "team-lead", "content": "Completed task #ID: <summary>", "summary": "Task #ID complete"}
5. NEXT: Check TaskList for more assigned tasks. If no more, notify the lead.
6. SHUTDOWN: When you receive a shutdown_request, respond with:
{"type": "shutdown_response", "request_id": "<from the request>", "approve": true}
== RULES ==
- NEVER spawn sub-agents or use the Task tool
- NEVER run team orchestration commands
- ALWAYS use absolute file paths
- ALWAYS report progress via SendMessage to "team-lead"
Monitor progress via inbound SendMessage from executors and periodic TaskList polling.
TaskListSendMessage(shutdown_request)cleanupTeamWorktrees(teamName, repoRoot) to remove all worktreesTeamDelete to clean up team resources| Error | Cause | Fix |
|---|---|---|
git worktree add failed | Branch/path conflict or git error | Ensure base branch exists; check for path conflicts |
worktree path not under repo | Path traversal attempt | Names are sanitized; check executor ID format |
metadata parse error | Corrupted worktrees.json | Delete .omc/state/team-bridge/{team}/worktrees.json and retry |
Executor shutdown failed | Agent did not respond | Use TeamDelete with force to clean up |
<Do_Not_Use_When>
<Tool_Usage>
createExecutorWorktree, removeExecutorWorktree, cleanupTeamWorktrees) is called by the team orchestrator itself — no executor should call these directly
</Tool_Usage><Why_This_Exists> OMA orchestrates Auggie agents on real codebases. Some tasks are large enough that a single agent taking turns is too slow — e.g., "fix all TypeScript errors" across 50 files, or "audit all skills for missing sections." Team mode provides git worktree isolation so multiple executor agents can work simultaneously on different files without git conflicts, while the team orchestrator handles task distribution, monitoring, and cleanup. The isolation model prevents the most common failure mode of naive parallel execution: two agents modifying the same file. </Why_This_Exists>
Large-scale parallel fix:
User: "/oma:team 4 fix all TypeScript errors"
OMA: [Decomposes: 4 executor worktrees, each assigned ~12 files]
OMA: [Spawns 4 executor agents, each in its own worktree]
OMA: [Monitors — executor 3 reports: "Fixed 8/12 files, 4 need manual review"]
OMA: [Shutdown, cleanup]
OMA: [Result: 50 TypeScript errors fixed in parallel vs. sequential]
Parallel skills audit:
User: "/oma:team 3 audit all 8 skill directories"
OMA: [Decomposes: 3 executors, each auditing ~2-3 skills]
OMA: [Each executor writes findings to its own worktree output file]
OMA: [Collects: 3 audit reports]
OMA: [Integrates into single gap analysis]
Sequential dependency hidden as parallel:
User: "/oma:team 2 refactor auth service and update all callers"
OMA: [Executor 1: refactors auth.ts in worktree 1]
OMA: [Executor 2: tries to update callers in worktree 2 — stale API]
OMA: [Result: executor 2 either fails or produces broken code]
→ Should decompose as a sequential chain: refactor first (1 agent), then update callers (1 agent after refactor completes).
Single-file change:
User: "/oma:team 1 fix the typo in README"
OMA: [Spawns 1 executor in a worktree for a README typo]
OMA: [Result: massive overhead for a 1-minute task]
→ Use executor directly.
<Escalation_And_Stop_Conditions>
cleanupTeamWorktrees immediately, report partial results
</Escalation_And_Stop_Conditions><Final_Checklist>
workingDirectorycleanupTeamWorktrees called after all executors confirm shutdown.oma/state.json team mode entry removed)