Skip to content
Development
Command

/review-pr

GitHub PR을 터미널에서 리뷰합니다. PR diff를 분석하고, 코드 리뷰 점수를 매기고, 리뷰 코멘트를 남깁니다. Trigger on "/review-pr", "PR 리뷰해줘", "리뷰해줘", "PR 봐줘", "코드 리뷰", "review this PR".

From plugin
wigtn-plugins
456 skills11 agents6 commands
Install
$ npx -y skills add wigtn/wigtn-plugins --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/review-pr

Context preview

What this command does when you run it.

GitHub PR을 터미널에서 리뷰합니다. PR diff를 분석하고, 코드 리뷰 점수를 매기고, 리뷰 코멘트를 남깁니다. Trigger on "/review-pr", "PR 리뷰해줘", "리뷰해줘", "PR 봐줘", "코드 리뷰", "review this PR".

Command definition

review-pr.md
argument-hint: "<PR번호 또는 URL>"
description: GitHub PR을 터미널에서 리뷰합니다. PR diff를 분석하고, 코드 리뷰 점수를 매기고, 리뷰 코멘트를 남깁니다. Trigger on "/review-pr", "PR 리뷰해줘", "리뷰해줘", "PR 봐줘", "코드 리뷰", "review this PR".

Review PR

GitHub Pull Request를 터미널에서 리뷰하고 피드백을 남깁니다.

Pipeline Position

`[/prd] → [/implement] → [/auto-commit] → PR 생성` 이후, 동료가 `[/review-pr #123]`으로 리뷰 결과 + 코멘트를 남기는 단계.

Usage

/review-pr 123                        # PR #123 리뷰
/review-pr 123 --level 3              # 심층 리뷰 (Level 3)
/review-pr 123 --level 4              # 아키텍처 리뷰 (Level 4)
/review-pr 123 --approve              # 리뷰 후 자동 승인 (findings PASS 시)
/review-pr 123 --comment-only         # GitHub에 코멘트만, 승인/거절 안함
/review-pr https://github.com/org/repo/pull/123  # URL로도 가능

Parameters

  • `$ARGUMENTS`: PR 번호 또는 GitHub PR URL (필수)
  • `--level <1-4>`: 리뷰 깊이 (기본: 2)
  • `--approve`: findings 롤업 PASS(critical 0, major 0) 시 자동 Approve
  • `--comment-only`: GitHub에 코멘트만 남기고 승인/거절 판단 안함
  • `--no-comment`: GitHub에 코멘트 남기지 않음 (로컬 결과만)
  • `--files <glob>`: 특정 파일만 리뷰 (예: `"src/**/*.ts"`)

Protocol

Step 1: PR 정보 수집

# PR 메타데이터 가져오기
gh pr view $PR_NUMBER --json title,body,author,baseRefName,headRefName,files,additions,deletions,changedFiles,reviewDecision,reviews,state

# PR diff 가져오기
gh pr diff $PR_NUMBER

# PR에 달린 기존 리뷰/코멘트 확인
gh pr view $PR_NUMBER --json comments,reviews

**PR 상태 확인:**

  • `state: MERGED` → "이미 머지된 PR입니다. 리뷰를 계속할까요?" (AskUserQuestion)
  • `state: CLOSED` → "닫힌 PR입니다. 리뷰를 계속할까요?" (AskUserQuestion)
  • `state: OPEN` → 정상 진행

**정보 요약 출력:**

┌─────────────────────────────────────────────────────────────┐
│  PR #123: Add user authentication API                       │
├─────────────────────────────────────────────────────────────┤
│  Author: @username                                          │
│  Branch: feature/user-auth → main                           │
│  Files: 5 changed (+234, -12)                               │
│  Status: OPEN | Reviews: 0 approved, 0 changes requested    │
└─────────────────────────────────────────────────────────────┘

Step 2: 변경사항 분석

> **연동**: `pr-reviewer` 에이전트를 호출합니다.

**리뷰 레벨별 동작:**

| Level | 분석 범위 | 에이전트 | |-------|----------|---------| | 1 (Quick) | 린트 수준, 포맷팅, 명명 규칙 | `pr-reviewer` 단독 | | 2 (Standard) | 5-Category 전체 평가 | `pr-reviewer` (병렬 이득이 크면 병렬) | | 3 (Deep) | 호출 체인, 에지 케이스, 보안 | `pr-reviewer` + `deep-review` 스킬 | | 4 (Architecture) | SOLID, 계층 위반, 확장성 | `pr-reviewer` + `architecture-review` 스킬 |

**병렬 리뷰 (Level 2+, 변경 범위가 넓을 때):** 변경 영역(모듈/디렉토리)별로 리뷰어를 나눠 실행한 뒤 findings를 합쳐 롤업한다. 렌즈 분할은 하지 않는다.

