skills/multi-agent-review/SKILL.md
Multi-agent code review using 3 parallel subagents (Claude, GPT, Gemini) to review branch changes against origin/main. Validates findings against actual diffs and posts consolidated report to GitHub PR. Use before opening a PR, when wanting multiple AI perspectives on code changes, or for large changesets that might truncate in single-agent reviews. Triggers on "multi-agent review", "review my branch", "review changes against main", "AI code review", or "review before PR".
npx skillsauth add richardwu/agent-skills multi-agent-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
gh CLI (authenticated)origin/main remote tracking branchgit fetch origin main 2>/dev/null
BASE=$(git merge-base --fork-point origin/main HEAD 2>/dev/null || git merge-base origin/main HEAD)
Use --fork-point first (more accurate for rebased branches), fall back to plain merge-base.
If both fail, report error: "Could not determine base commit. Check that origin/main exists and has been fetched." and stop.
# Committed changes since base
FILES_COMMITTED=$(git --no-pager diff --name-only $BASE..HEAD)
STAT_COMMITTED=$(git --no-pager diff --stat $BASE..HEAD)
# Uncommitted changes (staged + unstaged + untracked)
FILES_UNCOMMITTED=$(git --no-pager diff --name-only HEAD; git ls-files --others --exclude-standard)
STAT_UNCOMMITTED=$(git --no-pager diff --stat HEAD)
# Combined unique file list
FILES=$(echo "$FILES_COMMITTED"$'\n'"$FILES_UNCOMMITTED" | sort -u | sed '/^$/d')
STAT="$STAT_COMMITTED"
Use the Task tool to launch 3 parallel subagents. Before constructing each prompt:
review-persona.md (relative to this skill directory) for the shared reviewer personaagents/ for its specific focus areaSubagent definitions (each references review-persona.md):
agents/multi-review-claude.md — "The Architect": architecture, design, abstractions (latest Claude Opus model)agents/multi-review-gpt.md — "The Detective": correctness, edge cases, error handling (latest GPT Codex model)agents/multi-review-gemini.md — "The Guardian": security, performance, production readiness (latest Gemini Pro model)Construct each subagent's prompt by concatenating:
review-persona.md{{BASE}}, {{FILES}}, {{STAT}} replaced from steps 1-2)Review context block:
---
## Review Context
BASE commit: {{BASE}}
Changed files:
{{FILES}}
Stat summary:
{{STAT}}
## Instructions
- Use terminal commands to inspect diffs file-by-file to avoid truncation:
- For committed changes: `git --no-pager diff --no-color {{BASE}} -- <path>`
- For uncommitted changes (staged/unstaged): `git --no-pager diff --no-color HEAD -- <path>`
- For untracked files (new files not yet staged): `cat <path>` (review full contents)
- To check if a file is untracked: `git ls-files --others --exclude-standard -- <path>`
- Only comment on things you actually viewed from the diff or file output
- If you hit output truncation, state what you reviewed and what you did not
- For binary files, note their filepath but skip review
- Follow the output format specified in the review persona above
Allow up to 5 minutes per subagent. If a subagent errors or times out, proceed with available results and note the gap in the final report under Cross-Review Notes.
For each issue or recommendation from any subagent:
git --no-pager diff --no-color $BASE -- <file>git --no-pager diff --no-color HEAD -- <file>cat <file> (verify the referenced content exists)Remove unverified claims from the final report. Mark speculative claims clearly.
Compile the consolidated markdown report (see Step 7 for format).
Attempt to post as a PR comment:
gh pr comment --body "<report>"
If gh fails (no PR exists, auth issue, etc.), output the full report in the response instead and note the comment failure.
## Multi-Agent Code Review
### 1. Overall Assessment
[Summary. Include PR comment link if posted successfully.]
### 2. Strengths
[Points agreed upon across subagents]
### 3. Issues by Priority
#### Critical
- **`file.ts:42` -- Description** (flagged by: Claude, GPT, Gemini)
<details><summary>Prompt to fix with AI</summary>
[Copy-pasteable prompt for an LLM to fix this specific issue]
</details>
#### Important
- ...
#### Minor
- ...
### 4. Specific Recommendations
[Consolidated actionable recommendations]
### 5. Testing Feedback
[Test coverage gaps, suggested test cases]
### 6. Cross-Review Notes
[Discrepancies between subagents, uncertainties, gaps,
which subagents timed out if any]
For each issue in section 3, include which subagents flagged it. Issues flagged by all 3 subagents are highest confidence and should be listed first within their priority level.
development
Review and verify that a Ralph PRD's user stories have been implemented correctly. Reads prd.json, steps through each user story's acceptance criteria, runs tests, checks code, and uses browser verification. Produces a pass/gap/untestable summary. Triggers on: review prd, verify prd, check ralph requirements, review requirements, are the stories done, verify user stories, prd review.
development
Convert PRDs to prd.json format for the Ralph autonomous agent system. Use when you have an existing PRD and need to convert it to Ralph's JSON format. Triggers on: convert this prd, turn this into ralph format, create prd.json from this, ralph json.
documentation
Generate a Product Requirements Document (PRD) for a new feature. Use when planning a feature, starting a new project, or when asked to create a PRD. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out.
development
Fix issues on the current PR: address bot (eg Claude Code, CodeRabbit, or custom GHA) review comments and fix failing CI checks. Use when asked to fix PR, fix review comments, fix CI, or fix checks. Triggers on: fix pr, fix review, fix ci, fix checks, fix failing checks.