Process tasks using async background subagents for massive parallelization and speedup.
Required:
gh) installed and authenticated: gh auth loginOptional:
Non-GitHub Hosting: If using GitLab, Bitbucket, or other platforms, the PR automation features won't work. You can still use parallel task processing, but create PRs manually.
Leverages Gemini CLI's capability to run independent instances via the shell to process multiple tasks in parallel, dramatically reducing implementation time.
Launch multiple phases in parallel when no dependencies exist. Use run_shell_command to spawn background Gemini CLI instances:
# Batch 1: Independent phases (run in parallel)
# Note: `-p/--prompt` is deprecated in newer Gemini CLI versions; prefer the positional prompt.
gemini --approval-mode=yolo "Implement Phase 1..." < /dev/null &
gemini --approval-mode=yolo "Implement Phase 5..." < /dev/null &
gemini --approval-mode=yolo "Implement Phase 8..." < /dev/null &
Within a single phase, parallelize independent sub-tasks using the same pattern. Ensure each subagent has a specific Task ID to prevent overlap.
[... existing dependency analysis logic ...]
[... existing batch logic ...]
Using run_shell_command for background execution:
To launch multiple phases in parallel, use the shell delegation pattern:
gemini --approval-mode=yolo "$(cat <<'EOF'
You are the tdd-developer. Your Task ID is 1.0.
Implement Phase 1: Comparison.
Work through tasks 1.1 through 1.7 from tasks/[task-file].md.
Follow test-driven development and commit after each task.
EOF
)" < /dev/null &
gemini --approval-mode=yolo "$(cat <<'EOF'
You are the tdd-developer. Your Task ID is 5.0.
Implement Phase 5: Performance...
EOF
)" < /dev/null &
Check Subagent Status: Use standard shell commands to monitor background processes or check the filesystem for updates (e.g., new commits or PRs).
# Check if gemini processes are running
ps aux | grep gemini
When a subagent completes, it notifies the orchestrator:
// Subagent 1 completes Phase 1
Result: {
phase: 1,
pr_number: 16,
files_changed: 6,
tests_added: 50,
gap_analysis: "docs/PR_16_GAP_ANALYSIS.md",
status: "ready_for_review"
}
// Orchestrator receives notification
// Triggers next dependent phase (Phase 2)
Each subagent follows this protocol when its phase completes:
git checkout -b feat/phase-X-namegit push -u origin feat/phase-X-namegh pr creategh pr view + gh pr checksdocs/PR_X_GAP_ANALYSIS.md# User starts the processor