request-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Request Review

发起代码审查

Use this skill when an agent needs to request code review and route the result back into a specific tmux pane.
Run:
  • ~/.codex/skills/request-review/scripts/request-review <tmux-pane-target> <commit-message>
Examples:
  • ~/.codex/skills/request-review/scripts/request-review "coolproject-78-dialpad:1.1" "fix: address review findings"
  • ~/.codex/skills/request-review/scripts/request-review "%9" "chore: review checkpoint"
Use stable pane identifiers. Prefer
%<pane-id>
or
<session>:<window-index>.<pane-index>
. Avoid window-name-based targets because names can change with the active command.
当Agent需要发起代码审查并将结果返回至指定tmux面板时,可使用此技能。
运行:
  • ~/.codex/skills/request-review/scripts/request-review <tmux-pane-target> <commit-message>
示例:
  • ~/.codex/skills/request-review/scripts/request-review "coolproject-78-dialpad:1.1" "fix: address review findings"
  • ~/.codex/skills/request-review/scripts/request-review "%9" "chore: review checkpoint"
请使用稳定的面板标识符。优先选择
%<pane-id>
<session>:<window-index>.<pane-index>
格式。避免使用基于窗口名称的目标,因为窗口名称会随当前执行的命令发生变化。

Preferred workflow

推荐工作流

  • If explicitly asked to use this skill, do not manually commit/push first.
  • Run this skill directly and let it handle commit/push in the default path.
  • Use the opt-in existing-commit mode only as recovery when a commit was already created/pushed by mistake.
  • Wait for review, do not finish your turn until the agent is done reviewing your code.
  • Take remediary action as needed and request another review.
  • If you pass, this is a good stopping point.
  • 如果明确要求使用此技能,请不要先手动执行提交/推送操作。
  • 直接运行此技能,由其在默认流程中处理提交/推送操作。
  • 仅当误创建/推送了提交时,才启用已有提交模式作为恢复手段。
  • 等待审查完成,在Agent完成代码审查前不要结束当前任务。
  • 根据需要采取补救措施并再次发起审查请求。
  • 如果审查通过,此时是合适的终止节点。

Behavior

行为逻辑

  • Default path: commits first using the provided commit message (
    git add -A
    then
    git commit -m ...
    ).
  • Default path: uses the newly created
    HEAD
    commit as the target review SHA.
  • Opt-in recovery path: set
    REQUEST_REVIEW_USE_EXISTING_COMMIT=1
    to skip
    git add
    /
    git commit
    and review an existing commit (defaults to
    HEAD
    , or
    REQUEST_REVIEW_EXISTING_COMMIT_SHA
    ).
  • Runs exactly one review request at a time (global lock).
  • Sends final review text back to the target pane, waits 5 seconds, then sends Enter.
  • 默认流程:使用提供的提交信息先执行提交操作(
    git add -A
    然后
    git commit -m ...
    )。
  • 默认流程:将新创建的
    HEAD
    提交作为审查目标SHA。
  • 可选恢复流程:设置
    REQUEST_REVIEW_USE_EXISTING_COMMIT=1
    以跳过
    git add
    /
    git commit
    步骤,直接审查已有提交(默认使用
    HEAD
    ,或通过
    REQUEST_REVIEW_EXISTING_COMMIT_SHA
    指定)。
  • 同一时间仅运行一个审查请求(全局锁机制)。
  • 将最终审查文本发送至目标面板,等待5秒后发送回车键。

Mode switch (from
.env
)

