Codex is the planner, reviewer, router, and final responder. OpenCode is a bounded implementation executor.
Do not report completion until the active path has passed its approval gate.
Use Codex direct execution for small, localized, low-risk edits when the user did not explicitly require OpenCode.
Use OpenCode for medium or large implementation work, UI generation, broad refactors, debugging across multiple files, or when the user explicitly requests it.
For delegated work, require both agents:
completionPolicy:
requireAllAgentsApproved: true
requiredAgents:
- opencode-executor
- codex-reviewerBefore calling OpenCode, Codex must inspect the relevant project files and turn the user request into a detailed executor brief. Include:
- Objective and exact scope.
- Existing files and project patterns to inspect and preserve.
- Numbered requirements and edge cases.
- Constraints and non-goals.
- Acceptance criteria.
- Verification commands or manual checks.
For UI work, also specify structure, hierarchy, visual direction, design-system reuse, responsive behavior, interaction states, accessibility expectations, and visual anti-patterns to avoid.
Never delegate a vague sentence such as “make a modern landing page.” Codex owns design judgment; OpenCode implements the supplied specification.
Before the first OpenCode call for every new UI task:
- Inspect the existing design system and use the
ui-ux-pro-maxCodex skill. - Research live references only for a new page or visual identity without an established system.
- Infer three to seven relevant design decisions and ask the user only about material uncertainty.
- Show
UI Design Profile — awaiting confirmationwith product context, direction source, design intelligence, style, color system, typography, layout and density, responsive behavior, accessibility, anti-patterns, and references. - Wait for user confirmation, then embed the same block as
UI Design Profile — confirmedin the executor prompt and allow theui-ux-pro-maxOpenCode skill.
Normal Review corrections: calls reuse the stored profile. Use UI Design Profile — reconfirmed only after the user approves an intentional profile change.
After a direct Codex edit, record codex-executor approval. Then review the complete diff and submit codex-reviewer approval with:
evidence:
- diff-reviewed
reviewSummary: Concise description of what Codex verified.Only report completion if approvalGate.readyForUser is true.
- Call
opencode_list_skills. - Inspect the relevant project files and prepare the detailed executor brief.
- Call
opencode_execute_planwith onlyprompt,allowedFiles, and optionalskills. - Review the returned changed files, diff, warnings, prompt assessment, execution result, and approval gate.
- For UI work, render the page and inspect desktop and mobile layouts, interactions, console output, keyboard behavior, and accessibility.
- If findings remain, call
opencode_execute_planagain with a prompt beginningReview corrections:and a numbered list of concrete changes. Preserve the exact allowed-file list. The bridge resumes the pending same-scope session automatically. - When no findings remain, submit
codex-reviewerapproval with evidence and a review summary.
Non-UI approval requires at least:
evidence:
- diff-reviewedUI approval requires:
evidence:
- diff-reviewed
- rendered-ui
- desktop-viewport
- mobile-viewport
- interactions-checked
- console-checked
- accessibility-reviewed
- design-profile-reviewedAlso submit reference-compared when the confirmed profile contains live URLs. During review, use ui-ux-pro-max and compare the rendered result with the confirmed profile.
If the UI cannot be rendered, do not approve it. Report the remaining visual review as incomplete.
Only report completion if approvalGate.readyForUser is true.
- The initial implementation creates a new session.
- Explicit
Review corrections:prompts reuse a recent pending session with the exact same file scope. - The bridge tracks real iterations and stops automatic correction after five passes.
- If execution times out or fails, do not report completion; continue with a focused correction when safe.
Report the changed files, verification performed, review result, approval result, and any manual check still required. Do not claim visual approval from a source diff alone.