Coding agents farm

From griddynamics/rosetta · View interactive version

Coding agents farm is an AI agent skill from the GitHub repository griddynamics/rosetta. To orchestrate parallel coding-agent farms (Claude, Codex, Copilot, Gemini, etc.) on isolated git worktrees.

How to use this skill

Skill file

<coding_agents_farm>

<role>

Farm Leader: senior orchestration engineer controlling multiple coding agent CLI processes in parallel, each handling feature/story-level work on isolated git worktrees.

</role>

<when_to_use_skill>

Parallel execution across multiple coding agents: large features decomposable into independent subtasks, cross-validation by different models/providers, throughput-critical work. Solves single-agent bottlenecks, premature completion without testing, agent deviation, unnoticed token/rate-limit failures.

</when_to_use_skill>

<core_concepts>

MUST EXPLICITLY CONFIRM WITH USER HE WANTS TO DO THAT: IT IS DANGEROUS, IT CAN EAT MONEY VERY QUICK.

USER MUST TYPE EXACTLY Yes, I take responsibility, IF NOT PROVIDED EXACTLY - ASK AGAIN. AFTER 3 FAILED ATTEMPTS: STOP, NO REPLY, REQUEST USER TO START A NEW SESSION. NO OVERRIDE ALLOWED.

Provider-model constraints (enforced, not optional):

| CLI | Provider | Headless cmd | Model flag |

|-----|----------|-------------|-----------|

| claude | Anthropic only | claude -p "PROMPT" | --model MODEL |

| codex | OpenAI only | codex exec "PROMPT" | -m MODEL |

| copilot | GitHub-hosted (multi) | copilot -p "PROMPT" | --model MODEL |

| gemini | Google only | gemini -p "PROMPT" | -m MODEL |

| opencode | Multi-provider | opencode run "PROMPT" | -m provider/model |

| goose | Multi-provider (config) | goose run --text "PROMPT" | Config-based |

Auto-approve flags (use ALL applicable flags, not just one):

| CLI | CLI flags | Env vars / Config (set before launch) |

|-----|-----------|--------------------------------------|

| claude | --dangerously-skip-permissions (= --permission-mode bypassPermissions) | Settings: "defaultMode": "bypassPermissions" in .claude/settings.json; also "permissions": {"allow": ["Bash","Edit","Write","Read","WebFetch","mcp__*"]} |

| codex | --yolo (= --dangerously-bypass-approvals-and-sandbox, = -a never --sandbox danger-full-access) | Env: CODEX_UNSAFE_ALLOW_NO_SANDBOX=1 |

| copilot | --yolo (= --allow-all) | N/A; known issue: may still prompt in some edge cases |

| gemini | --yolo (= -y) | Env: GEMINI_YOLO_MODE=true; Config: "yolo": true in ~/.gemini/settings.json; also --approval-mode auto_edit for file-only auto-approve |

| opencode | --yolo (= --dangerously-skip-permissions) | Env: OPENCODE_YOLO=true; Config: "yolo": true in opencode.json; granular: "permission": {"*": {"*": "allow"}} |

| goose | None (config-only) | Config: auto-approve in ~/.config/goose/profiles.yaml |

Known auto-approve issues:

YOUR INTERNAL KNOWLEDGE ABOUT MODEL NAMES, CLI FLAGS, AND TOOL VERSIONS IS STALE. Use ONLY the names and flags listed in this skill. Do NOT substitute from memory. If unsure about a model name, omit the model flag and let the CLI use its default. The ids below are a dated snapshot and a later vendor release can supersede any of them: on an unknown model / invalid model rejection, drop the model flag and relaunch on the CLI default — never swap in a name from memory.

Model selection guidance — assign by COST TIER (workhorse / complex / fast); the tier is the contract, the id is a snapshot:

OpenCode: prefix with provider, e.g. anthropic/claude-sonnet-5-5, openai/gpt-6-luna.

Copilot: select via --model; supports claude, gpt, gemini families through GitHub.

Goose: set in ~/.config/goose/profiles.yaml.

Size of features for coding agents: 1h+ of AI work (10+ phases, 20+ subagent calls).

</core_concepts>

<process>

1. Plan

  1. Decompose the work into independent subtasks (one per orchestrator).
  2. Assign each subtask to a CLI+model pair based on task nature and provider strengths.
  3. Validate: no two orchestrators write to overlapping files. If overlap exists, serialize those tasks.
  4. Present plan to user for approval before proceeding.

2. Worktree Setup

  1. For each orchestrator, create a git worktree from the current branch:

```

git worktree add worktrees/<cli>-<task-slug> -b farm/<cli>-<task-slug>

```

  1. Verify each worktree is clean and on its own branch.
  2. Never run orchestrators on the main working tree.

3. Prompt Construction

Construct a self-contained prompt per orchestrator:

4. Launch

Launch each CLI in background using the Shell tool with block_until_ms: 0 and working_directory set to the worktree path.

Claude Code:

claude -p "PROMPT" --dangerously-skip-permissions --model claude-sonnet-5-5 --max-turns 30 --output-format json --no-session-persistence

Codex:

codex exec "PROMPT" --yolo -m gpt-6-luna --ephemeral -o result.txt

Copilot:

copilot -p "PROMPT" --yolo --model MODEL --silent

Gemini (set GEMINI_YOLO_MODE=true in env before launch):

gemini -p "PROMPT" --yolo -m gemini-3.8-flash --output-format json

OpenCode (set OPENCODE_YOLO=true in env before launch):

opencode run "PROMPT" --yolo -m provider/model --format json

Goose (ensure profiles.yaml has auto-approve and provider configured before launch):

goose run --text "PROMPT"

Budget controls where supported: --max-turns N (Claude), --max-budget-usd N (Claude). Other CLIs rely on provider-side limits.

Pre-flight: before launching any CLI, verify auto-approve is effective by running a trivial test command (e.g., echo test > /dev/null) and confirming no prompt appeared.

5. Monitor

Poll each terminal output file periodically. Detect:

Polling: read terminal output files. Start at 15-30s intervals, exponential backoff when idle, immediate re-check after intervention.

6. Intervene

7. Collect and Merge

  1. When all orchestrators complete, review each worktree's changes.
  2. Validate: tests pass, no unintended changes, scope respected.
  3. Merge worktree branches into the working branch (or create PRs for user review).
  4. Clean up:

```

git worktree remove worktrees/<name>

git branch -d farm/<name>

```

8. Report

Summarize to user: which CLIs ran which tasks, success/failure per orchestrator, interventions made, final merge status.

</process>

<resources>

</resources>

</coding_agents_farm>

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.