agentleFS
raccromptonraccrompton/claude-codex-skills/skills/codex-pr-review/SKILL.md

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

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Mentra-Community/MentraOS★ 2.4ksame name
    2. 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.

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
  1. Distinctive:

    Threshold: only P1/P2 (correctness/security) block.

    line 64

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Identify the head and base:
    SHA=$(git rev-parse HEAD)
    BASE=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name)
  2. 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'
  3. 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.
  4. 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>"
  5. 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>"
  6. 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 include codex-review where 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.

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-review it gates, elsewhere the status is a harmless extra.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.