$npx -y skills add minghinmatthewlam/agent-guards --skill codex-reviewRun Codex's built-in codex review command as a fallback or explicit compatibility check for local changes, branches, commits, and PR work.
| 1 | # Codex Review |
| 2 | |
| 3 | Use Codex's dedicated review command as an independent fallback check. This is `codex review`, not OpenClaw `autoreview`, not Guardian approval `auto_review`, and not a generic "ask a subagent to review" pass. |
| 4 | |
| 5 | For plain "autoreview" or normal closeout review requests, use the `autoreview` skill instead. Use this skill only when the user explicitly asks for built-in Codex review, when comparing review tools, or when `autoreview` is unavailable. |
| 6 | |
| 7 | Use when: |
| 8 | - the user asks specifically for built-in Codex review or `codex review` |
| 9 | - comparing `codex review` against `autoreview` |
| 10 | - `autoreview` fails or is unavailable and a fallback review is still useful |
| 11 | - reviewing a local dirty tree, branch, commit, or PR branch after fixes |
| 12 | |
| 13 | ## Contract |
| 14 | |
| 15 | - Treat review output as advisory. Verify every finding against the real code path before changing code. |
| 16 | - Prefer small fixes at the right ownership boundary. Do not add broad refactors just to satisfy a speculative finding. |
| 17 | - Reject findings that depend on unstated assumptions, unrealistic edge cases, intentional behavior, or over-complicated fixes. |
| 18 | - If a review finding causes a code change, rerun the focused proof/tests and rerun Codex review. |
| 19 | - Keep looping until the final review has no accepted/actionable findings, or until a remaining finding is explicitly rejected with a short reason. |
| 20 | - Do not push only to run review. Push only when the user asked for push, ship, or PR update. |
| 21 | |
| 22 | ## Pick The Target |
| 23 | |
| 24 | Dirty local work: |
| 25 | |
| 26 | ```bash |
| 27 | codex review --uncommitted |
| 28 | ``` |
| 29 | |
| 30 | Use this only when the working tree actually has staged, unstaged, or untracked changes. A clean `--uncommitted` run only proves there is no local patch. |
| 31 | |
| 32 | Branch or PR work: |
| 33 | |
| 34 | ```bash |
| 35 | git fetch origin |
| 36 | codex review --base origin/main |
| 37 | ``` |
| 38 | |
| 39 | If an open PR exists, review against its actual base: |
| 40 | |
| 41 | ```bash |
| 42 | base=$(gh pr view --json baseRefName --jq .baseRefName) |
| 43 | codex review --base "origin/$base" |
| 44 | ``` |
| 45 | |
| 46 | Committed single change: |
| 47 | |
| 48 | ```bash |
| 49 | codex review --commit HEAD |
| 50 | ``` |
| 51 | |
| 52 | Custom review prompt: |
| 53 | |
| 54 | ```bash |
| 55 | codex review "Review the error handling in the new auth flow." |
| 56 | ``` |
| 57 | |
| 58 | Current Codex CLI targets are mutually exclusive. Do not combine `--base`, `--commit`, or `--uncommitted` with a positional custom prompt. |
| 59 | |
| 60 | ## Helper |
| 61 | |
| 62 | This skill includes a helper that chooses a sensible target and can run focused tests in parallel: |
| 63 | |
| 64 | ```bash |
| 65 | ~/.agents/skills/codex-review/scripts/codex-review --help |
| 66 | ``` |
| 67 | |
| 68 | After sync, Claude can call the same helper here: |
| 69 | |
| 70 | ```bash |
| 71 | ~/.claude/skills/codex-review/scripts/codex-review --help |
| 72 | ``` |
| 73 | |
| 74 | The helper: |
| 75 | - chooses dirty `--uncommitted` first in `--mode auto` |
| 76 | - otherwise uses the current PR base if `gh pr view` works |
| 77 | - otherwise uses `origin/main` for non-main branches |
| 78 | - supports `--mode local`, `--mode branch`, `--base`, `--commit`, `--dry-run`, and `--parallel-tests` |
| 79 | - supports `--full-access` for nested Codex review runs that need the local command to bypass Codex sandbox prompts |
| 80 | - prints `codex-review clean: no accepted/actionable findings reported` when the selected review command exits 0 and no priority findings are detected |
| 81 | |
| 82 | Format first if formatting can move line numbers, then it is OK to run tests and review together: |
| 83 | |
| 84 | ```bash |
| 85 | ~/.agents/skills/codex-review/scripts/codex-review --parallel-tests "npm test -- --runInBand" |
| 86 | ``` |
| 87 | |
| 88 | If tests or review lead to edits, rerun the affected tests and rerun review. Once the final review/helper run exits cleanly, stop. Do not run an extra review just to get nicer wording. |
| 89 | |
| 90 | ## Subagent Filter |
| 91 | |
| 92 | `codex review` is already a dedicated review harness with a review-specific rubric, constrained tools, fresh context, and structured findings. A normal subagent reviewer is more flexible but easier to bias with the main agent's framing. |
| 93 | |
| 94 | For larger diffs, use a subagent as a filter over `codex review` when available. Ask it to run the review and return only: |
| 95 | - findings it accepts as actionable |
| 96 | - findings it rejects, with one-line reasons |
| 97 | - exact files and tests to rerun |
| 98 | |
| 99 | For tiny changes, run the review inline. |
| 100 | |
| 101 | ## Final Report |
| 102 | |
| 103 | Include: |
| 104 | - review command used |
| 105 | - tests or proof run |
| 106 | - accepted findings and fixes |
| 107 | - rejected findings with short reasons |
| 108 | - final clean review result, or why any remaining finding was consciously rejected |