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
458 skills8 commands
> /plugin marketplace add TOMOSIA-VIETNAM/open-pr
> /plugin install open-pr@open-pr

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` and `core/cli.md` FIRST — shared > rules + the `<op>` runtime, not repeated here. `<op>` ≡ `sh "${CLAUDE_PLUGIN_ROOT}"/bin/open-pr.sh`, > exactly as THIS line spells it — no env var exists in the shell. Every bare `dir/file.md` a Step > `Read`s lives under that same plugin directory. 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. > - 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

`<op> target <url>` → `vendor/owner/repo/pull_number/host`; exit 4 or no URL → print:

❌ 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

`Read` `core/pr-target.md` — vendor reconciliation, `<repo>`, free-form-text rule, empty-"PR info" stop. A language instruction in `ARGUMENTS`/chat overrides `.shared.output_language`, this run only.

`--status-file` in `ARGUMENTS` ⇒ `Read` `cases/watch-session.md` before Context.

**≥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, 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, its bullets and star question once at the end; nothing further posted.

Context

`<op> data-dir` → `<data>`, then `<op> settings --repo <repo> --star` → this run's resolved config (`core/repo-settings.md` names what each field means). `<vendor>` MUST be reconciled (`core/pr-target.md` §2) BEFORE the next call. Then ONE call fetches everything — `<op> context` with `--max-patch-bytes` = `big_file_threshold_kb` × 1024; its `## <label>` sections are what later Steps name. Any path "Diff size per file" lists that "Diff" lacks is an omitted file → carry to Step 7 as **"Oversized paths"**. "CI checks" stays unfiltered — Step 7 and bootstrap's `review_ci_status` question read the raw list.

**Filesystem:** `<op> locate-repo` → `<repo_dir>`; exit 5 → ask with a CHOICE in plain language — name the N directories found and why each might be it — STOP if unresolved. FORBIDDEN: `cd`. Everything this command writes — `<data>/<repo>/`, the worktree — lives under `<data>`, never in the reviewed repo. Before writing under `<data>` → state `<data>` + `<repo>` in chat.

Step 1 — Ephemeral worktree

`<op> checkout` with `--head-sha` = "Head SHA", `--base` = `baseRefName`, `--repo-dir <repo_dir>` → `worktree=<path>`; PR code on disk, main tree untouched, gated to the commit the "Diff" was read at. `Read`/`Grep` at `<worktree>/<path>`. Exit 2 ⇒ STOP, print both SHAs + `<worktree>` and that `/open-pr:clean` removes it. Exit 3 ⇒ STOP with its stderr. FORBIDDEN: retrying past the script's own retry, or comparing against a freshly fetched SHA — that hides the stale diff.

Then try `Read`ing `<worktree>/.gitmodules` — every run, never cached. Exists && "Diff" carries `Subproject commit` → `Read` `cases/submodule-review.md`.

Step 2 — Detect stack

`<op> stacks --repo-dir <repo_dir> <every "Files" path>` → keep the `(file, stacks)` mapping for Steps 4-7; judge `.md` lines per `core/cli.md`.

Step 3 — Setup / doctor

From the Context `settings` call: resolve `chat_language` per `core/repo-settings.md`; `doctor_due` is already computed. `<vendor>` is already reconciled, never re-asked. Persisting it:

  • about to bootstrap → the `git_remote_type` question's pre-marked default, `setup/bootstrap.md`

writes it

  • bootstrapped, field predates this schema → read-time value only. FORBIDDEN: writing it back

(`/open-pr:upgrade` owns that backfill); a confirmed mismatch was already persisted at §2

Branch:

  • `memory_found: false` → `Read` `cases/memory-not-found.md` FIRST — it may import or STOP
  • no file || no `.review` || `.review.bootstrapped` != `true` → `Read`

`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 `<data>` 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` `setup/template.md`, follow it. Present → use `<data>/<repo>/templates/<stack>.md`. Runs every time: a new stack can appear post-bootstrap.

Step 5 — Load the criteria

`Read` `core/review-criteria.md`; load every layer it names for Step 2's stacks.

Step 6 — Re-review

"Old comments" non-empty → `Read` `cases/re-review.md`; it also gates whether Step 8/9 post at all. Empty (brand-new PR) → skip to Step 7.

Step 7 — Review

**Large-diff guard, before anything else here:** count("Files") > `many_files_threshold` || "Oversized paths" (Context) non-empty || any "Diff size per file" entry > `big_file_threshold_kb` KB or `UNKNOWN` → `Read` `cases/large-diff-guards.md`, follow it (it may STOP the command). Neither → proceed.

**Overview items** — never counted toward N, never entered into `comments[]`:

  • title/body vague on business context → note it atop the Step 8 overview, suggest the dev add detail.

FORBIDDEN: writing it for them.

  • `headRefName` ca
Read more
@tomosia-vietnam
Ships withopen-pr

AI code review that lands on the PR, not in your terminal — GitHub, GitLab, Bitbucket. Learns each repo's conventions: 1 review, 1 fix commit, replies in thread. Claude Code · Cursor · Codex · Gemini CLI · Antigravity.

Stars on GitHub

Momentum

stars in total
45
Star history of TOMOSIA-VIETNAM/open-pr on GitHub, a chart by star-history.com

Other commands on open-pr.

release-now

release-now

Command

Create a git tag + GitHub Release for open-pr — an official release if standing on main, an RC if standing on a branch with an…

clean

clean

Command

Remove the git worktrees review checked PR code out into. Each one is a full checkout on disk; nothing else is touched.

feedback

feedback

Command

Report a problem with the open-pr plugin itself, or ask for a change, on its public issue tracker. Reads no PR; writes nothing in…

fix

fix

Command

Act on the findings a review left on a PR — takes or declines each by severity, edits code at pwd to match the project, 1 commit,…

menubar

menubar

Command

Open or close the macOS menu bar item — reviews and fixes in progress, "Fix now", recent toasts and snooze for every watcher on…

upgrade

upgrade

Command

Bring every per-repo config in the data directory up to the schema this build expects. Takes no PR.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command