async-pr-review

Run asynchronous code reviews, builds, and tests for GitHub pull requests.

107k|14.5k|Updated Apr 17, 2025
One-click install
npx skills add https://github.com/google-gemini/gemini-cli --skill async-pr-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: async-pr-review
Source: https://github.com/google-gemini/gemini-cli/tree/main/.gemini/skills/async-pr-review
Command: npx skills add https://github.com/google-gemini/gemini-cli --skill async-pr-review

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Reviewing pull requests manually is slow and blocks developers waiting for CI results, linting, and AI-driven code analysis. This Skill automates the entire review pipeline in the background so you can continue working while it runs.

Core Features & Use Cases

  • Background Task Orchestration: Spawns parallel jobs for fetching PR diffs, running builds, linting, type-checking, and executing tests without blocking the main agent.
  • AI-Powered Code Review: Invokes Gemini headlessly to perform code reviews and synthesize final assessments from generated logs.
  • Ephemeral Worktree Management: Creates isolated git worktrees in .gemini/tmp/async-reviews/ to avoid lock conflicts with the user's main workspace.
  • Use Case: A maintainer wants to review PR #456 without waiting. They trigger the skill, continue working on other tasks, and later check the status to get a synthesized recommendation on whether to approve the PR.

Quick Start

Start an asynchronous review for pull request number 123 and notify me when it finishes.

Frequently Asked Questions about async-pr-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run an asynchronous code review for a GitHub pull request?

Execute the async-review.sh script with the PR number as an argument, ensuring it runs with the is_background flag set to true. The script provisions an ephemeral worktree, fetches the PR diff, and dispatches parallel jobs for builds, tests, and Gemini-powered reviews.

How to check the status of a running async PR review?

Run the check-async-review.sh script with the PR number to retrieve a structured status report. The output includes STATUS: IN_PROGRESS or STATUS: COMPLETE, along with per-task success indicators and paths to generated log files.

What tools are required for async PR review automation?

The workflow requires git for worktree management, the gh CLI for GitHub API access, npm for running build and test scripts, and the gemini executable for headless AI inference. A policy.toml file restricts the Gemini agent to read-only and safe operations.

Why does the async review create a separate git worktree?

Ephemeral worktrees in .gemini/tmp/async-reviews/pr-<number> prevent git lock conflicts and namespace pollution in the user's main workspace. This allows background jobs to checkout branches and run builds without interfering with active development.

Can async PR review skip local tests if CI already passed?

Yes, the script checks gh pr checks status before running local npm tests. If CI checks pass or are still pending, it skips duplicate local test execution and logs the decision to npm-test.log for transparency.