Get the FREE Ultimate OpenClaw Setup Guide →

gh-pr-review

npx machina-cli add skill dceoy/github-cli-agent-skills/gh-pr-review --openclaw
Files (1)
SKILL.md
1.1 KB

GitHub PR Review

When to use

  • The user asks to approve, comment on, or request changes for a PR.

Inputs to confirm

  • PR number/URL/branch (or use current branch PR).
  • Review type: approve, comment, or request changes.
  • Review body text (or file).

Workflow

  1. Verify auth:
    gh --version
    gh auth status
    
  2. Submit review:
    gh pr review 123 --approve --body "LGTM"
    gh pr review 123 --comment --body "Looks good, minor nits below"
    gh pr review 123 --request-changes --body "Please add tests"
    
  3. Confirm status:
    gh pr view 123 --json reviewDecision
    

Examples

# Approve current branch PR
~ gh pr review --approve --body "LGTM"

Notes

  • You cannot approve your own PR.
  • Use --body-file to provide longer feedback.

References

Source

git clone https://github.com/dceoy/github-cli-agent-skills/blob/main/skills/gh-pr-review/SKILL.mdView on GitHub

Overview

This skill automates submitting pull request reviews (approve, comment, or request changes) via the GitHub CLI. It outlines required inputs (PR identifier, review type, and body), the authentication steps, and how to submit and verify the review. Use it to streamline code reviews and ensure consistent feedback.

How This Skill Works

You authenticate with gh, then execute gh pr review <PR> --<type> --body "text" (or use --body-file for longer feedback). After submission, you can verify the result with gh pr view <PR> --json reviewDecision. The workflow covers identifying the PR by number/URL/branch and supports current-branch reviews.

When to Use It

  • Approve a PR that meets criteria and is ready to merge
  • Comment with feedback or questions during the review
  • Request changes to prompt fixes or improvements
  • Review a PR identified by number, URL, or the current branch
  • Verify the review status after submission using gh pr view

Quick Start

  1. Step 1: Verify auth with gh --version and gh auth status
  2. Step 2: Submit a review via gh pr review <PR> --<type> --body "<text>" (or use --body-file)
  3. Step 3: Confirm the result with gh pr view <PR> --json reviewDecision

Best Practices

  • Verify authentication with gh --version and gh auth status before reviewing
  • Confirm the PR identifier (number/URL/branch) or use the current branch PR
  • Choose the correct review type (approve, comment, or request changes); you cannot approve your own PR
  • Use --body-file for longer feedback to keep commands clean
  • After submitting, verify the review status with gh pr view <PR> --json reviewDecision

Example Use Cases

  • Approve the current branch PR: gh pr review --approve --body "LGTM"
  • Comment with feedback: gh pr review 123 --comment --body "Looks good, minor nits below"
  • Request changes: gh pr review 123 --request-changes --body "Please add tests"
  • Approve by URL: gh pr review https://github.com/org/repo/pull/123 --approve --body "LGTM"
  • Use a file for feedback: gh pr review 123 --comment --body-file feedback.txt

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers