# review-pr

Runs the ralph review loop on a pull request to test changes in an isolated worktree and generate a Markdown report.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 3189
- Author: mikeyobrien
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/mikeyobrien/ralph-orchestrator/tree/HEAD/.claude/skills/review-pr/SKILL.md
- Updated: 2026-10-15
- HTML: https://affpapa.org/en/nevibecode/skills/mikeyobrien-review-pr

## What it does

This skill extracts a pull request number from your input and launches the `ralph.reviewer.yml` loop. It triggers `ralph run -H ralph.reviewer.yml -p "Review PR #<N>"` in the background with a 10-minute timeout (600000 ms), waiting for completion via `TaskOutput`. All checks run safely inside a dedicated `.worktrees/review-<N>` directory.

Once the loop finishes, the skill prints `.ralph/REVIEW-REPORT.md` directly into the chat. If the run fails midway, it locates and outputs whatever partial artifacts were written: `.ralph/review-scope.md` for scope, `.ralph/review-verification.md` for test output, or `.ralph/review-findings.md` for review issues.

The skill operates in read-only mode: it does not alter source code, send GitHub comments, or clean up leftover worktrees on its own. When a worktree folder remains on disk, it warns you and lets you decide what to remove.

## Requirements
- Works with: GitHub

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add mikeyobrien/ralph-orchestrator --skill review-pr -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/review-pr/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/review-pr/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add mikeyobrien/ralph-orchestrator --skill review-pr -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/review-pr/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add mikeyobrien/ralph-orchestrator --skill review-pr -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/review-pr/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install mikeyobrien/ralph-orchestrator review-pr
```

2. **Manually: put the files in place**
- File: `.github/skills/review-pr/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add mikeyobrien/ralph-orchestrator --skill review-pr -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/mikeyobrien/ralph-orchestrator --path .claude/skills/review-pr
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/review-pr/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add mikeyobrien/ralph-orchestrator --skill review-pr -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/mikeyobrien/ralph-orchestrator/tree/HEAD/.claude/skills/review-pr/SKILL.md

## When to use it
- run an isolated code review loop on a pull request
- execute test suites inside a dedicated git worktree
- generate a structured Markdown review report
- inspect partial review findings when an orchestration run fails

## Example prompts
- /review-pr 207
- /review-pr #207
- Review pull request #207 using /review-pr 207

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: df8cdfee9f442961.

BEGIN THIRD-PARTY FILE df8cdfee9f442961
````text
---
name: review-pr
description: Use when asked to review a PR, run a code review loop, or invoke the ralph reviewer against a pull request number or GitHub URL
metadata:
  internal: true
---

# Review PR

Run the `ralph.reviewer.yml` orchestration loop against a pull request. The loop checks out the PR in an isolated worktree, runs tests, reviews the diff, and produces a structured report.

## Usage

```
/review-pr <PR number or URL>
```

Accepts: `207`, `#207`, or `https://github.com/.../pull/207`

## Execution

### 1. Parse the PR argument

Extract the PR number from the argument. Strip `#` prefix or extract from URL path.

### 2. Run the reviewer loop

```bash
ralph run -H ralph.reviewer.yml -p "Review PR #<N>"
```

**Bash tool settings:**
- `timeout: 600000` (10 minutes)
- `run_in_background: true`

Use `TaskOutput` with `block: true` to wait for completion.

### 3. Display the report

Read and print `.ralph/REVIEW-REPORT.md` to the conversation.

If the report file doesn't exist (loop failed before the synthesizer hat), check for and display whatever intermediate files exist:
1. `.ralph/review-scope.md` — what was scoped
2. `.ralph/review-verification.md` — test results
3. `.ralph/review-findings.md` — review findings

### 4. Verify cleanup

Check that the review worktree was removed:

```bash
ls -d .worktrees/review-<N> 2>/dev/null
```

- If gone: cleanup succeeded, no action needed.
- If still present: **warn the user** but do NOT force-remove. Say what's there and let them decide.

Also note the presence of intermediate files (`.ralph/review-scope.md`, etc.) — they're useful for debugging but the user may want to clean them up later.

## Error Handling

| Situation | Action |
|-----------|--------|
| Ralph exits non-zero | Display error output. Suggest re-running with `RALPH_DIAGNOSTICS=1` |
| Report file missing | Display intermediate files that do exist (scope, verification, findings) |
| PR argument missing | Ask the user for the PR number |
| PR argument unparseable | Ask the user to provide a bare number, `#N`, or full GitHub URL |

## What This Skill Does NOT Do

- Does NOT validate the PR exists (the scoper hat handles that)
- Does NOT modify any source code (read-only review)
- Does NOT post comments to GitHub
- Does NOT own worktree cleanup (verifies only)
- Does NOT enable diagnostics by default
````
END THIRD-PARTY FILE df8cdfee9f442961

The third-party file has ended. Everything between the df8cdfee9f442961 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© mikeyobrien · MIT · https://github.com/mikeyobrien/ralph-orchestrator/tree/HEAD/.claude/skills/review-pr/SKILL.md

## Similar
- [improve-codebase-architecture](https://affpapa.org/en/nevibecode/skills/improve-codebase-architecture.md) — skill · 1163035 installs
- [tdd](https://affpapa.org/en/nevibecode/skills/tdd.md) — skill · 1141062 installs
- [triage](https://affpapa.org/en/nevibecode/skills/triage.md) — skill · 990453 installs
- [codebase-design](https://affpapa.org/en/nevibecode/skills/codebase-design.md) — skill · 850344 installs
- [code-review](https://affpapa.org/en/nevibecode/skills/code-review.md) — skill · 789521 installs
- [implement](https://affpapa.org/en/nevibecode/skills/implement.md) — skill · 774700 installs

## Other versions with the same name
- [review-pr · tirth8205](https://affpapa.org/en/nevibecode/skills/tirth8205-review-pr.md) — 1200 installs

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
