pr-code-review
4
总安装量
4
周安装量
#50656
全站排名
安装命令
npx skills add https://github.com/arctuition/skills --skill pr-code-review
Agent 安装分布
codex
4
opencode
3
gemini-cli
3
antigravity
2
claude-code
2
junie
2
Skill 文档
PR Code Review
Use this skill to review GitHub PRs end-to-end with the gh CLI, leave inline comments tied to specific code lines, and conclude with a severity summary.
Quick workflow
- Identify the PR context.
- Collect and read diffs.
- Analyze and draft findings.
- Post inline comments on the relevant code lines.
- Provide a severity summary (high/medium/low).
Step-by-step
1) Identify PR and scope
- Resolve the PR number or URL and repository.
- Capture metadata to anchor comments and fetch commit IDs.
Suggested commands (see references/gh-cli.md):
gh pr view <pr> --json number,title,headRefOid,baseRefName,headRefName,author,changedFiles,additions,deletionsgh pr view <pr> --json files --jq '.files[] | {path,additions,deletions}'
2) Read the diff efficiently
- Start with file list and high-churn areas.
- Use patch output when you need line numbers.
- For larger PRs, break the diff into files and review sequentially.
Suggested commands:
gh pr diff <pr> --name-onlygh pr diff <pr> --patchgh pr diff <pr> --patch --color=never > /tmp/pr.diff
3) Analyze and record findings
- Classify each issue as High / Medium / Low severity.
- For each issue, capture: file path, line number, summary, reasoning, and recommended fix.
- Keep comments crisp and actionable.
4) Post inline comments in the PR
- Prefer inline comments tied to exact file/line.
- If inline comments are not possible, fall back to a general review comment.
Primary path (inline comment via GitHub API using gh api):
- Use
headRefOidascommit_id. - Use file path and line number from the patch output.
Fallback path (general review comment):
- Use
gh pr review --comment -b "..."orgh pr comment -b "...".
See references/gh-cli.md for examples.
5) Final summary by severity
Provide a final summary grouped by severity:
- High: issues that can cause correctness, security, data loss, or outage.
- Medium: issues that affect reliability, maintainability, or performance.
- Low: minor style issues, low-risk refactors, or optional improvements.
Include counts and short titles of each issue, and mention any files that were not reviewed (if any).
Output format
- Use short, direct sentences.
- Always include file path and line number with each inline comment.
- End with a severity summary in three sections: High / Medium / Low.
References
references/gh-cli.mdfor command patterns and inline comment API usage.