Skip to content
Development
Command

/review

Review PRs against the conventions learned from each repo — 1 post per PR, findings tagged by severity, code left untouched.

From plugin
open-pr
195 skills5 commands
Install
$ npx -y skills add TOMOSIA-VIETNAM/open-pr --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/review

Context preview

What this command does when you run it.

Review PRs against the conventions learned from each repo — 1 post per PR, findings tagged by severity, code left untouched.

Command definition

review.md
argument-hint: <PR URL> [other PR URL...] [content]
description: Review PRs against the conventions learned from each repo — 1 post per PR, findings tagged by severity, code left untouched.

> **CRITICAL:** `Read` `"${CLAUDE_PLUGIN_ROOT}"/core/guardrails.md` FIRST — shared rules, not repeated > here. On top of those: > - Read-only on the reviewed repo; the only write is Step 9's 1 review (+ 1 more on a submodule PR > when Step 1 detects a bump). FORBIDDEN: close/merge/reopen, create/delete/switch a branch, push, > edit code → mention it in the review instead. > - `git worktree add` confined to `notebooks/review/*/worktrees/*`. > - `Read`/`Grep` in the worktree may surface the REVIEWED repo's own `.claude/skills/` — its dev > workflow, not a review tool. FORBIDDEN: invoking it, even when listed as available.

Step 0 — Target

`Read` `"${CLAUDE_PLUGIN_ROOT}"/core/pr-target.md`; it names what every later Step reuses. `Usage:` block for this command:

❌ Error: No PR URL provided.
Usage: /open-pr:review <PR URL>
Example (GitHub): /open-pr:review https://github.com/org/repo/pull/123
Example (GitLab): /open-pr:review https://gitlab.com/org/repo/-/merge_requests/123

A language instruction in `ARGUMENTS`/chat overrides `.shared.output_language`, this run only.

**≥2 valid PR URLs** && the intent isn't already clear from `ARGUMENTS`/chat → ask "Found N PRs — review all N or just the first?", WAIT (extras may be reference-only). Confirmed multi-PR → run Step 0 → Step 9 to COMPLETION per URL, in order, SEQUENTIALLY, each with its own worktree/memory/post. FORBIDDEN: parallel, subagent. `[content]` applies to every PR. All done → 1 chat summary, 1 line per PR, shaped by Step 9's reporting rule; nothing further posted.

Context

`<git_remote_type>` MUST be resolved (`core/pr-target.md` §2) BEFORE the first fetch, which needs `.shared.git_remote_type` → try `Read`ing `notebooks/review/<repo>/settings.json` now (Step 3 re-`Read`s it for the rest of its content).

Then fetch:

| `V§` entry | label | |---|---| | "Fetch PR basic info", fields `number,title,body,author,baseRefName,headRefName` | PR info | | "Fetch PR diff — file list" | Files | | "Fetch PR diff size per file" | Diff size per file | | "Fetch PR diff — patch, omitting oversized files", `<max_patch_bytes>` = `big_file_threshold_kb` × 1024 | Diff | | "Fetch PR commits headlines" | Commits | | "Fetch PR review comments (LINE-level findings)" | Old comments | | "Fetch CI checks" | CI checks |

Fetch the size list BEFORE the patch, in that order. Any path it names that "Diff" then lacks is an omitted file → carry that list to Step 7 as **"Oversized paths"**. A whole patch that reaches the terminal stays in context for the rest of the run, so the omission MUST happen inside the vendor's own call; Step 7's guard fires far too late to help.

`big_file_threshold_kb` (`core/repo-settings.md`) — this Context already reads `settings.json` for `<git_remote_type>`, so take it from that same read.

"CI checks" MUST stay unfiltered — Step 7 and `setup/bootstrap.md` q6 each read the raw array.

**Filesystem:** `Read` `"${CLAUDE_PLUGIN_ROOT}"/core/locate-repo.md` BEFORE Step 1 for `<repo_dir>`. FORBIDDEN: `cd`. Everything this command writes — `notebooks/review/<repo>/`, the worktree, `.gitignore` — is relative to pwd, so one workspace holds one `notebooks/review/` for every repo reviewed from it. `<repo_dir>` ONLY aims git: `git -C "<repo_dir>" …`. Before writing under `notebooks/review/` → state pwd + `<repo>` in chat.

`core/pr-target.md` §5 gates entry into Step 1.

Step 1 — Ephemeral worktree

PR code on disk, main tree untouched — no branch change, nothing to restore.

1. `git -C "<repo_dir>" worktree add "$PWD/notebooks/review/<repo>/worktrees/pr<pull_number>-$RANDOM" --detach` — random name, never reused; the ABSOLUTE path is what lets pwd be no repo at all. Then `V§"Check out the PR head into a worktree"`, DETACHED, in a subshell pinned to the worktree so the working directory never moves. `Read`/`Grep` at `<worktree>/<path>`. 2. `git -C "<repo_dir>" fetch origin "<baseRefName>"` — refs are shared across that repo's worktrees. 3. Try `Read`ing `<worktree>/.gitmodules` — checked directly every run, never cached, so a not-yet-doctored repo still detects a bump on its first PR. Exists && "Diff" contains `Subproject commit` → `Read` `"${CLAUDE_PLUGIN_ROOT}"/cases/submodule-review.md`. Else skip. FORBIDDEN: `submodule update` here — each is a full checkout, and that file inits bumped paths only.

Step 2 — Detect stack

`Read` `"${CLAUDE_PLUGIN_ROOT}"/core/stack-detection.md`; keep the `(file, [stacks])` mapping for Steps 4-7.

Step 3 — Setup / doctor

`Read` `"${CLAUDE_PLUGIN_ROOT}"/core/repo-settings.md`, then `Read` `notebooks/review/<repo>/settings.json` in full (Context read it only to resolve `<git_remote_type>`). Resolve `chat_language` and `doctor_due` per that file.

`<git_remote_type>` is already resolved, never re-asked. Persisting it:

  • about to bootstrap → q1's pre-marked default, `setup/bootstrap.md` writes it
  • bootstrapped, field predates this schema → read-time fallback only. FORBIDDEN: writing it back

(`/open-pr:upgrade` owns that backfill)

  • `core/pr-target.md` §2's mismatch confirmed a DIFFERENT value → `Edit` `.shared.git_remote_type` here

Branch:

  • no file || no `.review` || `.review.bootstrapped` != `true` → `Read`

`"${CLAUDE_PLUGIN_ROOT}"/setup/bootstrap.md`, then `setup/doctor.md`

  • `bootstrapped: true` && `doctor_due` → `setup/doctor.md` only, FORBIDDEN: re-asking bootstrap
  • `bootstrapped: true`, `doctor_due` false → skip both

Setup stable ⇒ don't touch `notebooks/review/` outside Step 4 (new template), Step 6 (lesson), or a due doctor.

Step 4 — Local template per stack

Each Step 2 stack absent from `.review.templates_copied` → `Read` `"${CLAUDE_PLUGIN_ROOT}"/setup/template.md`, follow it. Present → use `notebooks/review/<repo>/templates/<stack>.md`. Runs every t

Read more
Ships withopen-pr

One AI reviewer for GitHub PRs and GitLab MRs. Learns each repo's conventions. Claude Code · Cursor · Codex · Gemini CLI · Antigravity.

Get the whole plugin, auto-invoked
Stats
19
Stars
0
Views
9
Forks
Active
Maintenance
Python
Language
MIT
License
1d ago
Last commit
25d ago
Created

Repo: TOMOSIA-VIETNAM/open-pr