模式切换(通过.env文件配置)

  • REQUEST_REVIEW_MODE=remote
    • Default path pushes branch (
      git push -u origin HEAD
      ).
    • With
      REQUEST_REVIEW_USE_EXISTING_COMMIT=1
      , skips push and hooks review onto the existing commit SHA.
    • Finds the PR for current branch.
    • Posts
      @codex review
      to trigger cloud review explicitly.
    • Polls until one condition is met for the target commit SHA:
      1. New inline PR review comment(s) from
        chatgpt-codex-connector[bot]
        on that commit.
      2. New
        +1
        reaction from
        chatgpt-codex-connector[bot]
        on the PR issue after the commit timestamp.
    • If inline comments exist, returns detailed findings with links.
    • If only thumbs-up exists, returns
      👍
      summary.
  • REQUEST_REVIEW_MODE=local
    • Runs
      codex exec -s read-only --json review --commit <sha> --title <commit-message>
      in the current repo.
    • Uses
      REQUEST_REVIEW_LOCAL_PROFILE
      from
      .env
      and reads model/reasoning from that profile in
      ~/.codex/config.toml
      .
    • If the profile is missing in
      config.toml
      , exits with an error.
    • Writes output to
      review.log
      and stderr to
      review.err.log
      .
  • REQUEST_REVIEW_MODE=remote
    (远程模式)
    • 默认流程会推送分支(
      git push -u origin HEAD
      )。
    • 若设置
      REQUEST_REVIEW_USE_EXISTING_COMMIT=1
      ,则跳过推送步骤,直接基于已有提交SHA发起审查。
    • 查找当前分支对应的PR。
    • 发送
      @codex review
      指令以显式触发云端审查。
    • 轮询直至目标提交SHA满足以下任一条件:
      1. chatgpt-codex-connector[bot]
        在该提交下新增了PR内联审查评论。
      2. chatgpt-codex-connector[bot]
        在提交时间之后,针对PR议题新增了
        +1
        (👍)反应。
    • 若存在内联评论,则返回包含链接的详细审查结果。
    • 若仅有点赞反应,则返回
      👍
      作为总结。
  • REQUEST_REVIEW_MODE=local
    (本地模式)
    • 在当前代码仓库中运行
      codex exec -s read-only --json review --commit <sha> --title <commit-message>
      命令。
    • 使用.env文件中配置的
      REQUEST_REVIEW_LOCAL_PROFILE
      ,并从
      ~/.codex/config.toml
      文件的该配置项中读取模型/推理相关设置。
    • 若config.toml中缺少该配置项,则程序会报错退出。
    • 将输出内容写入
      review.log
      文件,错误信息写入
      review.err.log
      文件。

Config source

配置文件来源

  • ~/.codex/skills/request-review/.env
Useful variables:
  • REQUEST_REVIEW_MODE=local|remote
  • REQUEST_REVIEW_BOT_LOGIN=chatgpt-codex-connector[bot]
  • REQUEST_REVIEW_TRIGGER_COMMENT=@codex review
  • REQUEST_REVIEW_POLL_INTERVAL_SECONDS=20
  • REQUEST_REVIEW_TIMEOUT_SECONDS=1800
  • REQUEST_REVIEW_LOCAL_PROFILE=local-review
  • REQUEST_REVIEW_USE_EXISTING_COMMIT=0|1
    (default
    0
    )
  • REQUEST_REVIEW_EXISTING_COMMIT_SHA=<sha-or-ref>
    (default
    HEAD
    when existing-commit mode is enabled)
  • ~/.codex/skills/request-review/.env
常用配置变量:
  • REQUEST_REVIEW_MODE=local|remote
  • REQUEST_REVIEW_BOT_LOGIN=chatgpt-codex-connector[bot]
  • REQUEST_REVIEW_TRIGGER_COMMENT=@codex review
  • REQUEST_REVIEW_POLL_INTERVAL_SECONDS=20
  • REQUEST_REVIEW_TIMEOUT_SECONDS=1800
  • REQUEST_REVIEW_LOCAL_PROFILE=local-review
  • REQUEST_REVIEW_USE_EXISTING_COMMIT=0|1
    (默认值为
    0
  • REQUEST_REVIEW_EXISTING_COMMIT_SHA=<sha-or-ref>
    (当启用已有提交模式时,默认值为
    HEAD

Critical discipline

重要规范

  • Only run one review request at a time.
  • Do not launch concurrent review requests.
  • 同一时间仅能运行一个审查请求。
  • 禁止发起并发的审查请求。