Agent Skillsrustfs/rustfs › pr-review

pr-review

GitHub

自动化GitHub PR端到端审查,包括获取元数据、分析差异、执行多角色对抗性代码审查、验证CI状态并生成结构化评审报告及评论。

.mimocode/skills/pr-review/SKILL.md rustfs/rustfs

Trigger Scenarios

用户提供GitHub PR链接或编号并要求审查 需要自动执行PR代码质量与安全性评估

Install

npx skills add rustfs/rustfs --skill pr-review -g -y
More Options

Non-standard path

npx skills add https://github.com/rustfs/rustfs/tree/main/.mimocode/skills/pr-review -g -y

Use without installing

npx skills use rustfs/rustfs@pr-review

指定 Agent (Claude Code)

npx skills add rustfs/rustfs --skill pr-review -a claude-code -g -y

安装 repo 全部 skill

npx skills add rustfs/rustfs --all -g -y

预览 repo 内 skill

npx skills add rustfs/rustfs --list

SKILL.md

Frontmatter
{
    "name": "pr-review",
    "description": "Review a GitHub PR end-to-end from a URL or number — fetch metadata, inspect the diff, run multi-role adversarial review, check CI status, and post the review comment. Use when the user provides a PR link and asks to review it."
}

PR Review

Use this skill when the user provides a GitHub PR URL or number and asks to review it. This covers the full review lifecycle: data gathering, code review, CI verification, and posting the result.

Prerequisites

  • Read AGENTS.md for the repository's adversarial validation policy and change-style rules.
  • The adversarial-validation skill handles the review role playbooks; this skill orchestrates the workflow around it.

Workflow

1. Gather PR context

gh pr view <N> --json title,author,state,body,additions,deletions,changedFiles,commits,baseRefName,headRefName
gh pr diff <N> --name-only

Read the PR body and linked issues to understand the change's purpose. If the PR references an issue, fetch that too:

gh issue view <ISSUE> --json title,body,state

2. Fetch the diff and classify the change

git fetch origin pull/<N>/head:pr-<N>
git diff main...pr-<N> --stat

Classify the change by risk tier (per AGENTS.md):

  • Exempt: docs/comments/instruction-only, formatting, typos.
  • Mechanical: renames, file moves, test-only or tooling changes.
  • Standard (default): any behavior change.
  • High risk: locking, erasure coding, quorum/heal, replication, multipart, RPC, lifecycle/tiering, metadata formats, persistence/fsync, IAM/KMS/auth, on-disk/on-wire formats, S3 API-visible behavior.

3. Cluster changed files and delegate review

Group the changed files into logical clusters (by crate or functional area). For each cluster, spawn a subagent with a focused review prompt that includes:

  • The cluster's changed files and their diffs.
  • The applicable adversarial role probes (from the adversarial-validation skill).
  • The repository's AGENTS.md rules relevant to that domain.

For standard-tier changes: correctness adversary + simplicity adversary + test-coverage skeptic, plus every role whose domain the diff touches. For high-risk changes: run all seven roles.

Each subagent must produce findings (concrete failure scenario with file:line) or a null report ("attacked X, Y, Z — no break found").

4. Check CI status

gh pr checks <N>

If any checks fail, investigate:

gh run view --log-failed --job=<JOB_ID>

Determine whether failures are pre-existing (on main), flaky, or caused by the PR.

5. Synthesize findings

Combine all subagent findings into a structured review:

  • Summary: one-paragraph overview of the change and overall assessment.
  • Findings: each finding with severity (critical/major/minor/nit), file:line, concrete failure scenario, and suggested fix.
  • CI status: pass/fail with notes on any failures.
  • Verdict: APPROVE, REQUEST_CHANGES, or COMMENT.

6. Post the review

Write the review body to a temp file and post via CLI:

# Request changes
gh pr review <N> --request-changes --body-file /tmp/pr_review.md

# Approve
gh pr review <N> --approve --body-file /tmp/pr_review.md

# Comment only (no verdict)
gh pr review <N> --comment --body-file /tmp/pr_review.md

For inline comments on specific lines, use the GitHub API:

cat > /tmp/pr_review.json <<'EOF'
{
  "body": "review body",
  "event": "REQUEST_CHANGES",
  "comments": [
    {
      "path": "crates/foo/src/bar.rs",
      "line": 42,
      "body": "finding description"
    }
  ]
}
EOF
gh api --method POST /repos/{owner}/{repo}/pulls/<N>/reviews --input /tmp/pr_review.json

Always use --body-file or --input, never inline multiline --body.

7. Handle follow-up

If the review requests changes:

  • Monitor for new commits: gh pr view <N> --json commits
  • Re-review changed files only: git diff pr-<N>..origin/pull/<N>/head
  • Update the review when findings are addressed.

If CI was failing due to pre-existing main breakage:

  • Comment on the PR noting the failure is pre-existing.
  • Suggest updating the branch: gh pr update-branch <N>

Output format

PR Review: #<N> — <title>

Author: Risk tier: exempt | mechanical | standard | high-risk Changed files: across clusters

Summary

Findings

Severity Location Finding
critical file:line concrete failure scenario

CI Status

  • All checks pass / Failing:

Verdict

APPROVE / REQUEST_CHANGES / COMMENT

Notes

  • The user may ask for review in Chinese; respond in the same language but keep the review body in English per AGENTS.md rules.
  • When the user asks for "多角色对抗 review", run the full adversarial validation protocol — this skill's step 3 covers that.
  • If the PR is from a fork, check maintainerCanModify before attempting to push fixes.
  • For very large PRs (>50 files), cluster aggressively and delegate in parallel to keep review time reasonable.

Version History

  • 0d129ec Current 2026-08-20 14:32

Same Skill Collection

.agents/skills/adversarial-validation/SKILL.md
.agents/skills/arch-checks/SKILL.md
.agents/skills/code-change-verification/SKILL.md
.agents/skills/plugin-contract-guard/SKILL.md
.agents/skills/pr-creation-checker/SKILL.md
.agents/skills/rust-code-quality/SKILL.md
.agents/skills/rustfs-logging-governance/SKILL.md
.agents/skills/rustfs-release-publish/SKILL.md
.agents/skills/rustfs-release-version-bump/SKILL.md
.agents/skills/security-advisory-lessons/SKILL.md
.agents/skills/test-coverage-improver/SKILL.md
.agents/skills/tier-debug/SKILL.md
.mimocode/skills/issue-triage/SKILL.md

Metadata

Files
0
Version
0fe41da
Hash
75c687b7
Indexed
2026-08-20 14:32

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-29 21:51
浙ICP备14020137号-1 $Carte des visiteurs$