Step 3: 리뷰 결과 출력

Coverage-First 보고

findings는 severity로 사전 필터링하지 않고 전량 보고하되 각 finding에 `severity`(critical/major/minor/info)와 `confidence`(high/medium/low)를 표기한다(recall 우선, 취사선택은 하류에 위임).

## PR Review Result

### PR #123: Add user authentication API

| 판정 | critical | major | minor |
|------|---------|-------|-------|
| **PASS / WARN / FAIL** | N | N | N |

### Findings

#### Critical (즉시 수정 필요)
- 없음

#### Major (수정 권장)
- `src/api/auth.ts:45` — 에러 응답에 내부 스택 트레이스 노출
  → try-catch에서 generic error message 반환 권장

#### Minor (개선 제안)
- `src/types/auth.ts:12` — `any` 타입 사용
  → 구체적인 타입 정의 권장

### Recommendation
✅ APPROVE — 전반적으로 양호한 품질. Major 이슈 1건 수정 권장.

Step 4: GitHub 리뷰 제출 (선택)

> **조건**: `--no-comment` 옵션이 없을 때만 실행

**AskUserQuestion 호출:**

question: "리뷰 결과를 GitHub PR에 남길까요?"
header: "Review Submit"
options:
  - label: "Approve + 코멘트"
    description: "승인하고 리뷰 코멘트를 남깁니다 (findings PASS 시)"
  - label: "Request Changes + 코멘트"
    description: "변경 요청과 함께 리뷰 코멘트를 남깁니다"
  - label: "코멘트만"
    description: "승인/거절 없이 코멘트만 남깁니다"
  - label: "남기지 않음"
    description: "로컬 결과만 확인하고 종료합니다"

**`--approve` 플래그 사용 시 (findings 롤업 기준 — 노이즈 큰 점수로 자동 승인하지 않음):**

  • **PASS** (critical 0, major 0): 사용자 확인 없이 자동 Approve + 코멘트
  • **WARN/FAIL** (major ≥1 또는 critical ≥1): AskUserQuestion으로 확인 (자동 승인 불가)
  • 코멘트에는 롤업 판정(critical/major/minor 건수)만 쓴다. 합산 점수는 쓰지 않는다.

**GitHub 리뷰 제출:**

# Approve with comment
gh pr review $PR_NUMBER --approve --body "$(cat <<'EOF'
## Code Review (by Claude)

**Quality Gate: PASS — critical 0, major 1, minor 1**

### Summary
- 전반적으로 양호한 코드 품질
- 인증 로직이 잘 분리되어 있음
- 테스트 커버리지 적절

### Findings
#### Major
- `src/api/auth.ts:45` — 에러 응답에 내부 스택 트레이스 노출

#### Minor
- `src/types/auth.ts:12` — `any` 타입 사용 → 구체적인 타입 정의 권장

---
🤖 Reviewed by Claude Code (`/review-pr`)
EOF
)"

# Request changes with comment
gh pr review $PR_NUMBER --request-changes --body "..."

# Comment only (no approve/reject)
gh pr review $PR_NUMBER --comment --body "..."

**파일별 인라인 코멘트 (Critical/Major 이슈):**

# Critical/Major 이슈에 대해 인라인 코멘트
gh api repos/{owner}/{repo}/pulls/$PR_NUMBER/comments \
  --method POST \
  -f body="⚠️ **Major**: 에러 응답에 내부 스택 트레이스가 노출됩니다. try-catch에서 generic error message를 반환하세요." \
  -f path="src/api/auth.ts" \
  -F line=45 \
  -f side="RIGHT" \
  -f commit_id="$(gh pr view $PR_NUMBER --json headRefOid -q .headRefOid)"

Step 5: 결과 요약

┌─────────────────────────────────────────────────────────────┐
│  ✅ PR Review Complete                                       │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  PR #123: Add user authentication API                       │
│  Gate: PASS/WARN/FAIL (critical N / major N / minor N)      │
│  Decision: (판단)                                           │
│                                                             │
│  📝 GitHub Actions:                                         │
│  • Review comment posted                                    │
│  • 1 inline comment (Major issue)                           │
│  • Status: Approved                                         │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Review Decision Matrix

| 점수 | 추천 판단 | 설명 | |------|----------|------| | **90+** | ✅ A

Read more
Ships withwigtn-plugins

One plugin. 11 agents. From idea to a verified commit.

Get the whole plugin, auto-invoked
Stats
45
Stars
0
Views
2
Forks
Active
Maintenance
Python
Language
Apache-2.0
License
4d ago
Last commit
6mo ago
Created

Repo: wigtn/wigtn-plugins

Other commands on wigtn-plugins.