协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
nvidia-nemo-rl-review-pr【开发与工程】Interactive code review for NVIDIA-NeMo/RL pull requests. Checks out PR locally, reads existing comments, applies coding guidelines from skills, previews findings, and posts review comments. Also supports reviewing the current branch locally.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: nvidia-nemo-rl-review-pr description: Interactive code review for NVIDIA-NeMo/RL pull requests. Checks out PR locally, reads existing comments, applies coding guidelines from skills, previews findings, and posts review comments. Also supports reviewing the current branch locally. license: Apache-2.0 AND CC-BY-4.0 allowed-tools:
Review a pull request or local branch interactively, applying the project's coding guidelines.
$ARGUMENTS contains a number → PR mode with that PR number$ARGUMENTS is empty or has no number → LOCAL mode (review current branch vs main)$ARGUMENTS contains update → UPDATE mode (PR mode only)$ARGUMENTS contains --deep → use parallel subagents for deeper reviewRepo: NVIDIA-NeMo/RL
Examples:
/review-pr 123 — review PR #123, single agent/review-pr 123 --deep — review PR #123 with parallel subagents/review-pr 123 update — follow up on existing threads for PR #123/review-pr — review current branch vs main, terminal output onlygit fetch origin pull/$PRNUM/head:pr-$PRNUM-review
git checkout pr-$PRNUM-review
Already on the correct branch. Determine the merge base:
git merge-base main HEAD
All with owner=NVIDIA-NeMo, repo=RL, pullNumber=$PRNUM:
mcp__github__pull_request_read method=get → PR title, description, author, base branch, labels, head SHAmcp__github__pull_request_read method=get_diff → full diffmcp__github__pull_request_read method=get_files → list of changed filesmcp__github__pull_request_read method=get_review_comments → existing review threadsmcp__github__pull_request_read method=get_reviews → existing reviewsmcp__github__pull_request_read method=get_comments → general PR commentsgit diff $(git merge-base main HEAD)..HEAD
git diff $(git merge-base main HEAD)..HEAD --name-only
No MCP calls needed.
.claude/skills/*/SKILL.md files (except review-pr) for guideline rules.claude/review-memory/*.md — if any exist, read them for learned patternsAnalyze all changes yourself. Return a list of candidate issues — each with file, line, category, and description. Do NOT score them yet; scoring happens in the validation step (Phase 3b).
--deep) — parallel subagentsLaunch 3 opus subagents in parallel using the Agent tool. Provide each with the diff, PR description (if PR mode), and the guideline skills content. Each returns a list of candidate issues (file, line, category, description). Do NOT ask them to score — scoring happens in Phase 3b.
Subagent 1 — Guideline compliance: Review the diff against all guideline skills (code-style, config-conventions, error-handling, testing, copyright, docs). For each violation, return the file, line, description, and which skill it violates.
Subagent 2 — Bug scan (diff only): Scan for obvious bugs in the diff without reading surrounding context. Flag syntax errors, type errors, clear logic errors, missing imports, unresolved references.
Subagent 3 — Contextual bug scan: Read surrounding code and git history for each changed file. Look for bugs that only become apparent with context: incorrect API usage (especially megatron-bridge, megatron-lm, automodel, gym), race conditions, broken assumptions.
After all subagents return: merge results and deduplicate (same file+line+issue = one finding). Then proceed to Phase 3b.
Read and Grep to understand the change in contextFor each candidate issue from Phase 3, launch a separate opus validation subagent using the Agent tool. Launch these in parallel (batch all at once).
Each validation subagent receives:
The validation subagent's job:
| Score | Meaning |
|---|---|
| 0 | Not confident, likely false positive |
| 25 | Somewhat confident, might be real |
| 50 | Moderately confident, real but minor |
| 75 | Highly confident, real and important |
| 100 | Absolutely certain, definitely real |
Filter: discard any issue scoring below 80. These are the false positives we want to avoid.
Display findings to the user with confidence scores:
PR #<number>: <title> (by <author>)
Files changed: <count>
--- Findings (scored ≥80) ---
[BUG 95] path/to/file.py:42 — <brief description>
Suggested: "<the comment text>"
[GUIDELINE 85] path/to/other.py:15 — <brief description>
Suggested: "<the comment text>"
--- Filtered (scored <80) ---
N low-confidence issues omitted
--- Skipped (already covered by other reviewers) ---
- <brief list>
--- Thread Responses (<count>) --- (UPDATE mode only)
Thread on file.py:10 (by <author>) — <planned action>
Suggested reply: "<the reply text>"
Then use AskUserQuestion:
Branch: <branch-name> (vs main)
Files changed: <count>
--- Findings (scored ≥80) ---
[BUG 95] path/to/file.py:42 — <brief description>
[GUIDELINE 85] path/to/other.py:15 — <brief description>
--- Filtered (scored <80) ---
N low-confidence issues omitted
No posting step — terminal output only. Ask if the user wants to discuss any findings.
mcp__github__pull_request_review_write with method=create, commitID=<head_sha> (no event — creates pending review)mcp__github__add_comment_to_pending_review with:
path: relative file pathline: line number on the RIGHT side of the diffside: RIGHTsubjectType: LINE (or FILE if the comment is file-level)body: the comment textmcp__github__pull_request_review_write with method=submit_pending, event=COMMENT, body=<one-line summary of findings>If a line number cannot be mapped from the diff, fall back to subjectType: FILE.
For each thread response: mcp__github__add_reply_to_pull_request_comment with:
commentId: the ID of the comment being replied tobody: the reply textAfter the review (both PR and LOCAL mode), for each comment/finding the user approved or discussed:
.claude/review-memory/*.md for existing patterns## Occurrences section<skill-name> skill? (yes/no)"SKILL.md, then delete the memory file.claude/review-memory/ with this format:# <Pattern Name>
**Do:** <what to do instead>
**Don't:** <the anti-pattern>
## Occurrences
- PR #<number>: <file>:<line> (<date>)
Create the .claude/review-memory/ directory if it does not exist (mkdir -p).