Pr review

From gittower/git-flow-next · View interactive version

Pr review is an AI agent skill from the GitHub repository gittower/git-flow-next. Create a GitHub PR review with inline comments, preview before posting

How to use this skill

Skill file

PR Review

Create a GitHub PR review with summary and inline diff comments. Writes to a file for preview — never posts automatically.

Arguments

/pr-review <PR number> [--output path]

Instructions

  1. Parse Arguments
  1. Gather PR Information

```bash

gh pr view <number> --json title,author,baseRefName,headRefName,headRefOid,number

```

```bash

gh pr view <number> --json commits --jq '.commits[] | "\(.oid[:7]) \(.messageHeadline)"'

```

  1. Look for Existing Code Review

Check if a /code-review has already been written for this PR:

If found, read it and use it as the basis for the GitHub review — distill the findings into the concise posting format. You still need the diff to map inline comments to correct line numbers.

If not found, perform a fresh review:

  1. Determine Review Event

Based on findings:

  1. Map Inline Comments to Diff Lines

For each finding that warrants an inline comment:

Keep inline comments concise — one finding per comment. The summary provides the overview; inline comments provide the specifics.

  1. Determine Output Location

```bash

HEAD_SHA=$(gh pr view <number> --json headRefOid --jq '.headRefOid' | cut -c1-7)

FILENAME="pr-review-${HEAD_SHA}.md"

```

If --output / -o was provided:

If no --output:

  1. Write Review File

Use this exact format:

````markdown


pr: <number>

event: <APPROVE|COMMENT|REQUEST_CHANGES>


<Opening: get straight to the point. Lead with the required changes,

not generic praise ("solid change") or a re-summary of the PR. If nothing

blocks merge, say so plainly. See GITHUB_GUIDELINES.md.>

Must Fix

Should Fix

Nit

## Inline Comments

### <file>:<line>

<Comment body — concise, actionable. Can use markdown.>

### <file>:<line>

<Comment body>

````

Format rules:

  1. Report to User

Posting

When the user asks to post the review (e.g., "post it", "submit the review"):

  1. Read the review file
  2. Parse frontmatter for pr number and event type
  3. Extract the review body (everything between frontmatter and ## Inline Comments)
  4. Parse inline comments from ## Inline Comments section:
  1. Post using mcp__github__create_pull_request_review with:
  1. Report the posted review URL
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.