AgentSkillsCN

codex-pr-review

使用 OpenAI Codex(gpt-5.3-codex)对拉取请求进行评审。适用于用户希望通过 Codex 获取外部 AI 代码评审、为 PR 提供第二意见,或进行跨模型评审时使用。支持自动检测当前分支的 PR,或明确指定 PR 编号/URL。

SKILL.md
--- frontmatter
name: codex-pr-review
description: Review a pull request using OpenAI Codex (gpt-5.3-codex). Use when the user wants an external AI code review via Codex, a second opinion on a PR, or a cross-model review. Supports auto-detection of current branch PR or explicit PR number/URL.
license: MIT
metadata:
  author: sasser
  version: 0.1.0
allowed-tools: Bash
argument-hint: "[PR_NUMBER|PR_URL] [--threshold FLOAT] [--model MODEL]"

Codex PR Review

Review a pull request using OpenAI Codex for an independent, cross-model code review.

Prerequisites

  • codex CLI installed and on PATH
  • codex authenticated via OAuth (codex login) — headless mode (codex exec) requires OAuth, not an API key
  • gh CLI installed and authenticated
  • Current directory must be a git repository

Usage

code
/codex-pr-review                          # Auto-detect PR for current branch
/codex-pr-review 123                      # Review PR #123
/codex-pr-review --threshold 0.6          # Lower confidence threshold
/codex-pr-review 123 --model gpt-5.2-codex  # Use a specific model

Arguments

ArgumentDefaultDescription
PR_NUMBER or PR_URLauto-detectPR to review. If omitted, detects from current branch
--threshold0.8Minimum confidence score (0-1) for reporting findings
--modelgpt-5.3-codexCodex model to use

How to Execute This Skill

When this skill is invoked, run the review script:

bash
bash $CLAUDE_PLUGIN_ROOT/scripts/review.sh [ARGS]

Where [ARGS] are the arguments the user passed after /codex-pr-review.

If $CLAUDE_PLUGIN_ROOT is not set, use the absolute path:

bash
bash ~/.claude/skills/codex-pr-review/scripts/review.sh [ARGS]

Interpreting Results

The script outputs JSON to stdout on success. Read the output and present it to the user as a formatted summary. If the script exits non-zero, display the error message to the user.

After the script succeeds, inform the user:

  • How many findings were found vs. how many passed the threshold
  • The overall correctness verdict and confidence
  • That the review has been posted as a PR comment (with link)

Error Handling

Exit CodeMeaning
0Success - review posted
1Missing prerequisite (codex, gh, or OAuth not configured)
2PR not found or not detectable
3Codex execution failed
4Failed to post comment