review-pr

review-pr is a command for Claude Code from edutrul/drupal-ai. It costs 58 tokens per session (2,305 once invoked), scanned B, original, MIT.

A command for reviewing a GitHub pull request from local preparation through code analysis and optional updates. A pull request is a proposed change that others review before it is merged.

In plain words
What is it for?
Use it to check GitHub access, fetch and inspect a branch, review Drupal code locally with DDEV, write a review summary, and optionally comment on GitHub or update Jira.
Why use it?
It gathers the branch, changed files, project rules, local test environment, and related Jira ticket so the review follows the project’s process.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/edutrul/drupal-ai/review-pr
Clone the repo
git clone --depth 1 https://github.com/edutrul/drupal-ai

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for review-pr

README.md
[![agentmods](https://agentmods.dev/badge/commands/edutrul/drupal-ai/review-pr.svg)](https://agentmods.dev/commands/edutrul/drupal-ai/review-pr)
Your own site
<a href="https://agentmods.dev/commands/edutrul/drupal-ai/review-pr"><img src="https://agentmods.dev/badge/commands/edutrul/drupal-ai/review-pr.svg" alt="Measured on agentmods" height="20"></a>
Per session 58 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,305 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00058 $0.02305
Opus 5 $0.00029 $0.01153
Sonnet 5 $0.00012 $0.00461
Haiku 4.5 $0.00006 $0.00231

Measured 5d ago against content hash 425294578fc0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

review-pr scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

allowed-tools: Bash(gh auth status:), Bash(gh auth switch:), Bash(gh pr view:), Bash(gh pr diff:), Bash(gh pr comment:), Bash(gh pr review:), Bash(git fetch:), Bash(git checkout:), Bash(git pull:), Bash(git stash:), Bash
.claude/commands/review-pr.md · 424 lines

How it starts

The opening of the file, as written. The whole thing — 424 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Review PR

Prepare a GitHub Pull Request locally, analyze it using project rules, optionally post a GitHub review comment, and optionally synchronize the related Jira ticket.

Purpose

Use this command when the user provides a PR URL or number and wants to:

  • prepare PR locally
  • review code using project standards
  • generate a review summary
  • optionally post a GitHub comment
  • optionally update Jira based on review outcome

Input

  • GitHub PR URL or number
    If missing → ask for it.

Assumptions

  • Inside correct repo
  • Uses GitHub (gh)
  • Uses DDEV + Drupal
  • Uses Jira via acli
  • Mappings at .claude/data/mappings.json

Workflow

1. Validate GitHub access

Run:

gh auth status

If fails:

gh auth switch --user <account>

2. Resolve PR details

Run:

gh pr view <number-or-url> --json headRefName,title,files,author,body

Show:

  • title
  • branch
  • changed files

3. Detect Jira ticket

Search in:

  • PR title
  • body
  • branch

Example: PRJ-703

If none found:

  • continue without Jira

4. Ensure DDEV running

Run:

ddev describe || ddev start

5. Checkout branch

Run:

git fetch origin
git checkout -b <branch_name> origin/<branch_name>

If exists:

git checkout <branch_name>
git pull origin <branch_name>

If blocked → ask to stash.


6. Prepare environment

Run:

composer install
drush cim -y
drush updb -y
drush cr

Stop on failure.


7. Generate login link

Run:

ULI=$(drush uli) && echo "$ULI" && open "$ULI"

8. Run PHPCS on changed files

From the changed files list gathered in step 2, filter to PHP files that fall within PHPCS scope:

  • docroot/modules/custom/
  • docroot/themes/custom/
  • docroot/sites/default/settings.php

For each matching file, run:

phpcs <file-path>

Collect all output. If no PHP files are in scope, skip this step silently.

Store the raw PHPCS output — it will be used directly in the Analysis Phase.

Read the full file on GitHub · 424 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 424 lines · 58 tokens per session scan B 425294578fc0

Subscribe to this mod's changes

review-pr is a command published in the GitHub repository edutrul/drupal-ai (71 stars, last pushed 3mo ago), licensed MIT. It adds 58 tokens to every session and 2,305 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.