/annai:review-prfrom annai
Generate a guided code-review surface for a GitHub pull request and open it in the browser. Produces an ordered, annotated JSON view of the diff (base context first, then entry points, then supporting code) with typed side notes, inline PR suggestions, and mermaid diagrams; then launches a local server that renders it, and on submit pushes the review to GitHub via three GraphQL mutations. Trigger phrasings: "review this PR", "prep PR #N for review", "help me review <github-url>", or an explicit `/annai:review-pr` invocation.
Ships in annai. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Entry point for reviewing a GitHub pull request. The mode-specific steps are inlined below; for everything else (surface authoring rules, launch, watch, react, cleanup) load the annai:review skill — it owns the shared procedure. When the shared procedure says "this step is mode-specific", come back here.
gh pr view <id> --json number,title,url,headRefName,baseRefName,additions,deletions,changedFiles to confirm PR metadata exists and you can read it. The scaffold step re-runs this for you; you don't need to plumb the JSON through by hand.gh pr diff <id> if you want to skim before scaffolding; otherwise let surface scaffold fetch it."${CLAUDE_PLUGIN_ROOT}/skills/review/scripts/annai.sh" surface scaffold \
--pr <n> --repo <path-or-slug> --out <session-dir>/surface.json
--repo accepts either a GitHub OWNER/REPO slug or a local clone path (the slug is resolved via gh repo view inside that directory). The local path goes into surface.repo.path so the daemon can find the working tree.
Fetches PR metadata via gh pr view, parses every file's hunks from gh pr diff, and writes a schema-valid skeleton with subject: { kind: 'pr', ... }, one unsorted supporting group containing every changed file, and empty tldr / reviewPrompts / diagrams / per-diff annotations / suggestions. Each diff gets a stable id like diff-src-foo-ts you'll reference in later commands.
When you tell the user the surface URL, end with:
Draft comments inline / per-file / at the PR level, then hit Approve or Comment when you're ready, or Dismiss session if you want to bail. I'll push the review to GitHub once you submit.
On review-submitted:
"${CLAUDE_PLUGIN_ROOT}/skills/review/scripts/annai.sh" submit \
--session "<session-id>"
submit fetches the result via IPC, queries the PR's node id + head commit OID via gh api graphql, runs addPullRequestReview (line + range threads + PR body), runs addPullRequestReviewThread once per file-level draft (subjectType: FILE), then submitPullRequestReview with the matching event. Output is a single JSON line:
{"sessionId":"…","reviewUrl":"https://github.com/…/pull/…#pullrequestreview-…","state":"APPROVED","decision":"approve","commentCount":4}
Report the URL to the user.
What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/reviewNEVER INVOKE THIS SKILL DIRECTLY; USE `/annai:review-pr` to review a GitHub pull request, or `/annai:review-local` to review code an agent just produced locally. This file is the shared base that the two leaf skills load — it owns the surface-authoring rules, launch + watch + react loop, schema-validation contract, and cleanup. It is not a standalone entry point./review-localGenerate a guided code-review surface for code an LLM agent (or the user) just produced locally — no GitHub PR. Produces an ordered, annotated JSON view of the local diff (git working tree or branch vs base) with typed side notes, inline suggestions, and mermaid diagrams; then launches a local server that renders it, and on finish saves the reviewer's feedback as result.json for the agent to read back. There is no Approve action in this mode — the only positive terminus is **Finish review**, which persists the reviewer's drafts as `result.json`. Trigger phrasings: "review what I just changed", "review this branch", "review the agent's draft", or an explicit `/annai:review-local` invocation.Other plugins' skills for the same job
annai@asermax-plugins is listed by asermax/claude-plugins — review the source before installing
npx claudepluginhub asermax/claude-plugins --plugin annai