Fetches and reviews pull request changes for quality and design consistency.
Install
mkdir -p .claude/skills/review-pr-rlinf && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12984" && unzip -o skill.zip -d .claude/skills/review-pr-rlinf && rm skill.zipInstalls to .claude/skills/review-pr-rlinf
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Reviews a pull request from a PR URL by directly fetching the URL content (no `gh` dependency) and verifies compliance with CONTRIBUTING.md. Use when the user asks for a PR review, to review changes before merge, or to check contribution guidelines.Key capabilities
- →Fetch PR data directly from a URL
- →Fetch unified diff via URL forms
- →Check code correctness for logic bugs and edge cases
- →Verify design and pattern consistency with `origin/main`
- →Ensure code-documentation consistency and EN/ZH parity
- →Check for code style, commit conventions, and license headers
How it works
The skill fetches PR content from a URL, then analyzes changes against contribution guidelines, existing codebase patterns, and correctness criteria, prioritizing findings by severity.
Inputs & outputs
When to use review-pr
- →Review pull request code
- →Check contribution guidelines
- →Verify PR design patterns
- →Audit PR changes before merge
About this skill
Review PR (From PR URL)
Reviews the changes in a specific GitHub pull request. The primary focus is code correctness and design-pattern consistency with the existing codebase. PR formatting, commit conventions, and user-facing documentation are checked but should not dominate the review. See CONTRIBUTING.md for the contribution rules referenced below.
1. Input: PR URL
Require a PR URL (for example: https://github.com/RLinf/RLinf/pull/123).
2. Fetch PR data and the main branch
Fetch PR details directly from the URL:
- Open/fetch the PR page itself for title, description, and metadata.
- Fetch unified diff via URL forms:
<PR_URL>.diff(preferred)<PR_URL>.patch(fallback)
- If needed, fetch related pages directly from URL for comments/checks.
All cross-references must be against origin/main, not the local working tree. The current checkout may be on an unrelated branch or contain WIP changes; Glob/Grep over the working tree does not show the upstream state. Before any cross-reference lookup:
- Run
git fetch origin mainto refresh. - Read files via
git show origin/main:<path>(or browsehttps://github.com/RLinf/RLinf/blob/main/<path>). - Use
git log origin/main..<pr-head>to scope what the PR actually adds. - Never treat Glob/Grep results over the working tree as "current state of the project" — they reflect whatever branch is checked out, not main.
If the PR page is private and URL fetch is blocked, report that access is unavailable and ask the user to provide exported diff/details.
3. Review priorities
Findings are ordered by severity. Categories are listed in priority order — most of the review should be on (a) and (b); (c)–(e) are checked but should not pad the output.
(a) Correctness, bugs, and edge cases — primary
For every changed function, branch, and config path, look for:
- Logic bugs: off-by-one, inverted conditions, wrong operator/default, swapped args, mutated shared state, missing await/sync.
- Edge cases: empty/None/NaN, single-element batches, zero-size tensors, world-size=1, first/last iter, eval-only paths, resume-from-checkpoint, multi-node vs single-node paths.
- Concurrency / distributed: collectives that must run on every rank, device placement, non-deterministic ordering across workers, blocking calls in async paths, races on Ray actors / channels.
- Resource & lifecycle: GPU memory leaks (uncleared tensors, missing
enable_offload), file handles, Ray actor lifetime, missed cleanup on exceptions, double-init. - Numerical: dtype mismatches (fp16/bf16/fp32), in-place ops on grad-required tensors, unsafe casts, accumulator precision, loss-mask correctness.
- Error handling: silent
except, exceptions on hot paths, missing input validation at boundaries; conversely, over-validation of internally-trusted state. - Refactor regressions: read both the
origin/mainversion and the new version side-by-side; partial refactors often change semantics by accident.
Cite file:line in the diff and the matching origin/main:file:line when relevant.
(b) Design and pattern consistency vs origin/main — primary
The PR must match how RLinf already does things. Mismatches are usually defects from writing in isolation, not style nits.
- Find the closest sibling in
origin/main— comparable model underrlinf/models/embodiment/, env underrlinf/envs/, runner underrlinf/runners/, worker underrlinf/workers/, advantage/loss/reward underrlinf/algorithms/. Compare structure, naming, registration, base-class usage, and config wiring. - Registry wiring: new advantage/loss/reward must use
register_advantage/register_policy_loss/register_reward; new model/env must extendSupportedModel/SupportedEnvTypeand updateget_env_cls()andvalidate_cfg. Flag ad-hoc bypasses. - Worker conventions: subclass
Worker, implementinitialize, useself.log_info/log_warning/log_error(notprintor stdliblogging), launch viacreate_group(...).launch(...). - Base class / interface: embodied policies must inherit
BasePolicyand implement the documented forwards (default_forward,predict_action_batch, plus algorithm-specific). Flag re-implementations of base behavior. - Config layout: new YAML must be copied from a sibling in
examples/and follow the same key hierarchy; no calculations or dynamic values in YAML; fields read-only in code. - Reuse vs duplication: if the change reimplements a helper that already exists in
rlinf/utils/(placement, checkpoint, distributed, data-iter, logging), point to the existing helper with file:line. - Simplicity: prefer the approach the codebase already uses; flag clumsy / over-engineered alternatives with a concrete simpler suggestion.
- No hardcoded paths/hacks: machine-specific paths, sleep-based sync, monkey-patches → propose a config/env-driven version.
(c) Code ↔ docs consistency — required when code OR docs change
Both directions matter, and EN/ZH parity must be checked explicitly:
- If this PR changes documentation, follow the docs-check skill to drive this review: it cross-checks docs against code and against each other (commands, config keys, paths, model/env names) and enforces EN↔ZH parity.
- Docs → code: every config key, CLI flag, env var, file path, function/class name, and supported model/env name mentioned in changed docs must exist in
origin/main+ this PR. Verify withgit show origin/main:rlinf/.... Stale references = finding. - Code → docs: when this PR adds, removes, or renames a public-facing config key, model, env, runner, script, env var, or supported feature, the corresponding doc page must be updated in the same PR. If missing, list the exact doc files (EN and ZH) that need edits.
- Example-config model paths ↔ docs: for changed example configs under
examples/embodiment/config/*.yaml, every model-weight path field (model_path,lora_path,backbone_model_path,wan_wm_hf_ckpt_path) must satisfy all three:- Form: it is
/path/to/<repo-name>where the trailing path component equals the repo in its# https://huggingface.co/<org>/<repo>comment (the docs convention ishf download <org>/<repo> --local-dir <repo>, so basename == repo name). Flag stale/placeholder basenames (RLinf-Pi0-SFT,model,openpi, …) and a missing leading slash. - Exists: each distinct referenced repo resolves on Hugging Face —
curl -sL -o /dev/null -w '%{http_code}' https://huggingface.co/api/models/<org>/<repo>returns200(use/api/datasets/for datasets). Flag 401/404. Also flag redirecting names: if the API's returnediddiffers from the requested name, the repo was renamed — point at the canonicalid(a200via redirect is still a stale reference). - Matches the docs' per-variant model: the repo equals the one the corresponding env recipe page prescribes for that exact environment + task suite + model family — not just any existing repo. Cross-check the recipe doc's model table/download block (e.g. LIBERO spatial/object/goal + π₀ →
RLinf-Pi0-LIBERO-Spatial-Object-Goal-SFT, LIBERO-10/Long + π₀ →RLinf-Pi0-LIBERO-Long-SFT, any LIBERO suite + π₀.₅ →RLinf-Pi05-LIBERO-SFT, GR00T N1.5 per-suiteRLinf-Gr00t-SFT-{Spatial,Object,Goal,10}). Watch for base-vs-adapter mixups (model_path= full base model,lora_path= LoRA adapter) and casing drift vs the doc/canonical name. Intentional user-supplied placeholders (e.g. DAggerstudent_model/expert_model, "any pi05 checkpoint") are not findings — confirm against the recipe page before flagging.
- Form: it is
- EN ↔ ZH parity (do this explicitly, even when only one language was touched): paired pages under
docs/source-en/anddocs/source-zh/must agree on setup commands, paths, env vars, config keys, supported models/envs/algorithms, capability claims, reported numbers (metrics, table values, dataset sizes, trial counts), and section structure/order. If only one side is updated, name the matching file that also needs the change. - Sibling style: cross-check with sibling pages in the same area (e.g.
opensora.rst) for section naming/order, code-block conventions, table/link style. - Each docs finding must include a concrete suggested wording / structure fix and exact file references.
(d) Tests and CI integration
- User-facing changes must have tests (unit or e2e). Reviewer must be able to validate reproducibility.
- If this PR changes the install script (
requirements/install.sh,requirements/embodied/, ordocker/Dockerfile), follow the install-check skill to review the changes: reuse of common utilities, system deps kept insys_deps.sh, pinned/forked git deps, no ad-hocpyproject.toml/core-dep hacks, and a matching Dockerfile build stage for every new model/env. - Dependencies / CI: new env/model needs install-script update, Docker stage, and CI/e2e coverage — cross-check with the add-install-docker-ci-e2e skill.
- New CI-relevant YAML must be referenced in the e2e test matrix.
- Large/new dependencies (docker, models, datasets) → maintainer ping noted.
(e) Style, commit & PR metadata — secondary
Mention only if there are real issues; do not pad the review.
- Google Python Style; passes
pre-commit run --all-files. - Public classes/methods have Google-style docstrings; type hints on parameters; return type when not deducible.
- Assertions/exceptions have meaningful messages (no empty or
xxx != yyyrestatements). logging/self.log_*notprint.- License header (newly-added files): every file added by this PR must carry the standard RLinf header (
# Copyright <YEAR> The RLinf Authors.), and<YEAR>must equal the current calendar year. Determine the current year (e.g.date +%Y), list added files with `git
Content truncated.
When not to use it
- →When the PR page is private and URL fetch is blocked
Limitations
- →The skill does not use the `gh` dependency
- →The skill does not assume the current working tree's branch matches the user's intent
- →The skill does not treat Glob/Grep results over the working tree as 'current state of the project'
How it compares
This workflow performs a structured review of PRs by directly fetching content and comparing it against `origin/main` and `CONTRIBUTING.md`, providing a more objective and consistent assessment than a manual review.
Compared to similar skills
review-pr side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| review-pr (this skill) | 0 | 2mo | No flags | Advanced |
| effective-go | 323 | 9mo | No flags | Beginner |
| architect-review | 109 | 4mo | No flags | Advanced |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by RLinf
View all by RLinf →You might also like
effective-go
openshift
Apply Go best practices, idioms, and conventions from golang.org/doc/effective_go. Use when writing, reviewing, or refactoring Go code to ensure idiomatic, clean, and efficient implementations.
architect-review
sickn33
Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
solid-principles
SmidigStorm
Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.
python-testing-patterns
wshobson
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
codex
Lucklyric
Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. This skill should be invoked when users explicitly mention "Codex", request complex implementation challenges, advanced reasoning, or need high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.