一键导入
pr-review
Review a GitHub PR with design-first analysis, posted as a GitHub review.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Review a GitHub PR with design-first analysis, posted as a GitHub review.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | pr-review |
| description | Review a GitHub PR with design-first analysis, posted as a GitHub review. |
Review a GitHub pull request with design-first analysis, posted as a GitHub review.
$ARGUMENTS — PR number or URL. If empty, detect from the current branch.
You are reviewing a PR on the speculators repo — a library for training and serving speculative decoding models (Eagle3, DFlash, MTP) with vLLM integration.
$ARGUMENTS (or current branch via gh pr view -R vllm-project/speculators --json number).gh pr view -R vllm-project/speculators <number> --json state,isDraft. Do not proceed if the PR is closed, merged, or a draft.gh user) already posted a review on this PR. If so, compare the latest commit SHA on the PR against the commit SHA at the time of your last review. Do not post again if there are no new commits since your last review — report to the user that the PR hasn't changed since the last review. Even with new commits, if your review would say substantially the same thing as your previous one (same verdict, same outstanding items), do not post — report to the user that nothing has materially changed.Run these in parallel:
gh pr view -R vllm-project/speculators <number> --json title,body,baseRefName,headRefName,author,labels,filesgh pr diff -R vllm-project/speculators <number>gh api repos/vllm-project/speculators/pulls/<number>/reviews — existing reviewsgh api repos/vllm-project/speculators/pulls/<number>/comments — inline commentsgh api repos/vllm-project/speculators/issues/<number>/comments — conversation threadThen read the full diff. For changed files larger than 300 lines, also read the full file for surrounding context.
If the PR description contains links (issues, discussions, external docs, benchmarks, etc.), fetch them and incorporate the context. Verify that the PR actually addresses what the linked resources describe — flag mismatches between linked context and the implementation.
Before forming any opinions, catalog:
Do NOT echo points already raised by other reviewers. If you agree with an existing comment, do not post your own version of it — even with additional detail or a different explanation. The only exception is if the author asked a clarifying question on the existing comment and the original reviewer hasn't answered; in that case, reply to that comment thread rather than posting a separate inline comment. Drop any finding that overlaps with an existing review comment.
If reviewers or the author linked to sources (docs, issues, code snippets, benchmarks, papers) in their comments, fetch and read them — they often contain context that informs whether a concern is valid or already resolved.
Evaluate these first — they matter more than line-level nits:
.idea/, .vscode/), or code that reimplements something already available in a dependency.speculators? Does it introduce unnecessary abstractions or bypass existing ones? Read surrounding code in the same module to understand local conventions (naming, error handling, structure) and flag deviations.If the PR description or linked issues reference an RFC (issues labeled rfc in this repo), fetch the RFC issue via gh issue view and verify:
Flag any discrepancy between the RFC and the implementation, quoting the relevant part of the RFC discussion.
If the PR description, commit messages, or code comments reference a paper (arXiv, conference proceedings, etc.):
WebFetch on the arXiv abstract page or PDF URL).L = ..., but the implementation at file:line computes ... instead — is this intentional?"Only flag mismatches you can concretely demonstrate by quoting both the paper and the code. Do not flag stylistic differences in how math is expressed if the computation is equivalent.
Apply path-specific focus based on which files changed:
src/speculators/train/**: Distributed training correctness (barriers, device placement, FSDP), LR scheduler logic, checkpoint save/resume, loss computation with padding masks, multi-step loss aggregation and decay, bfloat16 safety.src/speculators/models/**: Architecture correctness, attention mask construction for speculative positions, vocabulary mapping (draft→target) in forward/loss, KL divergence alignment, Pydantic config serialization.src/speculators/data_generation/**: Hidden state extraction correctness, shift-based alignment (off-by-one), loss mask application before storage, vLLM client error handling.src/speculators/convert/**: Weight mapping completeness, shape compatibility, key renaming correctness, legacy format assumptions.src/speculators/config.py: Pydantic validators, serialization roundtrip, backward compat with saved checkpoints, registry auto-discovery.tests/**: Coverage of new code paths, edge cases for speculative decoding (vocab boundaries, multi-step loss), proper mocking of vLLM/GPU.Ignore: **/*.pyc, **/build/**, **/.pytest_cache/**, **/.ruff_cache/**, **/__pycache__/**, **/*.egg-info/**.
Rate each finding 0–100:
Only keep findings with confidence ≥ 80.
False positives to actively filter out:
For each surviving finding:
Do NOT speculate. Only flag issues you can validate from the diff, surrounding code, or linked documentation. If you're unsure whether something is a bug, phrase it as a question to the author.
Source attribution: If the PR implements logic derived from a paper, spec, or external reference and the code doesn't link to it (in comments, docstrings, or the PR description), ask the author to add a reference. Future readers shouldn't have to reverse-engineer which paper or doc a piece of logic came from.
Structure:
Review body (high-level summary):
Inline comments (line-level):
https://github.com/vllm-project/speculators/blob/{full_sha}/{path}#L{start}-L{end} Get the SHA via git rev-parse HEAD on the PR branch, and include ≥1 line of context above and below.Re-check every comment against this checklist:
Drop any comment that fails any check.
Use gh api to post the review with all inline comments in a single atomic review submission. Do not use -f 'comments[0][...]' flags — gh serializes those as a JSON object with string keys, not an array, causing a 422 error. Instead, pipe raw JSON via --input -:
cat <<'REVIEW_EOF' | gh api repos/vllm-project/speculators/pulls/{number}/reviews -X POST --input - --jq '.html_url'
{
"event": "COMMENT",
"body": "<review summary>",
"comments": [
{"path": "<file>", "line": <line>, "body": "<comment>"},
{"path": "<file>", "start_line": <start>, "line": <end>, "side": "RIGHT", "body": "<comment>"}
]
}
REVIEW_EOF
For single-line comments, use line only. For multi-line, use start_line + line. Use side: "RIGHT" for additions.
If there are zero inline comments beyond the summary, post just the review body.
If no issues survive filtering (all < 80 confidence), post a short review comment. Keep it to 1–3 sentences max. Do NOT list everything you checked — that's noise. Examples:
_save happy path. Recommend approving once addressed."Never approve a PR automatically. Always use event="COMMENT", never event="APPROVE". Only the human reviewer should submit an approval.
End every review body with:
🤖 Generated with [Claude Code](https://claude.ai/code) using the `/pr-review` skill
Report the review URL when done, along with a brief summary: number of findings posted, number filtered out, and wall-clock time elapsed since Phase 0 started.