技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
review-pull-request【数据与研究】Review PR end-to-end using GH CLI. Diff analysis, commit history review, CI/CD check verify, severity-leveled feedback (blocking/suggestion/nit/ praise), gh pr review submission. Use → PR assigned for review, self-review before req others, second review after feedback addressed, audit merged PR for post-merge quality.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Review GH PR end-to-end — understand change → submit structured feedback. Uses gh CLI for all GH interactions + produces severity-leveled review comments.
owner/repo#number)Read PR description + understand what change accomplishes.
gh pr view <number> --json title,body,author,baseRefName,headRefName,labels,additions,deletions,changedFiles,reviewDecision
PR Size Guide:
+--------+-----------+---------+-------------------------------------+
| Size | Files | Lines | Review Approach |
+--------+-----------+---------+-------------------------------------+
| Small | 1-5 | <100 | Read every line, quick review |
| Medium | 5-15 | 100-500 | Focus on logic changes, skim config |
| Large | 15-30 | 500- | Review by commit, focus on critical |
| | | 1000 | files, flag if should be split |
| XL | 30+ | 1000+ | Flag for splitting. Review only the |
| | | | most critical files. |
+--------+-----------+---------+-------------------------------------+
gh pr view <number> --json commits --jq '.commits[].messageHeadline'
gh pr checks <number>
→ Clear understanding of what PR does, why exists, how big, CI green. Ctx shapes review approach.
If err: PR description empty/unclear → note as first feedback. PR w/o ctx = review antipattern. gh cmds fail → verify auth (gh auth status) + repo access.
Read actual code changes systematically.
gh pr diff <number>
gh pr diff <number> --patch # full patch format
→ Set of obs covering correctness, security, perf, quality for every meaningful change. Each obs has severity.
If err: diff too large to review effectively → flag: "This PR changes {N} files and {M} lines. I recommend splitting it into smaller PRs for more effective review." Still review highest-risk files.
Organize obs into severity levels.
Feedback Severity Levels:
+-----------+------+----------------------------------------------------+
| Level | Icon | Description |
+-----------+------+----------------------------------------------------+
| Blocking | [B] | Must fix before merge. Bugs, security issues, |
| | | data loss risks, broken functionality. |
| Suggest | [S] | Should fix, but won't block merge. Better |
| | | approaches, missing edge cases, style issues that |
| | | affect maintainability. |
| Nit | [N] | Optional improvement. Style preferences, minor |
| | | naming suggestions, formatting. |
| Praise | [P] | Good work worth calling out. Clever solutions, |
| | | thorough testing, clean abstractions. |
+-----------+------+----------------------------------------------------+
→ Sorted feedback list w/ clear severity. Blocking has fix suggestions. Ratio: few Blocking, some Suggest, minimal Nit, ≥1 Praise.
If err: everything seems blocking → PR may need rework not patch. Consider req changes at PR level vs line-by-line. Nothing wrong → say so — "LGTM" valid when code good.
Compose review w/ structured actionable feedback.
# Post inline comments via gh API
gh api repos/{owner}/{repo}/pulls/{number}/comments \
-f body="[B] This SQL query is vulnerable to injection. Use parameterized queries instead.\n\n\`\`\`suggestion\ndb.query('SELECT * FROM users WHERE id = $1', [userId])\n\`\`\`" \
-f commit_id="<sha>" \
-f path="src/users.js" \
-F line=42 \
-f side="RIGHT"
[B], [S], [N], [P]# Approve
gh pr review <number> --approve --body "Review summary here"
# Request changes (when blocking issues exist)
gh pr review <number> --request-changes --body "Review summary here"
# Comment only (when unsure or providing FYI feedback)
gh pr review <number> --comment --body "Review summary here"
→ Submitted review w/ clear actionable feedback. Author knows exactly what to fix (Blocking), consider (Suggest), what went well (Praise).
If err: gh pr review fails → check perms. Need write access or be requested reviewer. Inline comments fail → fall back to all feedback in review body w/ file:line refs.
Track resolution.
gh pr view <number> --json reviewDecision,reviews
gh pr diff <number> # check new commits
gh pr review <number> --approve --body "All blocking issues resolved. LGTM."
→ Blocking verified fixed. Conversation resolved. PR approved or further changes req'd w/ specific remaining items.
If err: author disagrees → discuss in PR thread. Focus on impact (why matters) not authority. Disagreement persists on non-blocking → yield gracefully. Author owns code.
review-software-architecture — system-level architecture review (complementary)security-audit-codebase — deep security analysis for security-sensitive PRscreate-pull-request — other side: creating PRs easy to reviewcommit-changes — clean commit history makes PR review easier