AgentSkillsCN

review

使用 OpenAI Codex 对代码进行全面审查。当用户说“review”、“/review”、“review my changes”,或希望获得 AI 驱动的代码分析时,可选用此方法。 收集来自 GitHub、Linear 或 Sentry 问题的相关上下文信息。

SKILL.md
--- frontmatter
name: review
description: |
  Exhaustive code review using OpenAI Codex. Use when user says "review",
  "/review", "review my changes", or wants AI-powered code analysis.
  Gathers context from GitHub/Linear/Sentry issues.
allowed-tools: Bash, Read, Glob, Grep

Review

Exhaustive AI-powered code review via OpenAI Codex.

When to Use

  • User says "review", "/review", "review my changes"
  • Before creating PR
  • After completing feature work

Workflow

1. Gather Issue References

Scan conversation for:

  • GitHub: #123, org/repo#123, GitHub URLs
  • Linear: PROJ-123, Linear URLs
  • Sentry: sentry:ID, Sentry URLs

2. Read Plan File (if exists)

Check for active plan in conversation or ~/.claude/plans/

3. Read Referenced Files

If user mentions @file.ts or specific files, include content.

4. Run Review

bash
./scripts/review.py codex \
  --base main \
  --issues "#123,PROJ-456" \
  --plan ./plan.md \
  --files "src/api.ts"

Command

bash
./scripts/review.py codex [OPTIONS]

Options

OptionDescription
--base, -b BRANCHCompare against branch (default: main)
--uncommitted, -uReview staged/unstaged/untracked changes
--commit, -c SHAReview specific commit
--issues, -i REFSIssue refs: #123, PROJ-456, sentry:ID, or URLs
--plan, -p PATHPlan file for context
--files, -f PATHSAdditional files (comma-separated)
--title, -t TEXTCommit/PR title for summary
--model, -m MODELCodex model (default: gpt-5.1-codex-max)

Context Command

Gather context without running review:

bash
./scripts/review.py context [OPTIONS]
OptionDescription
--issues, -i REFSIssue refs (comma-separated)
--plan, -p PATHPlan file path
--files, -f PATHSAdditional files (comma-separated)
--output, -o FORMATjson or markdown (default: markdown)

Requirements

  • codex CLI installed and authenticated
  • LINEAR_API_KEY - (optional) Linear API key for Linear issues
  • SENTRY_AUTH_TOKEN - (optional) Sentry auth token
  • SENTRY_ORG - (optional) Sentry org slug

Output

The script displays gathered context to stderr, then launches codex review interactively. Codex outputs its review directly to the terminal.

Examples

bash
# Review changes against main
./scripts/review.py codex --base main

# Review uncommitted changes
./scripts/review.py codex --uncommitted

# Review with GitHub issue context
./scripts/review.py codex --issues "#123"

# Review with plan file
./scripts/review.py codex --plan ./plan.md

# Gather context as JSON (without running review)
./scripts/review.py context --issues "#123" --output json