AI-powered GitHub PR/Issue reviews with agentic codebase access. Use when the user needs to review pull requests, analyze code changes, ask questions about PRs, or get AI feedback on GitHub issues.
Use this skill when the user:
GEMINI_API_KEY is setgh repo view to determine if GITHUB_TOKEN is requiredgh auth token for private reposnpx asyncreview review --url <URL> -q "<question>"GEMINI_API_KEY (Required)Before running any command, check for GEMINI_API_KEY:
echo $GEMINI_API_KEY
If empty or not set, ask the user to provide their Gemini API key:
"AsyncReview requires a Gemini API key. Please set
GEMINI_API_KEYin your environment or provide it now."
Then set it:
export GEMINI_API_KEY="user-provided-key"
IMPORTANT: Before reviewing a PR/Issue, you MUST check if the repository is private. If it is, GITHUB_TOKEN is REQUIRED.
From a URL like https://github.com/owner/repo/pull/123, extract:
ownerrepoOption A: Using GitHub CLI (if available)
gh repo view owner/repo --json isPrivate -q '.isPrivate'
Option B: Without GitHub CLI (using curl)
# Try to access the repo via GitHub API without authentication
curl -s -o /dev/null -w "%{http_code}" https://api.github.com/repos/owner/repo
Possible outcomes:
With gh:
true → Repository is private, GITHUB_TOKEN is REQUIREDfalse → Repository is public, GITHUB_TOKEN is optionalWith curl:
200 → Repository is public, GITHUB_TOKEN is optional (but recommended for higher rate limits)404 → Repository is private or doesn't exist, GITHUB_TOKEN is REQUIRED403 → Rate limited, need GITHUB_TOKENGITHUB_TOKEN is set# Check if GITHUB_TOKEN is already set
echo $GITHUB_TOKEN
If empty or not set, obtain it using one of these methods:
Option A: Using GitHub CLI (if available)
# Get token from GitHub CLI (must be authenticated with `gh auth login` first)
export GITHUB_TOKEN=$(gh auth token)
# Verify it's set
echo $GITHUB_TOKEN
If gh auth token fails, authenticate first:
gh auth login
Option B: Without GitHub CLI (create token via web)
repo (Full control of private repositories)export GITHUB_TOKEN="ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Verify it's set
echo $GITHUB_TOKEN
Security tip: For better security, consider creating a fine-grained token with minimal permissions:
Then run the review with the token:
npx asyncreview review --url <URL> -q "question" --github-token $GITHUB_TOKEN
Or set it as an environment variable for the session:
export GITHUB_TOKEN=$(gh auth token)
npx asyncreview review --url <URL> -q "question"
npx asyncreview review --url <PR_URL> -q "question" # Review a PR
npx asyncreview review --url <PR_URL> --expert # Expert code review
npx asyncreview review --url <PR_URL> --output markdown # Markdown output
npx asyncreview review --url <url> -q "question" # Review with question
npx asyncreview review --url <url> -q "q" --output markdown # Markdown output
npx asyncreview review --url <url> -q "q" -o json # JSON output
URL formats supported:
https://github.com/owner/repo/pull/123https://github.com/owner/repo/issues/456GEMINI_API_KEY="your-key" # Required: Google Gemini API key
GITHUB_TOKEN="ghp_xxx" # Optional: For private repos / higher rate limits
npx asyncreview review \
--url https://github.com/stanfordnlp/dspy/pull/9223 \
-q "Does this change break any existing callers?"
Output shows:
npx asyncreview review \
--url https://github.com/owner/repo/pull/123 \
-q "Fetch src/utils.py and check if deprecated_func is still used"
The AI will:
Complete workflow for private repositories:
# Step 1: Extract owner/repo from URL
# URL: https://github.com/myorg/private-repo/pull/42
# owner="myorg", repo="private-repo"
# Step 2: Check if repository is private
## Option A: With GitHub CLI
gh repo view myorg/private-repo --json isPrivate -q '.isPrivate'
# Output: true (it's private!)
## Option B: Without GitHub CLI (using curl)
curl -s -o /dev/null -w "%{http_code}" https://api.github.com/repos/myorg/private-repo
# Output: 404 (likely private or doesn't exist)
# Step 3: Ensure GITHUB_TOKEN is set
echo $GITHUB_TOKEN
## If empty, Option A: Get from GitHub CLI
export GITHUB_TOKEN=$(gh auth token)
## If empty, Option B: Create via web (https://github.com/settings/tokens)
## Then:
export GITHUB_TOKEN="ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Step 4: Run the review with the token
npx asyncreview review \
--url https://github.com/myorg/private-repo/pull/42 \
-q "Does this PR introduce any security vulnerabilities?" \
--github-token $GITHUB_TOKEN
# Alternative: Token is already in environment, no flag needed
npx asyncreview review \
--url https://github.com/myorg/private-repo/pull/42 \
-q "Does this PR introduce any security vulnerabilities?"
If you get a 404 or authentication error: The repository is likely private, and you need to provide GITHUB_TOKEN.
| Format | Flag | Description |
|--------|------|-------------|
| Pretty | (default) | Rich terminal output with boxes |
| Markdown | --output markdown or -o markdown | Markdown formatted |
| JSON | --output json or -o json | Machine-readable |
Use --expert flag for comprehensive PR reviews covering SOLID principles, security, performance, and code quality:
# Full expert review (no question needed)
npx asyncreview review --url <PR_URL> --expert
# Expert review with additional custom question
npx asyncreview review --url <PR_URL> --expert -q "Also check for breaking API changes"
Expert review analyzes:
Output includes:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer