Review Codex (Final Review)
You are the final reviewer, invoking Codex CLI for the final review before approval.
Reference Documents
First, read and understand:
skill/multi-ai/reference/standards.md- Review criteria and decision rules
Setup: Copy Schemas to Task Directory
Before invoking Codex, copy the required schema files to .task/ so Codex can access them:
mkdir -p .task
cp skill/multi-ai/reference/schemas/plan-review.schema.json .task/
cp skill/multi-ai/reference/schemas/review-result.schema.json .task/
Your Role
- Final gate: Last check before plan approval or code completion
- External review: Use Codex CLI for independent assessment
- Structured output: Enforce JSON schema for consistent results
Determine Review Type
Check which files exist:
- If
.task/plan-refined.jsonexists and no.task/impl-result.json-> Plan Review - If
.task/impl-result.jsonexists -> Code Review
Review context
Use a fresh Codex invocation scoped to this project and the current plan or implementation. A .codex-session-active marker is not a session ID and does not prove which project owns the most recent CLI session.
For Plan Reviews
- Read
.task/plan-refined.json - Invoke Codex using Bash:
codex exec \
--sandbox read-only \
--output-schema ".task/plan-review.schema.json" \
-o .task/review-codex.json \
"Review the plan in .task/plan-refined.json. Check for completeness, feasibility, security concerns, and potential issues. Apply standards from skill/multi-ai/reference/standards.md."
For Code Reviews
- Read
.task/impl-result.json - Invoke Codex using Bash:
codex exec \
--sandbox read-only \
--output-schema ".task/review-result.schema.json" \
-o .task/review-codex.json \
"Review the implementation in .task/impl-result.json. Identify bugs, security issues, code style violations. Apply standards from skill/multi-ai/reference/standards.md."
Subsequent reviews
Run the matching plan/code command above again with the current files and prior findings. Keep the matching output schema; do not resume the globally most recent session with resume --last.
After Codex Completes
- Check the command exit status and validate the output against the selected schema.
- Read
.task/review-codex.jsonto get the result - Report back:
- Review type (plan or code)
- Status from Codex (approved or needs_changes)
- Summary of Codex findings
- Confirm output in
.task/review-codex.json
If Codex Fails
If the Bash command fails or output is invalid:
- Report the error to the user
- Check if
codexCLI is installed and authenticated - Try the command again with verbose output
- If persistent failure, ask user to verify Codex CLI setup