Collaborative Multi-Agent Fix
Fix the user's task using codex, gemini-cli, and an independent subagent in coordinated rounds.
Requirements
- The
codexandgemini-cliskills must be available. If missing, report the error and stop. - A
code-reviewersubagent if available; otherwise use thegeneral-purposeagent. - Expand the user's task into a concise problem description that all agents can act on. Do not reinterpret the user's wording — preserve it verbatim alongside your expansion.
Constraints
- Always run codex and gemini-cli in read-only mode. For codex:
--sandbox read-only. For gemini-cli: do NOT pass--yoloor-s. - Timeout: pass
timeout: 600000(10 min) when calling Bash for codex/gemini commands.
Workflow
Propose plans in parallel. Ask codex, gemini-cli, and a subagent to analyze the problem and propose fix plans:
- codex:
echo "Analyze <description>. Propose a fix plan with steps and tradeoffs." | codex exec --skip-git-repo-check --sandbox read-only - 2>/dev/null - gemini-cli:
gemini "Analyze <description>. Propose a fix plan with steps and tradeoffs." -o json 2>/dev/null | jq -r '.response' - subagent: launch an appropriate agent (prefer
code-reviewer) to analyze independently
- codex:
Compare and choose. Summarize tradeoffs across the 3 plans. Ask the user only the necessary clarifying questions via
AskUserQuestionto pick the best fix.Implement. Ultrathink and implement the fix yourself. Do not git commit.
Cross-review the diff in parallel.
- codex:
(echo "Review the following uncommitted diff."; git diff) | codex exec --skip-git-repo-check --sandbox read-only - 2>/dev/null - gemini-cli:
(echo "Review the following uncommitted diff."; git diff) | gemini -o json 2>/dev/null | jq -r '.response' - subagent: launch a code-review agent on the diff
- codex:
Resolve feedback. If any item depends on human preference, ask the user via
AskUserQuestion.Iterate. Repeat steps 3–5 until all three reviewers are satisfied, or 5 rounds are reached. If no consensus after 5 rounds, report the root cause and what remains disputed.