跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 review-pr

Review Pr

审查拉动请求 diff 并编写结构化反馈以进行审查. json 为工作流程发布。 用于审查 pr_diff.txt 和 pr_description 等本地文物的退出 PR 。 txt并生产机器可读审查输出,而不是直接发到GitHub.

29217 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

审查拉动请求 diff 并编写结构化反馈以进行审查. Json 工作流程发布

何时用

检查来自 pr_diff.txt 和 pr_description 等本地文物的检查退出 PR。 txt和生产机器可读审查输出,而不是直接张贴到 GitHub

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Review PR Skill、Context、Review Scope、Repository-specific guidance、Diff Line Annotations、Comment Requirements。

文件分析

文件分析:除 SKILL.md 外,正文引用了 scripts/resolve_spec_context.py、scripts/validate_review_json.py,属于带资源的技能包,这些文件按需再读。

官方 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 SkillContextReview ScopeRepository-specific guidanceDiff Line AnnotationsComment RequirementsSuggestion BlocksOutput FormatBody RequirementsPre-Verdict AuditFinal Checks

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
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.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 2
  • scripts/resolve_spec_context.py
  • scripts/validate_review_json.py

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「review-pr」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-093f6e225506dfe8-Review-Pr.html
请存为 .cursor/skills/review-pr/SKILL.md 或 .claude/skills/review-pr/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/warpdotdev/common-skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/warpdotdev/common-skills' --list

npx skills add 'https://github.com/warpdotdev/common-skills' --skill 'review-pr'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- 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]`, `[OLD:n]`, or `[OLD:n,NEW:m]` line in the annotated diff, put the feedback in top-level `body` instead of `comments`. ## Comment Requirements Every comment body must start with one of these labels: - `🚨 [CRITICAL]` for bugs, security issues, crashes, or data loss. - `⚠️ [IMPORTANT]` for logic problems, edge cases, or missing error handling. - `💡 [SUGGESTION]` for worthwhile improvements or better patterns. - `🧹 [NIT]` for cleanup only when the comment includes a suggestion block. A confirmed violation of the repository's commenting or testing guidelines can warrant `⚠️ [IMPORTANT]` on its own — regardless of how clean the rest of the PR is. Do not default these to `🧹 [NIT]`/`💡 [SUGGESTION]` just because the surrounding code looks good. Write comments with these constraints: - Be concise, direct, and actionable. - Do not add compliments or hedging. - Prefer single-line comments. - Keep ranges to at most 10 lines. - Restrict inline comments to lines that appear explicitly in the annotated PR diff. - Only create file-level or inline comments for files that exist in this PR's diff. - If the relevant file or line is not part of the diff, put the feedback in top-level `body` instead of `comments`. - Before adding each comment object, verify that its `path`, `side`, `line`, and optional `start_line`/`start_side` correspond to real annotations in the same file's diff section. ## Suggestion Blocks When proposing a code change, use: ```suggestion ``` Rules: - Match the exact indentation of the original file. - Include only replacement code. - The block content replaces **exactly** the lines `start_line`–`line` inclusive. Every line inside the block becomes the new file content for that range, and GitHub leaves all other lines untouched. - Do **not** include lines outside that range. Lines above `start_line` and below `line` remain in the file; repeating them inside the block causes them to appear twice after the suggestion is committed. - Never open the block with a line that already appears immediately above `start_line`, and never close the block with a line that already appears immediately below `line`. If you need those lines as anchors, widen `start_line` or `line` so they are actually part of the replaced range. - Count brace, bracket, paren, and block-delimiter depth (`{`, `[`, `(`, `end`, etc.) across the original replaced lines and ensure the replacement ends at the same depth. Do not emit phantom closing tokens, and do not drop required ones. - When unsure of the surrounding context, widen `start_line`/`line` to include enough real lines from the diff rather than guessing at surrounding tokens. - For multi-line suggestions, set `start_line` and `start_side` to the first line, and `line` and `side` to the last line. ## Output Format Create `review.json` with this shape: ```json { "verdict": "REJECT", "body": "## Overview\n...\n\n## Concerns\n- ...\n\n## Verdict\nFound: 1 critical, 2 important, 3 suggestions\n\n**Request changes**", "comments": [ { "path": "path/to/file", "line": 42, "side": "RIGHT", "start_line": 40, "start_side": "RIGHT", "body": "⚠️ [IMPORTANT] Short explanation\n\n```suggestion\nreplacement\n```" } ] } ``` Field rules: - `verdict` is required and must be exactly the string `"APPROVE"` or `"REJECT"` (uppercase). Map your final recommendation as: `Approve` or `Approve with nits` → `"APPROVE"`; `Request changes` → `"REJECT"`. The `verdict` and the human-readable recommendation in top-level `body` must agree. - Top-level `body` is the GitHub review body and is required. Use `body`, not `summary`, for the review overview and final recommendation. - `comments` is required and must be an array. Use an empty array when there are no inline comments. - `path` must be relative to the repository root. - `line` is required and must target the correct side. - `start_line` is optional and only for multi-line ranges. When `start_line` is present, `start_side` is required and must be `"LEFT"` or `"RIGHT"`. - `side` must be `"LEFT"` or `"RIGHT"`. ## Body Requirements The top-level `body` must include: - A high-level overview of the PR. - Important concerns and any untouched-code concerns that could not be commented inline. - Issue counts in the format `Found: X critical, Y important, Z suggestions`. - A final recommendation of `Approve`, `Approve with nits`, or `Request changes`. This recommendation must match the top-level `verdict` field (`Approve` / `Approve with nits` → `"APPROVE"`; `Request changes` → `"REJECT"`). ## Pre-Verdict Audit Before drafting the top-level `body` or choosing `verdict`, complete this audit — a holistic read-through of the diff is not sufficient. - **Comments**: List every comment (doc comment or inline) the diff adds or changes, one by one with its file:line. For each one, check it individually against the repository's own commenting guidelines, whatever form those take — or, if the repository defines none, judge it against the commenting distribution of existing code in the project (density, tone, what existing comments explain vs. omit). Evaluate compliance independently of the comment's writing quality, technical accuracy, or how subtle/important the issue it describes is: none of those qualities excuses a violation of an applicable guideline or a clear mismatch with the codebase's own norms. - **Tests**: Check every test the diff adds or changes against the repository's own testing guidelines, whatever form those take. ## Final Checks Before returning or uploading `review.json`: - Fix invalid JSON if validation fails. - Confirm line numbers match the annotated diff. - Run the bundled validator against the exact annotated diff you reviewed: ```sh python3 .agents/skills/review-pr/scripts/validate_review_json.py --review-json review.json --diff pr_diff.txt ``` If the script reports any invalid comments, fix `review.json` and rerun it. Do not return or upload `review.json` until this validator passes. If the script path is not present at that exact location, locate `validate_review_json.py` under the loaded `review-pr` skill directory and run that copy with the same arguments. - Do not run `gh pr review`, `gh pr comment`, `gh api`, or any other command that posts to GitHub. Your only output is the final `review.json`.

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…