AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Github Pr Review Operation

skill-shibayu36-agent-skills-github-pr-review-operation · by shibayu36

Use this skill when the user needs to interact with a GitHub Pull Request — reviewing code, reading diffs, posting review comments, or replying to existing comments. Activate even when the user provides just a PR URL and asks to "check it" or "leave feedback" without explicitly mentioning "review.

No reviews yet
0 installs
39 views
0.0% view→install

Install

$ agentstack add skill-shibayu36-agent-skills-github-pr-review-operation

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-shibayu36-agent-skills-github-pr-review-operation)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Github Pr Review Operation? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

GitHub PR Review Operation

PR review operations using GitHub CLI (gh).

Prerequisites

  • gh installed
  • Authenticated via gh auth login

Resolving OWNER/REPO/NUMBER

Never guess OWNER, REPO, or NUMBER from directory names, paths, or context. Incorrect guesses cause 404 errors and waste API calls.

Pick the approach that matches the input, then use the resulting OWNER, REPO, and NUMBER in every Operation command that follows.

| Input | How to resolve | |---|---| | PR URL given (https://github.com/OWNER/REPO/pull/NUMBER) | Parse OWNER, REPO, NUMBER directly from the URL. | | PR number given | Run gh pr view --json url --jq .url and parse the returned URL. | | No identifier (e.g., "this PR" on a branch) | Run gh pr view --json url --jq .url and parse the returned URL. |

For the gh pr view cases, the command resolves the number or branch against the current working directory's git repository, so OWNER/REPO come from the real repo context rather than a guess.

If gh pr view fails (not in a git repo, branch has no PR, invalid number), ask the user for the full PR URL rather than guessing.

Operations

1. Get PR Info

gh pr view NUMBER --repo OWNER/REPO --json title,body,author,state,baseRefName,headRefName,url

2. Get Diff (with line numbers)

gh pr diff NUMBER --repo OWNER/REPO | awk 'BEGIN {
  while ((getline line) > 0) {
    if (line ~ /^@@/) {
      match(line, /-[0-9]+/); old_line = substr(line, RSTART + 1, RLENGTH - 1)
      match(line, /\+[0-9]+/); new_line = substr(line, RSTART + 1, RLENGTH - 1)
      print line
    } else if (line ~ /^-/) { printf "L%-4d     | %s\n", old_line++, line }
    else if (line ~ /^\+/) { printf "     R%-4d| %s\n", new_line++, line }
    else if (line ~ /^ /) { printf "L%-4d R%-4d| %s\n", old_line++, new_line++, line }
    else print line
  }
}'

Example output:

@@ -46,15 +46,25 @@ jobs:
L46   R46  |            prompt: |
L49       | -            (deleted line)
     R49  | +            (added line)
L50   R50  |              # Review guidelines
  • L: LEFT (base) side line number - use with side=LEFT for inline comments
  • R: RIGHT (head) side line number - use with side=RIGHT for inline comments

3. Get Comments

Issue Comments (comments on the entire PR):

gh api repos/OWNER/REPO/issues/NUMBER/comments --jq '.[] | {id, user: .user.login, created_at, body}'

Review Comments (comments on specific code lines):

gh api repos/OWNER/REPO/pulls/NUMBER/comments --jq '.[] | {id, user: .user.login, path, line, created_at, body, in_reply_to_id}'

4. Comment on PR

gh pr comment NUMBER --repo OWNER/REPO --body "Comment body"

For a complex body (backticks, $, quotes, newlines), write the body to a file and pass it with --body-file :

gh pr comment NUMBER --repo OWNER/REPO --body-file 

5. Inline Comment (on specific code lines)

First, get the head commit SHA:

gh api repos/OWNER/REPO/pulls/NUMBER --jq '.head.sha'

Single line comment:

gh api repos/OWNER/REPO/pulls/NUMBER/comments \
  --method POST \
  -f body="Comment body" \
  -f commit_id="COMMIT_SHA" \
  -f path="src/example.py" \
  -F line=15 \
  -f side=RIGHT

Multi-line comment (lines 10-15):

gh api repos/OWNER/REPO/pulls/NUMBER/comments \
  --method POST \
  -f body="Comment body" \
  -f commit_id="COMMIT_SHA" \
  -f path="src/example.py" \
  -F line=15 \
  -f side=RIGHT \
  -F start_line=10 \
  -f start_side=RIGHT

For a complex body (backticks, $, quotes, newlines), write the body to a file and pass it with -F body=@. Do not use -f body=@-f (raw-field) does not expand @, so the literal path is posted as the body.

gh api repos/OWNER/REPO/pulls/NUMBER/comments \
  --method POST \
  -F body=@ \
  -f commit_id="COMMIT_SHA" \
  -f path="src/example.py" \
  -F line=15 \
  -f side=RIGHT

Notes:

  • -f (raw-field): sends the value as a literal string; does not expand @file
  • -F (field): converts numbers/booleans by type and expands @file into file contents. Use -F for numeric parameters (line, start_line) and for passing a body from a file. Using -f for numeric parameters sends them as strings and causes errors
  • side: RIGHT (added lines) or LEFT (deleted lines)

6. Reply to a Comment

gh api repos/OWNER/REPO/pulls/NUMBER/comments/COMMENT_ID/replies \
  --method POST \
  -f body="Reply body"

For a complex body, write it to a file and pass it with -F body=@ (see Operation 5).

Use the id obtained from comment retrieval as COMMENT_ID.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.