Review PR
Overview
A 5-phase review pipeline that reads a GitHub PR, optionally checks out and
tests the branch locally, runs all review phases in parallel, deduplicates
findings, and posts validated findings as a single GitHub review via
gh-pr-review. Review submission is always COMMENT -- never auto-approves or
requests changes. A mandatory user validation gate ensures no findings are posted
without explicit approval.
When to Use
- Reviewing a GitHub PR with structured inline feedback
- Reviewing a PR with optional local build and test verification
- When you want findings posted as inline comments via
gh-pr-review
When NOT to Use
- For self-review before creating a PR -- use [oneteam:skill]
self-review
- For reviewing specs -- use [oneteam:skill]
spec-review
- For finding bugs without a PR context -- use [oneteam:skill]
bug-hunting
Modes
| Mode |
What happens |
Phase 4 |
| Read-only (default) |
Fetches PR diff via gh, reviews code without checkout |
Static analysis only -- no reproduction tests |
| Local build |
Checks out PR branch, runs existing tests + full bug-hunting with reproduction tests |
Full bug-hunting pipeline |
Read-Only Mode Constraints (All Phases)
When running in read-only mode (the default), every subagent (Phases 1-5)
operates under these constraints:
- No branch checkout. Do not
git checkout or git switch to any branch.
Use git show origin/<baseRefName>:<path> to read files from the target
branch.
- No building. Do not run build commands (
make, npm run build, cargo build, etc.).
- No file writes. Do not create, modify, or delete any files in the working
tree.
- No test execution. Do not run test suites or individual tests.
- Analysis is static only. Review the PR diff, read source files via
git show, and reason about the code. That is the entire toolkit.
These constraints apply equally to code-reviewer subagents (Phases 1, 2, 3, 5)
and the [oneteam:agent] bug-hunter (Phase 4). Phase 4 has an additional
constraint: no reproduction tests (see Phase-Specific Notes).
Phase 0: Setup
Get PR. Accept PR number or URL as skill argument. If not provided, ask
the user.
Extract repo + PR number. Parse from URL if needed, or use current repo
(gh repo view --json owner,name).
Check prerequisites. Verify gh pr-review is installed (see
Command Reference). If missing, AskUserQuestion (header: "Install prerequisites"):
| Option label |
Description |
| Install |
Install the missing tool(s) automatically |
| Abort |
Cancel the review |
Fetch PR metadata.
gh pr view <N> --json title,body,baseRefName,headRefName,files,additions,deletions
Fetch target branch (read-only). Use git fetch origin <baseRefName> to
make the target branch available locally as origin/<baseRefName>. Never
git checkout or git switch to the target branch — use git show origin/<baseRefName>:<path> to read individual files for context.
Fetch PR diff. gh pr diff <N> to get the full diff.
Fetch spec/context. AskUserQuestion (header: "Spec reference"):
| Option label |
Description |
| Provide reference |
User enters a spec, design doc, or issue link |
| Skip |
Reviewers infer intent from PR title/body/commits |
If "Provide reference": ask for the spec, design doc, or issue link.
Create or reuse session directory. If [SESSION_DIR] was provided by the
caller, reuse it. Otherwise, create a new one:
mktemp -d -t oneteam-session-XXXXXX.
Write spec to session dir. If a spec reference was provided (step 7) and
it contains substantial content (not just a path or URL), write it to
[SESSION_DIR]/spec.md. Dispatch templates reference this file instead of
inlining spec content.
Choose mode. AskUserQuestion (header: "Review mode"):
| Option label |
Description |
| Read-only |
Static analysis only -- no checkout or test execution (default) |
| Local build |
Checkout PR branch, run tests, full bug-hunting pipeline |
11. If local build: checkout PR branch (gh pr checkout <N>) and pull latest |
|
changes (git pull). gh pr checkout does not update an existing local |
|
| branch -- the explicit pull ensures the code is current. Then run existing |
|
test suite. If tests fail, report failures and AskUserQuestion (header: "Tests failing"): |
|
| Option label |
Description |
| Continue |
Proceed with review despite test failures |
| Abort |
Cancel the review |
Phases 1-5: Parallel Review
All 5 reviewer subagents launch in parallel on the same PR diff. Each
focuses only on its concern and ignores all others. Pass [SESSION_DIR] to
each reviewer dispatch prompt. In read-only mode, every subagent MUST be
explicitly told it is in read-only mode and given the Read-Only Mode
Constraints (see Modes section above).
| Phase |
Focus |
Reviewer |
Scope |
| 1 |
Spec Compliance |
code-reviewer |
Does the implementation match the spec/intent? |
| 2 |
Code Quality |
code-reviewer |
Conventions, naming, security, error handling, DRY, dead code |
| 3 |
Test Comprehensiveness |
code-reviewer |
Missing test cases, edge cases, untested error paths |
| 4 |
Bug Hunting |
[oneteam:agent] bug-hunter |
Latent bugs (static analysis in read-only; full pipeline + repro tests in local build) |
| 5 |
Comprehensive Review |
code-reviewer |
Cross-cutting concerns, integration issues, architectural concerns |
Phase-Specific Notes
- Phase 1: Does the implementation match the spec (or inferred intent)?
Provide spec reference or instruct reviewer to infer from PR title/body/commits.
See
./phase-1-spec-compliance.md for dispatch template.
- Phase 2: Conventions, naming, structure, security, error handling, OWASP
top 10, DRY violations, dead code.
See
./phase-2-code-quality.md for dispatch template.
- Phase 3: Missing test cases, edge cases, untested error paths, boundary
conditions, integration gaps, pesticide paradox.
See
./phase-3-test-comprehensiveness.md for dispatch template.
- Phase 4: Uses [oneteam:agent]
bug-hunter. In read-only mode: all
general read-only constraints apply (see Modes section), plus no reproduction
tests -- static analysis only. In local build mode: full 6-phase
[oneteam:skill] bug-hunting pipeline with reproduction tests.
See ./phase-4-bug-hunting.md for dispatch template.
- Phase 5: Cross-cutting concerns, integration issues, consistency,
architectural concerns.
See
./phase-5-comprehensive-review.md for dispatch template.
Finding Format
- [<PREFIX><N>] Severity: <level> | <file>:<line> — <description>
| Phase |
Prefix |
Severity Levels |
| 1 |
SC- |
Critical / Important / Minor |
| 2 |
CQ- |
Critical / Important / Minor |
| 3 |
TC- |
Critical / Important / Minor |
| 4 |
F |
HIGH / MEDIUM / LOW |
| 5 |
CR- |
Critical / Important / Minor |
This is the internal finding format used during review phases and
deduplication. When posting findings as inline PR comments, use the structured
comment template (see [oneteam:skill] post-review-comment).
Deduplication
After all subagents return:
- Group by file:line. If multiple phases flagged the same file:line, merge
into a single finding. Keep the highest severity. Combine descriptions noting
which phases identified it.
- Detect overlapping descriptions. If two findings on nearby lines (within
5 lines) describe the same issue, merge them.
- Sort. Group by file, then by line number within each file.
User Validation Gate
Present consolidated findings as a numbered list grouped by severity
(Critical/HIGH first, then Important/MEDIUM, then Minor/LOW). Then AskUserQuestion (header: "Post findings"):
| Option label |
Description |
| Post all |
Post all findings as PR inline comments |
| Edit list |
User specifies which findings to remove or modify |
| Cancel |
Don't post anything |
If "Edit list": user provides changes, re-present AskUserQuestion, and repeat
until approved.
HARD GATE: Do NOT post any findings to the PR without explicit user approval.
Post Review
Invoke [oneteam:skill] post-review-comment to post approved findings as inline
PR comments.
NOTE Attach code sugesstions for trivial fixes like below
fixed_code();
Command Reference
Prerequisite Checks
See [oneteam:skill] post-review-comment for full prerequisite details.
# Check gh-pr-review extension
gh pr-review --help
# If missing, ask user whether to install:
gh extension install agynio/gh-pr-review
PR Metadata & Diff
# Get repo info
gh repo view --json owner,name --jq '.owner.login + "/" + .name'
# Get PR metadata
gh pr view <PR#> --json title,body,baseRefName,headRefName,files,additions,deletions
# Fetch target branch (read-only -- never checkout)
git fetch origin <baseRefName>
# Read a file from the target branch without checkout
git show origin/<baseRefName>:<file-path>
# Get PR diff
gh pr diff <PR#>
# Checkout PR branch (local build mode only)
gh pr checkout <PR#>
git pull # gh pr checkout does not update an existing local branch
Quick Reference
| Phase |
Key Action |
Output |
| 0. Setup |
Get PR, check prerequisites, fetch diff, create session dir, write spec.md, choose mode |
PR metadata + diff + mode + session dir |
| 1. Spec Compliance |
Parallel: review spec match |
SC- findings |
| 2. Code Quality |
Parallel: review conventions |
CQ- findings |
| 3. Test Comprehensiveness |
Parallel: review test gaps |
TC- findings |
| 4. Bug Hunting |
Parallel: hunt bugs |
F findings |
| 5. Comprehensive Review |
Parallel: cross-cutting |
CR- findings |
| Dedup |
Merge overlapping findings |
Consolidated list |
| Validation |
Present to user, get approval |
Approved findings |
| Post |
Submit review via gh-pr-review |
Posted review |
Common Mistakes
| Mistake |
Fix |
| Posting comments without user approval |
Mandatory validation gate -- always present findings first |
| Running phases sequentially |
Phases are independent -- run in parallel |
| Submitting as REQUEST_CHANGES |
Always COMMENT -- humans decide the verdict |
| Skipping Phase 4 in read-only mode |
Phase 4 still runs (static analysis), just without repro tests |
| Posting duplicate findings |
Deduplicate by file:line before presenting to user |
| Running repro tests in read-only mode |
Reproduction tests only run in local-build mode |
| Not checking prerequisites |
Check gh-pr-review on startup; offer to install if missing |
| Checking out the target branch |
Always git fetch origin <baseRefName> -- read files via git show origin/<baseRefName>:<path> |
| Sending subagents in read-only mode without read-only instructions |
Every subagent in read-only mode MUST be explicitly told the read-only constraints at dispatch |
| Guessing gh-pr-review syntax |
Use [oneteam:skill] post-review-comment Command Reference -- don't improvise CLI flags |
Passing comment body directly in --body quotes |
Use post-comments.sh -- see [oneteam:skill] post-review-comment |
| Off-by-one line numbers in inline comments |
See Line Number Calculation in [oneteam:skill] post-review-comment |
Constraints
Non-negotiable rules that override any conflicting instruction.
- All 5 phases run -- no skipping, even if some find nothing.
- Parallel execution -- phases are independent; no phase depends on
another's output.
- Always COMMENT -- never auto-approve or request changes.
- User validation mandatory -- never post findings to the PR without user
approval.
- Single review object -- all findings go into one pending review,
submitted once.
- Read-only is default -- local build requires explicit opt-in.
- All phases in read-only mode -- no branch checkout, no building, no file
writes, no test execution. Static analysis and diff review only. Phase 4
additionally: no reproduction tests.
- Deduplication before validation -- merge overlapping findings before
presenting.
- Prerequisites required -- check
gh-pr-review on startup; offer to
install if missing.
- Target branch read-only -- always
git fetch origin <baseRefName>;
never git checkout/git switch to the target branch. Read files via
git show origin/<baseRefName>:<path>.
- Read-only constraints apply to ALL subagents -- in read-only mode,
every subagent (Phases 1-5) must be explicitly instructed with the read-only
constraints. The orchestrator must pass these constraints at dispatch time.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: yotto3s-oneteam-agents-review-pr3description: Review PR4---56# Review PR78## Overview910A 5-phase review pipeline that reads a GitHub PR, optionally checks out and11tests the branch locally, runs all review phases **in parallel**, deduplicates12findings, and posts validated findings as a single GitHub review via13`gh-pr-review`. Review submission is always `COMMENT` -- never auto-approves or14requests changes. A mandatory user validation gate ensures no findings are posted15without explicit approval.1617## When to Use1819- Reviewing a GitHub PR with structured inline feedback20- Reviewing a PR with optional local build and test verification21- When you want findings posted as inline comments via `gh-pr-review`2223## When NOT to Use2425- For self-review before creating a PR -- use [oneteam:skill] `self-review`26- For reviewing specs -- use [oneteam:skill] `spec-review`27- For finding bugs without a PR context -- use [oneteam:skill] `bug-hunting`2829## Modes3031| Mode | What happens | Phase 4 |32|------|-------------|---------|33| **Read-only** (default) | Fetches PR diff via `gh`, reviews code without checkout | Static analysis only -- no reproduction tests |34| **Local build** | Checks out PR branch, runs existing tests + full bug-hunting with reproduction tests | Full bug-hunting pipeline |3536### Read-Only Mode Constraints (All Phases)3738When running in read-only mode (the default), **every** subagent (Phases 1-5)39operates under these constraints:4041- **No branch checkout.** Do not `git checkout` or `git switch` to any branch.42 Use `git show origin/<baseRefName>:<path>` to read files from the target43 branch.44- **No building.** Do not run build commands (`make`, `npm run build`, `cargo45 build`, etc.).46- **No file writes.** Do not create, modify, or delete any files in the working47 tree.48- **No test execution.** Do not run test suites or individual tests.49- **Analysis is static only.** Review the PR diff, read source files via `git50 show`, and reason about the code. That is the entire toolkit.5152These constraints apply equally to code-reviewer subagents (Phases 1, 2, 3, 5)53and the [oneteam:agent] `bug-hunter` (Phase 4). Phase 4 has an additional54constraint: no reproduction tests (see Phase-Specific Notes).5556## Phase 0: Setup57581. **Get PR.** Accept PR number or URL as skill argument. If not provided, ask59 the user.602. **Extract repo + PR number.** Parse from URL if needed, or use current repo61 (`gh repo view --json owner,name`).623. **Check prerequisites.** Verify `gh pr-review` is installed (see63 Command Reference). If missing, `AskUserQuestion` (header: "Install prerequisites"):6465 | Option label | Description |66 |---|---|67 | Install | Install the missing tool(s) automatically |68 | Abort | Cancel the review |694. **Fetch PR metadata.**70 `gh pr view <N> --json title,body,baseRefName,headRefName,files,additions,deletions`715. **Fetch target branch (read-only).** Use `git fetch origin <baseRefName>` to72 make the target branch available locally as `origin/<baseRefName>`. **Never**73 `git checkout` or `git switch` to the target branch — use `git show74 origin/<baseRefName>:<path>` to read individual files for context.756. **Fetch PR diff.** `gh pr diff <N>` to get the full diff.767. **Fetch spec/context.** `AskUserQuestion` (header: "Spec reference"):7778 | Option label | Description |79 |---|---|80 | Provide reference | User enters a spec, design doc, or issue link |81 | Skip | Reviewers infer intent from PR title/body/commits |8283 If "Provide reference": ask for the spec, design doc, or issue link.84858. **Create or reuse session directory.** If `[SESSION_DIR]` was provided by the86 caller, reuse it. Otherwise, create a new one:87 `mktemp -d -t oneteam-session-XXXXXX`.889. **Write spec to session dir.** If a spec reference was provided (step 7) and89 it contains substantial content (not just a path or URL), write it to90 `[SESSION_DIR]/spec.md`. Dispatch templates reference this file instead of91 inlining spec content.9210. **Choose mode.** `AskUserQuestion` (header: "Review mode"):9394 | Option label | Description |95 |---|---|96 | Read-only | Static analysis only -- no checkout or test execution (default) |97 | Local build | Checkout PR branch, run tests, full bug-hunting pipeline |9811. **If local build:** checkout PR branch (`gh pr checkout <N>`) and pull latest99 changes (`git pull`). `gh pr checkout` does not update an existing local100 branch -- the explicit pull ensures the code is current. Then run existing101 test suite. If tests fail, report failures and `AskUserQuestion` (header: "Tests failing"):102103 | Option label | Description |104 |---|---|105 | Continue | Proceed with review despite test failures |106 | Abort | Cancel the review |107108## Phases 1-5: Parallel Review109110All 5 reviewer subagents launch **in parallel** on the same PR diff. Each111focuses only on its concern and ignores all others. Pass `[SESSION_DIR]` to112each reviewer dispatch prompt. In read-only mode, every subagent MUST be113explicitly told it is in read-only mode and given the Read-Only Mode114Constraints (see Modes section above).115116| Phase | Focus | Reviewer | Scope |117|-------|-------|----------|-------|118| 1 | Spec Compliance | code-reviewer | Does the implementation match the spec/intent? |119| 2 | Code Quality | code-reviewer | Conventions, naming, security, error handling, DRY, dead code |120| 3 | Test Comprehensiveness | code-reviewer | Missing test cases, edge cases, untested error paths |121| 4 | Bug Hunting | [oneteam:agent] `bug-hunter` | Latent bugs (static analysis in read-only; full pipeline + repro tests in local build) |122| 5 | Comprehensive Review | code-reviewer | Cross-cutting concerns, integration issues, architectural concerns |123124### Phase-Specific Notes125126- **Phase 1:** Does the implementation match the spec (or inferred intent)?127 Provide spec reference or instruct reviewer to infer from PR title/body/commits.128 See `./phase-1-spec-compliance.md` for dispatch template.129- **Phase 2:** Conventions, naming, structure, security, error handling, OWASP130 top 10, DRY violations, dead code.131 See `./phase-2-code-quality.md` for dispatch template.132- **Phase 3:** Missing test cases, edge cases, untested error paths, boundary133 conditions, integration gaps, pesticide paradox.134 See `./phase-3-test-comprehensiveness.md` for dispatch template.135- **Phase 4:** Uses [oneteam:agent] `bug-hunter`. In read-only mode: all136 general read-only constraints apply (see Modes section), plus no reproduction137 tests -- static analysis only. In local build mode: full 6-phase138 [oneteam:skill] `bug-hunting` pipeline with reproduction tests.139 See `./phase-4-bug-hunting.md` for dispatch template.140- **Phase 5:** Cross-cutting concerns, integration issues, consistency,141 architectural concerns.142 See `./phase-5-comprehensive-review.md` for dispatch template.143144### Finding Format145146```147- [<PREFIX><N>] Severity: <level> | <file>:<line> — <description>148```149150| Phase | Prefix | Severity Levels |151|-------|--------|----------------|152| 1 | SC- | Critical / Important / Minor |153| 2 | CQ- | Critical / Important / Minor |154| 3 | TC- | Critical / Important / Minor |155| 4 | F | HIGH / MEDIUM / LOW |156| 5 | CR- | Critical / Important / Minor |157158This is the **internal** finding format used during review phases and159deduplication. When posting findings as inline PR comments, use the structured160comment template (see [oneteam:skill] `post-review-comment`).161162## Deduplication163164After all subagents return:1651661. **Group by file:line.** If multiple phases flagged the same file:line, merge167 into a single finding. Keep the highest severity. Combine descriptions noting168 which phases identified it.1692. **Detect overlapping descriptions.** If two findings on nearby lines (within170 5 lines) describe the same issue, merge them.1713. **Sort.** Group by file, then by line number within each file.172173## User Validation Gate174175Present consolidated findings as a numbered list grouped by severity176(Critical/HIGH first, then Important/MEDIUM, then Minor/LOW). Then `AskUserQuestion` (header: "Post findings"):177178| Option label | Description |179|---|---|180| Post all | Post all findings as PR inline comments |181| Edit list | User specifies which findings to remove or modify |182| Cancel | Don't post anything |183184If "Edit list": user provides changes, re-present `AskUserQuestion`, and repeat185until approved.186187**HARD GATE:** Do NOT post any findings to the PR without explicit user approval.188189## Post Review190191**Invoke [oneteam:skill] `post-review-comment`** to post approved findings as inline192PR comments.193**NOTE** Attach code sugesstions for trivial fixes like below194```suggestion195fixed_code();196```197198## Command Reference199200### Prerequisite Checks201202See [oneteam:skill] `post-review-comment` for full prerequisite details.203204```bash205# Check gh-pr-review extension206gh pr-review --help207# If missing, ask user whether to install:208gh extension install agynio/gh-pr-review209```210211### PR Metadata & Diff212213```bash214# Get repo info215gh repo view --json owner,name --jq '.owner.login + "/" + .name'216217# Get PR metadata218gh pr view <PR#> --json title,body,baseRefName,headRefName,files,additions,deletions219220# Fetch target branch (read-only -- never checkout)221git fetch origin <baseRefName>222223# Read a file from the target branch without checkout224git show origin/<baseRefName>:<file-path>225226# Get PR diff227gh pr diff <PR#>228229# Checkout PR branch (local build mode only)230gh pr checkout <PR#>231git pull # gh pr checkout does not update an existing local branch232```233234## Quick Reference235236| Phase | Key Action | Output |237|-------|-----------|--------|238| 0. Setup | Get PR, check prerequisites, fetch diff, create session dir, write spec.md, choose mode | PR metadata + diff + mode + session dir |239| 1. Spec Compliance | Parallel: review spec match | SC- findings |240| 2. Code Quality | Parallel: review conventions | CQ- findings |241| 3. Test Comprehensiveness | Parallel: review test gaps | TC- findings |242| 4. Bug Hunting | Parallel: hunt bugs | F findings |243| 5. Comprehensive Review | Parallel: cross-cutting | CR- findings |244| Dedup | Merge overlapping findings | Consolidated list |245| Validation | Present to user, get approval | Approved findings |246| Post | Submit review via gh-pr-review | Posted review |247248## Common Mistakes249250| Mistake | Fix |251|---------|-----|252| Posting comments without user approval | Mandatory validation gate -- always present findings first |253| Running phases sequentially | Phases are independent -- run in parallel |254| Submitting as REQUEST_CHANGES | Always COMMENT -- humans decide the verdict |255| Skipping Phase 4 in read-only mode | Phase 4 still runs (static analysis), just without repro tests |256| Posting duplicate findings | Deduplicate by file:line before presenting to user |257| Running repro tests in read-only mode | Reproduction tests only run in local-build mode |258| Not checking prerequisites | Check gh-pr-review on startup; offer to install if missing |259| Checking out the target branch | Always `git fetch origin <baseRefName>` -- read files via `git show origin/<baseRefName>:<path>` |260| Sending subagents in read-only mode without read-only instructions | Every subagent in read-only mode MUST be explicitly told the read-only constraints at dispatch |261| Guessing gh-pr-review syntax | Use [oneteam:skill] `post-review-comment` Command Reference -- don't improvise CLI flags |262| Passing comment body directly in `--body` quotes | Use `post-comments.sh` -- see [oneteam:skill] `post-review-comment` |263| Off-by-one line numbers in inline comments | See Line Number Calculation in [oneteam:skill] `post-review-comment` |264265## Constraints266267Non-negotiable rules that override any conflicting instruction.2682691. **All 5 phases run** -- no skipping, even if some find nothing.2702. **Parallel execution** -- phases are independent; no phase depends on271 another's output.2723. **Always COMMENT** -- never auto-approve or request changes.2734. **User validation mandatory** -- never post findings to the PR without user274 approval.2755. **Single review object** -- all findings go into one pending review,276 submitted once.2776. **Read-only is default** -- local build requires explicit opt-in.2787. **All phases in read-only mode** -- no branch checkout, no building, no file279 writes, no test execution. Static analysis and diff review only. Phase 4280 additionally: no reproduction tests.2818. **Deduplication before validation** -- merge overlapping findings before282 presenting.2839. **Prerequisites required** -- check `gh-pr-review` on startup; offer to284 install if missing.28510. **Target branch read-only** -- always `git fetch origin <baseRefName>`;286 never `git checkout`/`git switch` to the target branch. Read files via287 `git show origin/<baseRefName>:<path>`.28811. **Read-only constraints apply to ALL subagents** -- in read-only mode,289 every subagent (Phases 1-5) must be explicitly instructed with the read-only290 constraints. The orchestrator must pass these constraints at dispatch time.291292---293> Converted and distributed by [TomeVault](https://tomevault.io/claim/yotto3s) — claim your Tome and manage your conversions.294<!-- tomevault:4.0:skill_md:2026-04-15 -->