codex-pr-review
Skill1 starsChanged 5 months agoMITView on GitHub
Use at PR submission time (before `gh pr create`) to review the PR diff with the local Codex CLI, post a `codex-review` commit status (success/failure) and a findings comment, then enable auto-merge. Repo-agnostic. Makes Codex a real required check compatible with --auto, at no API cost.
- Commits and pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- Mentra-Community/MentraOStheir own version, first seen Oct 8, 2026
- j4rk0r/claude-skillstheir own version, first seen Apr 7, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- Mentra-Community/MentraOS★ 2.4ksame name
- j4rk0r/claude-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- consulting-codexSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 64
Threshold: only P1/P2 (correctness/security) block.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codex PR review gate
Review the PR diff with the local Codex CLI and report the verdict to GitHub as
a codex-review commit status, so the merge can gate on it. Repo-agnostic:
gh auto-detects the repo; the diff base is the repo's default branch.
Procedure
- Identify the head and base:
SHA=$(git rev-parse HEAD) BASE=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name) - Review the diff (read-only):
git diff "origin/$BASE...HEAD" | codex exec --sandbox read-only --skip-git-repo-check \ 'Review this PR diff for BLOCKING bugs only — correctness and security (P1/P2). For each, give file:line and a one-line description. List nits separately under a NITS heading. If there are no blocking issues, reply with exactly: CLEAN' - Judge (apply
superpowers:receiving-code-review):- Blocking P1/P2 present → fix on the branch, re-push, and re-run from step 1. Cap at 3 rounds.
- CLEAN (or only nits) → go to step 4 (success).
- 3 rounds with blockers still open → step 5 (failure), then STOP and surface to the user. Do not create/merge the PR.
- Post success + comment (PR number
<n>):gh api -X POST "repos/{owner}/{repo}/statuses/$SHA" \ -f state=success -f context=codex-review -f description="Codex: clean" gh pr comment <n> --body "Codex review: clean.<nits summary if any>" - Post failure + comment (only if stopping at the cap):
gh api -X POST "repos/{owner}/{repo}/statuses/$SHA" \ -f state=failure -f context=codex-review -f description="Codex: <N> blocking" gh pr comment <n> --body "Codex review: <N> blocking issue(s):<list>" - Proceed to merge (only after success). Pick the merge command by whether
the repo has branch protection with required checks — check once:
gh api "repos/{owner}/{repo}/branches/$BASE/protection"(a 404 means unprotected).- Protected (required checks exist):
gh pr merge --auto --squash. GitHub waits for the required checks — which includecodex-reviewwhere enforced — and merges when all are green. Fire-and-forget; survives the agent exiting. - Unprotected (no required checks): do NOT use
--auto— with nothing to wait for it merges immediately, before CI runs. Poll the CI runs (gh run list --branch <branch>+gh run view <id> --json conclusion) and merge by hand once green:gh pr merge --squash.
- Protected (required checks exist):
Rules
- Threshold: only P1/P2 (correctness/security) block. Nits go in the comment.
- Self-attestation: you both run Codex and post the status — the PR comment is the durable record. The cloud Codex integration is a bonus second opinion.
- Runs on every PR; in repos that require
codex-reviewit gates, elsewhere the status is a harmless extra.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

