async-pr-review 精选
Trigger this skill when the user wants to start an asynchronous PR review, run background checks on a PR, or check the status of a previously started async PR review.
安装方式
cp -r .gemini/skills/async-pr-review ~/.claude/skills/async-pr-review把该 skill 目录放进客户端 skills 目录。不同客户端的目录可能不同,Claude Code 默认是 ~/.claude/skills/
https://raw.githubusercontent.com/google-gemini/gemini-cli/9b6e0265d16bbd29ca51e33c9e0c01dc4cec5e83/.gemini/skills/async-pr-review/SKILL.md下载后另存为 ~/.claude/skills/async-pr-review/SKILL.md。链接锁定采集时的 commit,内容与本站展示一致。
整仓一次性获取:git clone --depth 1 https://github.com/google-gemini/gemini-cli.git
依赖与权限
- 无需 API Key
- 无需联网
- 依赖外部命令:
git - 以上为按正文与 frontmatter 自动推断的信号,仅供参考;安装前建议先阅读原文。
SKILL.md 正文
Async PR Review
This skill provides a set of tools to asynchronously review a Pull Request. It will create a background job to run the project's preflight checks, execute Gemini-powered test plans, and perform a comprehensive code review using custom prompts.
This skill is designed to showcase an advanced "Agentic Asynchronous Pattern":
- Native Background Shells vs Headless Inference: While Gemini CLI can natively spawn and detach background shell commands (using the
run_shell_commandtool withis_background: true), a standard bash background job cannot perform LLM inference. To conduct AI-driven code reviews and test generation in the background, the shell script must invoke thegeminiexecutable headlessly using-p. This offloads the AI tasks to independent worker agents. - Dynamic Git Scoping: The review scripts avoid hardcoded paths. They use
git rev-parse --show-toplevelto automatically resolve the root of the user's current project. - Ephemeral Worktrees: Instead of checking out branches in the user's main workspace, the skill provisions temporary git worktrees in
.gemini/tmp/async-reviews/pr-<number>. This prevents git lock conflicts and namespace pollution. - Agentic Evaluation (
check-async-review.sh): The check script outputs clean JSON/text statuses for the main agent to parse. The interactive agent itself synthesizes the final assessment dynamically from the generated log files.
Workflow
- Determine Action: Establish whether the user wants to start a new async review or check the status of an existing one.
- If the user says "start an async review for PR #123" or similar, proceed to Start Review.
- If the user says "check the status of my async review for PR #123" or similar, proceed to Check Status.
Start Review
If the user wants to start a new async PR review:
- Ask the user for the PR number if they haven't provided it.
- Execute the
async-review.shscript, passing the PR number as the first argument. Be sure to run it with theis_backgroundflag set to true to ensure it immediately detaches.
.gemini/skills/async-pr-review/scripts/async-review.sh <PR_NUMBER>
- Inform the user that the tasks have started successfully and they can check the status later.
Check Status
If the user wants to check the status or view the final assessment of a previously started async review:
- Ask the user for the PR number if they haven't provided it.
- Execute the
check-async-review.shscript, passing the PR number as the first argument:
.gemini/skills/async-pr-review/scripts/check-async-review.sh <PR_NUMBER>
- Evaluate Output: Read the output from the script.
- If the output contains
STATUS: IN_PROGRESS, tell the user which tasks are still running. - If the output contains
STATUS: COMPLETE, use your file reading tools (read_file) to retrieve the contents offinal-assessment.md,review.md,pr-diff.diff,npm-test.log, andtest-execution.logfiles from theLOG_DIRspecified in the output. - Final Assessment: Read those files, synthesize their results, and give the user a concise recommendation on whether the PR builds successfully, passes tests, and if you recommend they approve it based on the review.
质量与来源
- 所属仓库
- google-gemini/gemini-cli
- 仓库星标
- 11 万
- 最近更新
- 今天
- 采集时间
- 今天
- commit
- 9b6e0265d16b
- 内容指纹
- sha256:1502652fdef089c
- 文件路径
- .gemini/skills/async-pr-review/SKILL.md