From arcforge
Dispatches Claude Code agent teammates to implement 2+ ready epics in parallel across isolated git worktrees, with present lead monitoring via SendMessage.
npx claudepluginhub gregoryho/arcforge --plugin arcforgeThis skill uses the workspace's default tool permissions.
Dispatch one Claude Code **agent teammate** per ready epic. Lead stays present, messages teammates via SendMessage, intervenes on blockers. Teammates implement inside isolated worktrees and merge back to a short-lived dev branch — intermediate noise (retries, fix-forward commits) is fine; the deliverable is stability at HEAD, not clean history. The user decides promotion afterward.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Dispatch one Claude Code agent teammate per ready epic. Lead stays present, messages teammates via SendMessage, intervenes on blockers. Teammates implement inside isolated worktrees and merge back to a short-lived dev branch — intermediate noise (retries, fix-forward commits) is fine; the deliverable is stability at HEAD, not clean history. The user decides promotion afterward.
Core principle: Teammates are the arcforge-supported substrate for lead-present multi-epic parallelism. Manual "open N Claude windows" is a fallback, not the default. Don't over-protect the dev branch, don't pre-identify conflicts — let runtime handle runtime.
| Condition | Route to |
|---|---|
| 2+ ready epics, lead staying present ("I'll watch", "step in if needed") | arc-dispatching-teammates (this skill) |
| 2+ ready epics, lead walking away ("overnight", "going to bed") | arc-looping --pattern dag |
| 1 ready epic | arc-coordinating expand + arc-implementing |
| Feature-level parallelism inside one worktree | arc-dispatching-parallel |
No specs/<spec-id>/dag.yaml | arc-planning first |
The boundary vs arc-looping is attendance, not risk. A risky epic with the lead watching is still teammates; a safe epic with the lead walking away is still arc-looping.
REQUIRED BACKGROUND: arc-using (injected at SessionStart).
REQUIRED PRECEDENT: arc-planning must have produced specs/<spec-id>/dag.yaml.
arcforge status --json shows epics with status: pending, worktree: null, deps completed. If < 2, skill does not apply.--spec-id <id>.team_name and name. If dispatch errors with "unknown parameter team_name", report blocked..arcforge-epic is in cwd.Precondition failure = hard fail. Do not silently fall back to arc-looping or manual juggling.
Identify ready epics. From arcforge status --json, collect every epic with status: pending and worktree: null. Call this set R.
Cap team size at 5. If |R| > 5, take the first 5 as the initial team and queue the rest. ≤5 teammates is Anthropic's documented best practice; beyond 5 coordination overhead exceeds benefit.
TeamCreate BEFORE any Agent dispatch. Use a descriptive name like dispatch-<project>-<timestamp>. Per Agent Teams docs, passing team_name to Agent does NOT auto-create — it triggers a state-sync bug.
Expand worktrees and dispatch teammates in parallel. For each epic in the initial 5:
node scripts/cli.js expand --epic <epic-id> from the project root — creates the canonical worktree and stamps .arcforge-epic. Per-epic, not batch.arcforge status --json; do not reconstruct it.team_name=<team>, name=worker-<epic-id>, spawn prompt from references/spawn-prompt-template.md.Parallel, not sequential — documented good pattern. If some spawns fail with Failed to create teammate pane, you hit GH #40168; retry those sequentially. See references/tmux-timing-race.md.
Monitor. Stay present. Read mailbox periodically, answer questions via SendMessage, intervene on stuck teammates. On completion → Step 6. On acceptance → dispatch next queued epic if any (continuous, not waves).
Acceptance check (per teammate completion) — delegate, do NOT inline. The lead dispatches two subagents with fresh context; the lead does NOT locate code or run tests itself. When a teammate reports done:
Agent(subagent_type='arcforge:spec-reviewer') with specs/<spec-id>/epics/<epic-id>/epic.md and its features/*.md attached (name <spec-id> in the prompt). It locates every acceptance criterion in the merged dev branch and returns PASS/FAIL with file:line evidence.Agent(subagent_type='arcforge:verifier') with the project test command. It runs tests from an empty context and returns raw output.Both PASS → accept. Either FAIL → Step 7 unless the FAIL is a spec defect (spec references wrong file/path, not an impl gap) — see references/acceptance-and-retry.md override-accept protocol. Subagents ARE the gate — running either check inline defeats the purpose. The lead's job is to READ the reports and decide, not execute the checks.
After accepting, shut down the completed teammate to reclaim its pane. Without this, panes accumulate across continuous dispatch and hit tmux limits.
See references/acceptance-and-retry.md for subagent prompts, defect patterns, override-accept, and feedback rules.
Retry loop (on rejection). Up to 3 retries per epic (max 4 total attempts). On rejection:
node scripts/cli.js expand --epic <epic-id> — fresh worktree, fix-forward from current dev HEAD.worker-<epic-id>-retry<N> using references/spawn-prompt-template.md with a prepended ## Previous Attempt Feedback section (cumulative).Retries are for acceptance failures only. Mid-work blockers and merge-conflict escalations are arbitration flows, not retries — counter does not increment. See references/acceptance-and-retry.md for mechanics and edge cases.
Wrap up (three actions, in order). When every epic reaches a terminal state:
node scripts/cli.js cleanup <accepted-epic-id-1> <accepted-epic-id-2> .... The merge commits are already on the dev branch; the worktrees are orphaned scaffolding. Skip permanently failed epics — the user may need their worktree to debug. Do NOT call cleanup from inside a teammate's worktree — per Agent Teams docs, teammates should not run cleanup.TeamDelete. See references/wrap-up-sequence.md for ordering and failure handling.Lives in references/spawn-prompt-template.md with three sections: Your Authority (autonomous end-to-end execution grant), Your Workspace (cd + invoke /arc-implementing), Coordination (SendMessage-only). Read that file before dispatching, fill in <epic-id> and <absolute-worktree-path>, paste into each Agent call. Teammate plain text is invisible to the lead — SendMessage is the only channel.
Rationalizations observed in baseline testing. If you catch yourself saying any of these, stop and re-check routing:
arc-dispatching-parallel already covers this." No — that skill is feature-level inside one worktree. This is epic-level across worktrees.Failed to create teammate pane — downscale the team." No. You hit GH #40168. Retry the failed spawns sequentially. See references/tmux-timing-race.md.ARCFORGE_ROOT=... node "${ARCFORGE_ROOT}/scripts/cli.js"." POSIX footgun — "${VAR}" expands before the inline assignment. Use plain node scripts/cli.js ....arcforge:spec-reviewer per Step 6; it has fresh context and cannot rationalize.arcforge:verifier per Step 6.TeamDelete." Without TeamDelete, panes orphan and the team's runtime state lingers across sessions. Step 8c is not optional.✅ Teammate dispatch: team ready
- Team: dispatch-<project>-<timestamp>
- Teammates spawned: 3 (worker-epic-auth, worker-epic-api, worker-epic-ui)
- Queued: 0
- Lead: monitoring via SendMessage, will run acceptance check per completion
Use this after every dispatched epic has reached a terminal state (accepted or permanently failed). This is the user-facing hand-off — they read this and decide what to do with the dev branch.
🏁 Dispatch session complete
Dev branch: <branch-name> (current HEAD is the deliverable)
Epics:
✅ epic-yaml-output — accepted on attempt 1
spec-reviewer: PASS (10/10 ACs verified)
verifier: PASS (42/42 tests, exit 0)
✅ epic-stats — accepted on attempt 2 (retry 1)
Attempt 1 rejected: getStats() missing perCollection breakdown
(fr-stats-001 AC #5). Retry fixed it.
spec-reviewer: PASS (5/5 ACs)
verifier: PASS (38/38 tests, exit 0)
❌ epic-history — permanently failed after 4 attempts (3 retries)
Final rejection: query_history migration fails on existing DBs.
Last spec-reviewer: FAIL (fr-hist-002 AC #3)
Worktree: <absolute-path> (retained for debugging)
Spec defects recorded for follow-up:
- epic-history, epic-bookmark: spec references src/db.ts but codebase
convention is src/store.ts — override-accepted, spec needs revision
- (or: none observed)
Cleanup performed:
- Accepted worktrees removed: epic-yaml-output, epic-stats
- Team torn down (TeamDelete)
- Failed worktrees retained: epic-history
Next actions you may consider:
- Inspect dev branch HEAD: git log --oneline <branch-name>
- Promote successful work: merge/cherry-pick to main
- Debug the failed epic: /arc-debugging on epic-history
- Discard the session: git branch -D <branch-name>
Each accepted epic MUST show subagent evidence (spec-reviewer + verifier PASS). Missing = Step 6 was skipped. Failed epics show the last subagent FAIL and are NOT auto-cleaned. "Next actions" lists user options — you don't execute them.
⚠️ Teammate dispatch: blocked
- Issue: <precondition that failed, e.g. only 1 ready epic, Agent team_name unsupported>
- Checked: <exact command or tool invocation>
- Action: <remediation — e.g. arc-coordinating for 1 epic, enable teammates, or fall back to arc-looping>
arc-finishing-epic as part of /arc-implementing.arcforge:spec-reviewer + arcforge:verifier per Step 6 on each completion; does NOT run arc-verifying inline.arc-debugging on the specific epics. Do not auto-retry.