Pr review

From faizkhairi/claude-code-blueprint · View interactive version

Pr review is an AI agent skill from the GitHub repository faizkhairi/claude-code-blueprint. Review and post feedback on a GitHub or Gitea pull request end-to-end: fetch the PR diff, run a multi-agent code review, and auto-post the verdict as a real PR review (approve/request-changes/comment) via the platform's API. Triggers on: 'review this PR', 'review PR #N', 'check this pull request', '

How to use this skill

Skill file

This posts a REAL review to GitHub or Gitea (comments, and an approve/request-changes/comment verdict). It fetches a pull request's diff, runs the same multi-agent analysis as review-full, applies any project-specific review rules, then submits the review via the platform's API. For reviewing local diffs that aren't an open PR, use review-full or review-diff instead.

Step 0: Resolve the PR and detect the platform

Step 1: Load PR context

Step 2: Load project-specific review rules (if any)

Step 3: Determine PR scope

Look at the diff's file paths to scope which rules apply (e.g. frontend-only, backend-only, or mixed changes) and skip rules tagged for the side the PR doesn't touch.

Step 4: Multi-agent analysis

Follow the review-full skill's Steps 1-6 (spawn code-reviewer, security-reviewer, db-analyst, and architecture-reviewer as applicable) using the fetched PR diff as the change set, plus any project-specific rules loaded in Step 2. Produce the standard findings table:

| # | Severity | File:Line | Finding | Recommendation |

Step 5: Mandatory self-verification (do not skip; runs before posting)

  1. Grep verification. For every project-specific "must fix"-style rule with a greppable pattern, re-run the grep against the diff and confirm every match is either included as a finding or explicitly justified as not a violation.
  2. Rule/agent coverage line. State which agents ran and which project rules were checked, e.g. "checked code-reviewer, security-reviewer, rules A1-A2, G1-G8: N rules/checks in scope, M findings raised."
  3. Sanity check. If the diff touches 5+ files and zero findings were raised, write one sentence justifying why (e.g. "pure rename refactor", "config-only change"). Zero findings on a large diff is suspicious and must be justified, not assumed clean.
  4. File coverage check. Confirm the number of files examined equals the diff --git count recorded in Step 1.

Step 6: Build the review payload and pick the verdict

| Reviewer vs. author | Findings | event |

|---|---|---|

| Self-review (author == reviewer) | Any | COMMENT (always; platform rejects APPROVE/REQUEST_CHANGES on your own PR) |

| Reviewer != author | Any CRITICAL/HIGH | REQUEST_CHANGES |

| Reviewer != author | Only MEDIUM/LOW | COMMENT ("LGTM with notes") |

| Reviewer != author | None | APPROVE |

If a POST with event: APPROVE or REQUEST_CHANGES fails with 403/422 (some Gitea instances permission-block certain accounts from approving), retry the same payload with event: COMMENT and say so explicitly in the summary. Do not silently swallow the failure.

Review body (top-level summary, opens every review body):

<severity emoji + count summary, e.g. "CRITICAL 2, HIGH 3, MEDIUM 1">

<DO NOT MERGE: N blocking item(s), only if any CRITICAL/HIGH present>

Blocking:
1. path/to/file.ts:47: <short description>
...

See inline comments for full detail per finding.

Inline comment format (one per finding that has a specific line):

<emoji> [SEVERITY] <Module/symbol>: <what is wrong>. <Concrete suggested fix>.

Severity emoji: CRITICAL, HIGH, MEDIUM, LOW map to plain-language tags in the body; use these emoji inline: ❌ CRITICAL, âš ī¸ HIGH, 🔍 MEDIUM ("verify"), 💡 LOW ("minor"), ✅ OK (previously-flagged issue now fixed), â„šī¸ NOTE (informational, non-blocking).

Positioning: a finding on a line in the new file goes in comments with that line number; a finding only on a deleted line uses the old-file line number instead; a PR-level finding with no specific line is omitted from comments and goes in body only.

Step 7: Post the review

Step 8: Verify

  1. Confirm the response contains a valid review id. A missing/null id means the POST failed silently. Read the error body and report the real failure; do not report success.
  2. Confirm file coverage matches the count recorded in Step 1.
  3. Re-read each cited finding's lines to confirm the finding text still matches the actual code before declaring the review posted.
  4. Never say "review posted" without having confirmed a valid id.

Review discipline

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.