/wp-pr-review:wp-pr-reviewfrom wp-pr-review
Reviews WordPress pull requests against target branch, task requirements, project rules, and wp-mnemon maps. Runs local QA, re-checks findings with an independent verifier, and produces a review doc with per-line comments and suggestion blocks. Requires wp-mnemon.
Ships in wp-pr-review. 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.
Read when SKILL.md points to them.
Reviews one pull request the way a senior engineer who knows the project would: against what the change was meant to do and against how the touched code actually works. Every finding is validated against that context, then re-checked by a fresh verifier before it reaches the review doc. The deliverable is a review doc the user edits and posts.
Requires
wp-mnemon. Touched plugins and themes are mapped with wp-mnemon before the review. Prefer thewp-mnemonsubagent (fromwp-agents) when its agent type is available: its docs persist in agent memory and are reused across reviews. Otherwise read wp-mnemon'sSKILL.mdand run itsscripts/directly, without invoking it as a skill. Locate it by layout: afterinstall.sh,../wp-mnemon/from this skill's folder; in a repo checkout,../../../wp-mnemon/skills/wp-mnemon/; after a marketplace install, find the installedwp-mnemonskill folder (do not guess a cache path).
Reference files, read when the step says so:
references/review-rules.md: evidence standard, claim validation, checklist, severity, verdict, comment style, suggestions, anchoringreferences/review-doc.md: the review doc formatreferences/verifier.md: the brief for the verification subagentreferences/qa.md: running QA steps on a local sitereferences/posting.md: posting to GitHub and GitLabreferences/qa.md). The PR is read from separate worktrees (Step 3).~/, never a path relative to the repository or the doc folder. Paths inside the review doc and PR comments stay repo-relative.A skill that wraps this one (for example to add a tracker's context and a tracker comment) reads this file and follows it with a task context block it has already gathered. The block uses these headings, each filled or marked "Not available":
## Summary
## Acceptance criteria (numbered, verbatim, each with its source)
## Implementation plan
## QA steps (numbered, verbatim, each with its source and the environment it assumes)
## Decisions in the thread (dated; later decisions override earlier criteria)
## Related history (per component: dated decisions with their source)
## Open questions
The caller may also set:
| Setting | Effect |
|---|---|
checkout | The local checkout to use in Step 3 |
doc_path | Where Step 6 writes the doc; the caller owns its location rules |
extra_criteria | Items reviewed and reported as listed-not-judged (for example a definition of done) |
qa_steps | The QA steps for Step 7, chosen by the caller from its own sources in its own order |
With a task context block, skip the ticket fetch in Step 2 and the tracker search in Step 5 and use the block. Everything else runs as written. When the run ends, return to the caller: the verdict, comment counts by severity, previous findings by status (on a later round), the reviewed head sha, acceptance criteria met of total, QA steps passed of run, the doc path, the QA screenshot folder (when QA ran), and whether the review was posted.
Parse the request in any order:
owner/repo#n, or a number (resolved against the current repository's origin).ACME-101, or id), a spec URL, a PRD or plan path.The PR URL decides the host; otherwise git remote get-url origin does. GitHub uses gh; GitLab uses glab (--repo with the full host path for a self-hosted instance). Check gh auth status or glab auth status; when not authenticated, tell the user to run ! gh auth login (or ! glab auth login --hostname <host>) and stop. No PR given: ask for it and stop until the user answers.
PR. GitHub:
gh pr view <n> --repo <owner/repo> --json number,title,url,body,author,baseRefName,headRefName,headRefOid,baseRefOid,state,isDraft,changedFiles,files,commits,statusCheckRollup
gh api graphql -f query='query($o:String!,$r:String!,$n:Int!){repository(owner:$o,name:$r){pullRequest(number:$n){reviewThreads(first:100){nodes{id isResolved isOutdated path line originalLine comments(first:1){nodes{databaseId body author{login}}}}}}}}' -F o=<owner> -F r=<repo> -F n=<n>
gh api user --jq .login
Keep every thread. A thread whose first comment's author is the user's login is own; the rest are others'.
GitLab (<project> is the URL-encoded group/project path, never the :id placeholder):
glab mr view <n> --repo <group/project> --output json
glab api projects/<project>/merge_requests/<n>/discussions --paginate
glab api projects/<project>/merge_requests/<n>/pipelines
glab api user --jq .username
The discussions' resolved field marks resolved threads; a discussion whose first note's author is the user's username is own.
From the GitLab JSON, diff_refs.head_sha, diff_refs.base_sha, and diff_refs.start_sha stand in for the head and base shas, and target_branch for the base branch.
Note: QA and Acceptance Criteria sections in the PR body (Step 7 uses them), unresolved threads by others (a point already raised is not repeated), own threads (Step 5 tracks them as previous findings), failing or pending checks by name, whether the PR references the ticket (a PR that names a different ticket is a finding), and generated or vendored files. For a closed or merged PR, say so and ask whether to continue.
Task. Find the ticket: the one the user named, else a ticket reference in the PR body or branch name, confirmed with the user before use. Read it with whatever reaches that tool:
| Ticket | Read with |
|---|---|
| GitHub issue | gh issue view <n> --json title,body,comments |
| GitLab issue | glab issue view <n> --repo <group/project> --comments |
| Jira | a connected Atlassian MCP tool, else acli jira workitem view <KEY> --fields summary,description,comment --json |
| Any other tracker | that tracker's connected MCP tools or CLI |
| Spec or doc | the connected tool for where it lives |
| Nothing readable | ask the user to paste the title, acceptance criteria, QA steps, and plan |
Read the ticket's comments oldest first. Build the task context block from "Called by another skill": acceptance criteria and QA steps verbatim, the intended approach, dated thread decisions. No acceptance criteria anywhere: say so and review against the ticket summary and PR body; the doc flags the gap.
Use the caller's checkout, else the current repository when its origin matches the PR repository, else ask for the local checkout path. Never clone without asking.
Shell variables do not persist between Bash calls. Resolve the worktree path once (for example echo "${TMPDIR:-/tmp}/wp-pr-review-<n>") and write that literal path into every later command (Step 10 and the payload paths in references/posting.md). The blocks below keep the $WT notation.
When $WT/head or $WT/base is left over from an earlier run, remove it first with git -C <checkout> worktree remove --force.
WT="${TMPDIR:-/tmp}/wp-pr-review-<n>"
git -C <checkout> fetch origin pull/<n>/head:refs/remotes/origin/pr/<n> <baseRefName>
# GitLab: git -C <checkout> fetch origin merge-requests/<n>/head:refs/remotes/origin/pr/<n> <baseRefName>
git -C <checkout> worktree add --detach "$WT/head" refs/remotes/origin/pr/<n>
git -C <checkout> worktree add --detach "$WT/base" <baseRefOid>
git -C "$WT/head" rev-parse HEAD # must equal the head sha
When rev-parse HEAD does not equal the head sha, stop and report.
In the head worktree, read CLAUDE.md, AGENTS.md, CONTRIBUTING.md, lint configs (phpcs.xml*, phpstan.neon*, .eslintrc*, eslint.config.*, .stylelintrc*), and planning docs that mention the ticket, branch, or changed paths (for example requirements/**/*.prd.md, docs/plans/, ADRs). Their rules are review criteria.
Group changed files by component: a directory with a PHP file holding Plugin Name:, a mu-plugin file, or a theme with style.css holding Theme Name:. Everything else (build config, CI, Composer, root files) is reviewed directly in Step 5.
Map a component when the PR edits code inside it. Skip a component the PR only adds, deletes, or re-versions wholesale (for example a vendored third-party plugin moving to Composer); Step 5 checks its presence and versions. More than six components to map: ask which ones.
For each component, map the base worktree so the docs describe the code before the change:
agent-memory/wp-mnemon/MEMORY.md (one row per slug and version) and the docs are agent-memory/wp-mnemon/plugins/<slug>/<version>/ (overview.md, architecture.md, hooks.md, data.md, extending.md), both under the Claude config dir. Check $CLAUDE_CONFIG_DIR (when set) and ~/.claude, since wp-mnemon writes under the config dir it runs in. Docs still in the older unversioned layout (plugins/<slug>/*.md) are moved into version folders by wp-mnemon on its next run, so launch the subagent for them. A plugin or theme uses its directory name as <slug>; a single-file mu-plugin uses its filename without .php. Themes and mu-plugins are stored and reused under the same plugins/<slug>/<version>/ path. <version> is the Version header of the component at the base, verbatim, or unversioned when the header has none. When plugins/<slug>/<version>/overview.md exists, read those docs and launch nothing for that component. Docs from another version of the same component are not reused for the review; when the PR changes the component's version, they may be read to compare behavior across versions.SKILL.md, runs its scripts/scan_classes.sh, scan_hooks.sh, and scan_data.sh on the component, and runs its phases 1 to 10 scoped to the changed files, their callers, and their callees. It skips phases 11 and 12 (no memory files, no confirmation) and returns the map in its final message.wp-mnemon targets plugins; for a theme, apply the same phases with style.css and functions.php as the entry points. Record which mode each component used.
From the maps and the code, write down for Step 5:
grep -rn across the whole head worktree, not just the component.Read references/review-rules.md. Then:
<last> and the doc's Inline comments plus the own threads as the previous findings.
git -C "$WT/head" cat-file -e <last>^{commit} and git -C "$WT/head" merge-base --is-ancestor <last> HEAD both pass, read git -C "$WT/head" log --oneline <last>..HEAD and git -C "$WT/head" diff <last>..HEAD before the full pass, so the new changes get first attention. Otherwise (force-push or rebase), note "history rewritten since <last>" and run the full pass only.git log <last>..HEAD -- <path>), Still open (the defect is still there, whether or not its thread is resolved), or Outdated (the code it pointed at was removed or rewritten so the comment no longer applies). Each status goes through Claim Validation like a new finding.review-doc.md). One with no thread (the earlier round was not posted) stays in Inline comments.git -C "$WT/head" log --all --oneline -- <path>, and search the ticket's tracker for decisions about it (search by component name and slug, including closed items). Note decisions with their source. For every hunk the PR edits or removes, run git -C "$WT/base" log -L <start>,<end>:<path> --format='%h %ad %s' --date=short -n 5 on the base line range (or git -C "$WT/base" blame -L <start>,<end> <path> for a quick view) and read the commits that introduced the old code. Use them to learn why the old code was written that way before a comment calls the change or the old code wrong. Note commits that state intent (for example a fix the PR undoes).review-rules.md, plus each extra_criteria item as listed, not judged. Run installed linters and tests on changed files; record the command and result.Write the doc in the references/review-doc.md format at the caller's doc_path, else <out>/<host>-<repo>-pr-<n>-review.md for GitHub and <out>/<host>-<repo>-mr-<n>-review.md for GitLab, where <host> is github or gitlab. <out> is the output folder: the folder the user named, else the WP_PR_REVIEW_DIR environment variable, else ask the user once in this run, suggesting a folder outside the repository. A relative <out> resolves against the main checkout root, dirname "$(git -C <checkout> rev-parse --path-format=absolute --git-common-dir)", so the doc outlives a linked worktree. Before writing inside the repository, run git -C <main checkout root> check-ignore -q <out>/x; when the folder is not ignored, ask for another folder or for permission to leave an untracked file there.
When the doc already exists, ask with AskUserQuestion: Update the existing review doc (re-review, rewrite Summary comment, Inline comments, Thread replies, and Previous findings from Step 5, keep History and add a line) or Write a new doc (append -<YYYY-MM-DD> before .md; Step 5 still reads the earlier doc as the previous round). Either way, read the earlier doc before writing so its previous findings are not lost.
Always ask with AskUserQuestion: "Run local QA for PR #?" (options Yes, No). On No, the doc's QA section says "Skipped by the user".
On Yes, take the QA steps from the first source that has them:
qa_steps, else the PR body's QA section (a heading such as QA or QA steps), else its Acceptance Criteria section.Acceptance Criteria section.When a source has them, follow those steps as written. When none does, ask the user in one message for the QA details: the steps to run, the local site URL, the user role to log in as, and any test data or setup. Stop until they answer, then use their steps.
Run them with references/qa.md and record the results in the doc's QA section. A failed QA step that shows a defect is added to the doc's Inline comments with its Evidence line and run through the Claim Validation table.
Launch one fresh general-purpose subagent with the brief in references/verifier.md, filled in with the PR metadata, both worktree paths, the task context block, the component maps, the doc path, and the absolute path of references/review-rules.md. It re-derives every claim from source, confirms, corrects, or drops each comment (including comments added in Step 7), and recomputes the verdict. It edits only the doc.
When it dropped or corrected a comment you believe is right, re-check that comment yourself against the code before restoring it; never restore it on your own say-so.
Show the verdict, the comment headings with severities, the previous findings by status (on a later round), the thread replies, the dropped count, QA results, and the doc path. Then ask:
"Post this review on PR #?" with the events the verdict allows, plus Don't post: Changes requested offers Post as Request changes and Post as Comment; Passed with comments offers Post as Comment and Post as Approve; Passed offers Post as Approve and Post as Comment. On the user's own PR offer only Comment. Tell the user they can edit the doc first.
On a post answer, re-read the doc (it may have changed) and follow references/posting.md.
git -C <checkout> worktree remove --force "$WT/head"
git -C <checkout> worktree remove --force "$WT/base"
Reply with the verdict, Blocker and Major comments with path:line, previous findings by status (on a later round), acceptance criteria not met, QA steps that failed or could not run, and whether the review was posted. End the reply with these lines, each holding one complete path:
Review doc: <absolute doc path>
QA screenshots: <absolute screenshot folder>
Include the QA screenshots line only when QA ran. When called by another skill, return the result listed under "Called by another skill" instead.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub s3rgiosan/wp-skills --plugin wp-pr-review