Skill detail
review-pr
Review a pull request diff and write structured feedback to review.json for the workflow to publish. Use when reviewing a checked-out PR from local artifacts like pr_diff.txt and pr_description.txt and producing machine-readable review output instead of posting directly to GitHub.
Why we recommend it: Reviews a checked-out PR diff and writes structured machine-readable feedback to review.json, prioritizing correctness, security, error handling, and tests.
Inspect before use
Read the source instructions and check the requirements before you install this skill.
SKILL.md
The saved excerpt is a snapshot from when this skill was listed. The external source remains the complete and most current version.
--- name: review-pr description: Review a pull request diff and write structured feedback to review.json for the workflow to publish. Use when reviewing a checked-out PR from local artifacts like pr_diff.txt and pr_description.txt and producing machine-readable review output instead of posting directly to GitHub. --- # Review PR Skill Review the current pull request and write the output to `review.json`. ## Context - The working directory is the PR branch checkout. - The workflow usually provides an annotated diff in `pr_diff.txt`. - The workflow usually provides the PR description in `pr_description.txt`. - If `spec_context.md` exists, it contains spec context for implementation-vs-spec validation. - When the prompt references `.agents/skills/review-pr/scripts/resolve_spec_context.py`, use that script to materialize `spec_context.md` on demand instead of expecting spec content to be embedded in the prompt. - Focus on files and lines changed by this PR. - Do not post comments or reviews to GitHub directly. ## Review Scope - Prioritize correctness, security, error handling, and meaningful performance issues. - Treat comment quality and test quality as first-class review priorities alongside those — not as optional nits to mention only if time allows; check both against the repository's own conventions before finalizing your verdict. - If the consuming repository provides a local `security-review-pr` companion skill or the prompt requests a security pass, apply it as supplemental guidance on code PRs and fold any security findings into the same `review.json` rather than emitting a separate output. - When `spec_context.md` exists, use the repository's local `check-impl-against-spec` skill if available and treat material spec drift as a review concern. - Include style or nit comments only when you can provide a concrete suggestion block. - If a concern involves untouched code, mention it in top-level `body` instead of an inline comment. - Do not suggest adding test cases that only vary constructor inputs or struct fields when the existing test already covers the meaningful behavior. Only suggest new tests when they exercise a distinct code path or edge case. - When a PR is clearly a V0 or initial implementation, frame robustness suggestions (timeouts, retries, lifecycle management) as optional future work rather than blocking concerns, unless they risk correctness, security, or data loss. ## Repository-specific guidance Before reviewing, actively check whether the consuming repository ships a companion `review-pr-local` skill that specializes this one for its own conventions: if the prompt names one, read it there; otherwise look for one in the repository itself (for example, at `.agents/skills/review-pr-local/SKILL.md`, though a repository may place or name its specialization differently). If a companion exists, read it and apply its guidance as part of this review. If none turns up either way, rely on the core contract alone. The companion is expected to specialize this skill's commenting and testing guidance with the repository's own conventions. It may never change the output JSON schema, the severity labels, the safety rules, the evidence rules, the suggestion-block constraints, or the diff-line-annotation contract described elsewhere in this skill. ## Diff Line Annotations The diff file uses these prefixes: - `[OLD:n]` for deleted lines on the old side. Use `"LEFT"`. - `[NEW:n]` for added lines on the new side. Use `"RIGHT"`. - `[OLD:n,NEW:m]` for unchanged context. Use `"RIGHT"` with line `m`. Treat these annotations as the only source of truth for inline comment locations. For every inline comment you emit, first identify the exact annotated line in `pr_diff.txt` (or the inlined PR diff) and copy its path, side, and line number into `review.json`. Do not infer line numbers from prose, rendered GitHub views, file lengths, surrounding spec text, or unannotated snippets. If you cannot point to a specific `[NEW:n]Read the full source on GitHub (opens external page)