Autoreview

From openclaw/clawhub · View interactive version

Autoreview is an AI agent skill from the GitHub repository openclaw/clawhub. Use when ClawHub needs Codex review, autoreview, second-model review, or a final advisory review gate before commit, PR update, ship, or maintainer handoff.

How to use this skill

Skill file

Autoreview

Run Codex's built-in code review as a closeout check. This is code review

(codex review), not Guardian auto_review approval routing.

Codex native review mode performs best and is recommended. Non-Codex reviewers

are fallback or second-opinion paths that receive a generated diff prompt, not

the full Codex review-mode runtime.

Use when:

CLI packages, or workflows

Contract

behavior.

that over-complicate the codebase.

clearly improves the bug class.

findings.

review helper.

helper can fall back to claude -p, pi -p, opencode run, droid exec, or

copilot.

accepted/actionable findings. Do not run an extra direct codex review just

to get a nicer clean line, a second opinion, or clearer closeout wording.

code comment only when it explains a real invariant or ownership decision

future reviewers should know.

update.

ClawHub Proof Routing

Pick the smallest proof that matches the touched surface:

| Touched surface | Usual proof |

| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |

| Formatting/lint/static repo health | bun run ci:static |

| Unit-tested source behavior | focused bunx vitest run ..., then bun run ci:unit when PR-ready |

| Convex code | read convex/_generated/ai/guidelines.md first; run focused tests and the deploy/typecheck path that covers the change |

| Packages/CLI/mod tool | bun run ci:packages or the package-specific verify script |

| Runtime/build/package surface | bun run ci:types-build, bun run ci:e2e-http, or the matching broader gate |

| UI behavior | use clawhub-ui-proof with proof:ui; publish proof before final PR comments when needed |

| Linux/CI-parity validation | use crabbox, normally through the repo scripts |

For Convex query or schema work, apply the repo's Convex rules: prefer indexes

over .filter() scans, use cursor-based backfills for data shape changes, and

verify with the repo's Convex/typecheck path before claiming deploy safety.

Pick Target

Dirty local work:

codex review --uncommitted

Use this only when the patch is actually unstaged/staged/untracked in the

current checkout. For committed, pushed, or PR work, point Codex at the commit

or branch diff instead. A clean --uncommitted review only proves there is no

local patch.

Branch/PR work:

git fetch origin
codex review --base origin/main

If an open PR exists, use its actual base:

base=$(gh pr view --json baseRefName --jq .baseRefName)
codex review --base "origin/$base"

Do not pass a prompt with --base. Some Codex CLI versions reject

codex review --base <ref> - with `--base <BRANCH> cannot be used with

[PROMPT]. If that happens, rerun plain codex review --base <ref>` and report

that prompt injection was skipped.

Committed single change:

codex review --commit HEAD

or with the helper:

.agents/skills/autoreview/scripts/autoreview --mode commit --commit HEAD

Use commit review for already-landed or already-pushed work on main.

Reviewing clean main against origin/main is usually an empty diff after

push. For a small stack, review each commit explicitly or review the branch

before merging with --base.

Parallel Closeout

Format first if formatting can change line locations. Then it is OK to run

tests and review in parallel:

.agents/skills/autoreview/scripts/autoreview --parallel-tests "bun run ci:static"

Tradeoff: tests may force code changes that stale the review. If tests or

review lead to code edits, rerun the affected tests and rerun review until no

accepted/actionable findings remain. Once that rerun exits cleanly, stop; do

not spend another long review cycle on redundant confirmation.

Context Efficiency

Codex review is usually noisy. Default to a subagent filter when subagents are

available. Ask it to run the review and return only:

Run inline only for tiny changes or when subagents are unavailable.

Helper

Bundled helper:

.agents/skills/autoreview/scripts/autoreview --help

The helper:

bun.lock, node_modules, and a ci:static script; disable with

AUTOREVIEW_AUTO_TESTS=0

clean main after landing

work; do not force --mode local after committing

means Codex first

not when Codex reports findings

danger-full-access by default; use --no-yolo or AUTOREVIEW_YOLO=0` to opt

out

selected review command exits 0 and no accepted/actionable findings are

reported

Final Report

Include:

finding was consciously rejected

Do not run another Codex review solely to improve final wording. If the final

helper run exited 0 and produced no accepted/actionable findings, report that

exact run as clean.

PR / CI Closeout

use PR rollup only for final mergeability.

upstream before pushing.

or stale enough to block CI.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.