coding-agents-farm

Orchestrate multiple coding agent farms via CLI (Claude, Codex, Copilot, Gemini, OpenCode, Goose) running in parallel on isolated git worktrees. Farm Leader plans, dispatches, monitors, intervenes, and merges results.

8 stars

Best use case

coding-agents-farm is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Orchestrate multiple coding agent farms via CLI (Claude, Codex, Copilot, Gemini, OpenCode, Goose) running in parallel on isolated git worktrees. Farm Leader plans, dispatches, monitors, intervenes, and merges results.

Teams using coding-agents-farm should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/coding-agents-farm/SKILL.md --create-dirs "https://raw.githubusercontent.com/griddynamics/rosetta/main/instructions/r2/core/skills/coding-agents-farm/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/coding-agents-farm/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How coding-agents-farm Compares

Feature / Agentcoding-agents-farmStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Orchestrate multiple coding agent farms via CLI (Claude, Codex, Copilot, Gemini, OpenCode, Goose) running in parallel on isolated git worktrees. Farm Leader plans, dispatches, monitors, intervenes, and merges results.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

<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>
Use when a task benefits from parallel execution across multiple coding agents — large features decomposable into independent subtasks, cross-validation by different models/providers, or throughput-critical work. Solves: single-agent bottlenecks, premature completion without testing, agent deviation, token/rate-limit failures going unnoticed.
</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:
- Claude Code: bug where allowlist permissions silently denied even when configured (as of Feb 2026). Use `bypassPermissions` mode, not allowlists.
- Codex: `--yolo` suppresses trust prompt but `.codex/skills` may still gate on per-project trust. Fixed in v0.88+.
- Copilot: `--yolo` may still prompt for some operations in edge cases. No full workaround.
- Gemini: `--yolo` in non-interactive mode may still require confirmation in v0.28+ (known regression). Set env var as belt-and-suspenders.

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.

Model selection guidance:
- Anthropic: `claude-sonnet-4-6` (workhorse), `claude-opus-4-8` (complex), `claude-haiku-4-5` (fast)
- OpenAI: `gpt-5.4` (workhorse), `gpt-5.5-high` (complex)
- Google: `gemini-3.1-pro-preview` (workhorse), `gemini-3-flash-preview` (fast)
- Copilot: select via `--model`; supports claude, gpt, gemini families through GitHub
- OpenCode: prefix with provider, e.g. `anthropic/claude-sonnet-4-6`, `openai/gpt-5.4`
- Goose: set in `~/.config/goose/profiles.yaml`

OpenCode: prefix with provider, e.g. `anthropic/claude-sonnet-4-6`, `openai/gpt-5.4-medium`.
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>
   ```
2. Verify each worktree is clean and on its own branch.
3. Never run orchestrators on the main working tree.

### 3. Prompt Construction

Construct a self-contained prompt per orchestrator:
- Specific subtask with clear scope boundaries and file list.
- "You MUST run tests and validate your changes before reporting completion."
- "Do NOT modify files outside your assigned scope."
- Expected deliverables and done-criteria.
- "If blocked, report the blocker. Do not guess or assume."

### 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-4-6 --max-turns 30 --output-format json --no-session-persistence
```

Codex:
```
codex exec "PROMPT" --yolo -m gpt-5.4-medium --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.1-pro-preview --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:
- **Completion**: exit code appears in terminal footer.
- **Questions/Blocks**: orchestrator asks a question or reports a blocker — intervene immediately.
- **Rate limiting**: look for rate-limit or 429 errors — back off and retry or reassign.
- **Token exhaustion**: context limit warnings or "max turns reached" — summarize progress, start a continuation session.
- **Premature completion**: agent claims done but no test evidence — send follow-up prompt demanding tests.
- **Deviation**: agent working on wrong files or scope — kill and restart with clearer prompt.

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

### 6. Intervene

- **Answer questions**: read the question from terminal output, formulate answer, send as follow-up to the CLI process (if the CLI supports session continuation) or document the answer and restart with amended prompt.
- **Restart on failure**: kill failed process, analyze root cause from output, fix prompt or environment, relaunch in same worktree.
- **Reassign**: if a CLI consistently fails (3+ retries), reassign the task to a different CLI+model pair.
- **Escalate**: if the task itself is blocked (not a CLI issue), stop and ask the user.

### 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>

- [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code/cli-usage) — headless mode, permissions
- [Codex CLI](https://github.com/openai/codex) — exec mode, sandbox options
- [Copilot CLI](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli) — prompt mode, yolo
- [Gemini CLI](https://google-gemini.github.io/gemini-cli/docs/cli/headless.html) — headless mode, output formats
- [OpenCode CLI](https://opencode.ai/docs/cli) — run command, agents
- [Goose CLI](https://block.github.io/goose/docs/guides/running-tasks/) — headless recipes, config
- [Git Worktrees](https://git-scm.com/docs/git-worktree) — isolation strategy

</resources>

</coding_agents_farm>

Related Skills

coding

8
from griddynamics/rosetta

Rosetta coding skill for implementation with KISS/SOLID/DRY principles, zero-tolerance quality, multi-environment awareness, and systematic validation. Use when implementing features, fixing bugs, or making code changes.

coding-iac

8
from griddynamics/rosetta

Rosetta planning, coding, and reviewing skill for IaC implementation (Terraform, Polumi, CloudFormation, ARM, Bicep, Crossplane, CDK, Helm, Kustomize, etc). MUST use when implementing features, fixing bugs, or making code changes to any IaC.

coding-agents-prompt-authoring

8
from griddynamics/rosetta

Author, update, and validate prompts (skills, agents, subagents, workflows, commands, rules, templates, or just any generic prompt). Produces a final prompt with analytics artifacts (brief, contracts, and a validation pack). Use when creating, editing, refactoring, reviewing, validating, or migrating prompts for AI coding agents.

coding-agents-prompt-adaptation

8
from griddynamics/rosetta

Adapt skills, agents, subagents, workflows, commands, rules, templates, or any generic prompt from one coding agent/IDE/context to another while preserving original intent, hooks, meaning, and strategy (Claude Code, Cursor, Copilot, Windsurf, OpenCode, or current project context). `ADAPT <files>` is alias command.

operation-manager

8
from griddynamics/rosetta

Rosetta skill for reliable execution: plan creation, tracking, and execution coordination via local JSON files.

load-workflow

8
from griddynamics/rosetta

Rosetta MUST skill to select, load, and activate the best-matching workflow for the current request, inject its phases into the execution plan, and restore state when resuming.

load-context-instructions

8
from griddynamics/rosetta

Detect active execution mode and load Rosetta bootstrap instructions accordingly.

gitnexus-setup

8
from griddynamics/rosetta

Use when directly requested to install GitNexus.

gitnexus-cli

8
from griddynamics/rosetta

GitNexus CLI reference for npx commands — analyze, status, clean, wiki, list — with flags, effects, and when to run each.

testing

8
from griddynamics/rosetta

Rosetta testing skill for thorough, isolated, idempotent tests with 80% minimum coverage, external-only mocking, and scenario-driven testing. Use when writing or updating tests.

tech-specs

8
from griddynamics/rosetta

Rosetta skill for defining clear, testable tech specifications from requirements. Use when creating implementation-ready documentation that defines the target state architecture, contracts, and interfaces.

subagent-contract

8
from griddynamics/rosetta

Rosetta MUST skill. MUST activate when you ARE a subagent — you were spawned by an orchestrator, you received a delegated task, you are executing within a subagent context. Defines your input contract, output contract, behavior boundaries, and escalation protocol.