Skip to content
Data
Command

/pr-review-check

AI PR 리뷰 코멘트를 triage하고 유효한 것만 안전하게 수정

From plugin
claude-code-history-viewer
2k1 skill9 agents1 command

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/pr-review-check

Context preview

What this command does when you run it.

AI PR 리뷰 코멘트를 triage하고 유효한 것만 안전하게 수정

Command definition

pr-review-check.md
description: AI PR 리뷰 코멘트를 triage하고 유효한 것만 안전하게 수정
argument-hint: "[PR 번호 — 생략 시 현재 브랜치의 PR]"

PR 리뷰 코멘트 확인

AI 리뷰어(CodeRabbit, Claude bot, Codex, Gemini, Copilot 등)가 남긴 코멘트를 수집 · 분류 · 영향 분석 후, **승인된 유효 이슈만** 한 건씩 원자적으로 수정한다.

**Absolute rules (MUST follow):**

  • MUST produce the triage report and get user approval BEFORE modifying any code.
  • MUST NOT copy-paste AI-suggested patches verbatim. Understand the concern, then re-derive the fix from scratch.
  • MUST fix one issue at a time. NO drive-by refactors, formatting changes, or style cleanups.
  • MUST write GitHub replies in English (user preference).
  • MUST NOT auto-resolve review threads. Let the reviewer (or the bot's re-review) close them.
  • MUST NOT invoke adversarial CLIs (gemini/codex) without explicit user approval.

입력 인자: `$ARGUMENTS` (PR 번호, 생략 가능)

---

Phase 0 — 수집 (Collect)

1. **PR 번호 결정**: 인자가 있으면 사용, 없으면 `gh pr view --json number -q .number` 로 현재 브랜치의 PR 확인. PR이 없으면 사용자에게 물어본다. 2. **리뷰 데이터 fetch** (REST + GraphQL 조합):

  • `gh api repos/{owner}/{repo}/pulls/{N}/comments` — 인라인 코멘트
  • `gh api repos/{owner}/{repo}/pulls/{N}/reviews` — 리뷰 레벨 body
  • GraphQL로 review threads + resolution 상태:
     gh api graphql -f query='
       query($owner:String!,$repo:String!,$num:Int!){
         repository(owner:$owner,name:$repo){
           pullRequest(number:$num){
             reviewThreads(first:100){nodes{
               id isResolved isOutdated
               comments(first:20){nodes{id databaseId author{login} body path line originalLine diffHunk}}
             }}
           }
         }
       }' -f owner=... -f repo=... -F num=...

3. **AI 봇 필터**: author login이 `coderabbitai`, `coderabbitai[bot]`, `claude[bot]`, `chatgpt-codex-connector`, `gemini-code-assist[bot]`, `copilot-pull-request-reviewer[bot]`, `github-actions[bot]` 중 하나인 것만. 인간 리뷰어 코멘트는 이 워크플로우 대상 아님 — 별도로 보고. 4. **resolved/outdated 스레드 제외** (이미 대응 완료). 5. PR의 변경 파일 목록도 같이 확보: `gh pr diff {N} --name-only` — "in-scope" 판정에 사용.

Phase 1 — 분류 (Triage) — **코드 수정 금지**

각 코멘트에 대해 아래를 판정한다. 결과는 **테이블로 사용자에게 먼저 보고하고 승인 대기**한다.

1-1. 중복 제거

여러 봇이 같은 파일+라인+본질적으로 같은 지적을 하면 하나의 행으로 병합. `Sources` 컬럼에 여러 봇 표시.

1-2. 분류 축 (4개)

| 축 | 값 | |----|-----| | **Severity** | `Critical` (동작 파괴/데이터 유출/롤백 차단) / `Warning` (정확성 위험) / `Suggestion` (개선 제안) / `Nit` (스타일·취향) | | **Validity** | `valid` / `false-positive` / `needs-investigation` | | **Scope** | `in-scope` (이 PR diff에 포함된 파일·라인) / `out-of-scope` (기존 코드, 이 PR이 건드린 적 없음) | | **Action** | `fix-now` / `skip` / `follow-up-issue` / `ask-user` |

1-3. 알려진 false-positive 패턴 → 자동 다운그레이드

아래에 해당하면 기본 `false-positive` 또는 `Nit`으로 분류하고 이유 명시:

  • 프로젝트 린터/포매터가 이미 처리하는 스타일·포맷
  • 타입 시스템상 non-null 보장된 값에 대한 null 체크 요구
  • private/internal 헬퍼에 대한 docstring/주석 요구
  • 테스트에 불필요한 mock·assertion 추가 요구
  • 사소한 네이밍 취향

**단, 비동기 race condition 지적은 CodeRabbit이 ~75% 놓치지만 지적 자체는 자주 하므로 → 항상 `needs-investigation`으로 두고 수동 검증**.

1-4. 의도 이해 체크 (logic bug 맹점)

AI 리뷰어는 코드 품질에 최적화되어 있고 **기능의 의도는 모른다**. 각 valid 후보에 대해 자문: > "이 코멘트가 이 PR이 달성하려는 기능의 의도를 이해하고 있는가?"

아니라고 판단되면 `needs-investigation` + `ask-user`.

1-5. Scope 정책

  • `in-scope` + valid → `fix-now` 후보
  • `out-of-scope` + valid → `follow-up-issue` (이 PR에선 절대 수정 안 함, 별도 이슈 생성)
  • `out-of-scope` + not-valid → `skip`

1-6. Nit 캡

`Nit`은 최대 5개까지만 개별 행으로 표시. 초과분은 `"plus N similar nits"` 한 줄로 요약.

1-7. Questions batch (의문 제기 · 의도 확인)

AI 리뷰는 **기능 의도 · 저장소 컨벤션 · 숨은 제약**을 모른다. Claude가 판단 못하는 경우를 단발성으로 흩뿌리지 말고, triage 리포트와 **같은 출력 안**에 배치로 모아서 한 번에 묻는다. 아래 카테고리를 빠짐없이 점검:

| 카테고리 | 언제 묻는가 | 질문 예시 | |---------|------------|----------| | **의도성 확인** | 수정 시 관찰 가능한 동작이 바뀌는 경우 (단순 내부 정리가 아님) | "리뷰어는 에러 throw를 요구하는데 현재는 silent fail. 의도된 설계인가요?" | | **숨은 제약 확인** | 리뷰어가 repo 컨벤션·기존 구조를 모를 가능성 | "이 패턴은 코드베이스 전반에서 일관되게 쓰이는데, 정말 바꿔도 되나요?" | | **봇 의견 상충** | 두 AI 리뷰어가 서로 반대 제안 | "CodeRabbit은 A 접근, Gemini는 B 접근 — 어느 쪽으로 갈까요?" | | **범위 경계 애매** | in-scope / out-of-scope 판정 애매 | "이 파일은 한 줄만 바꿨는데 리뷰어는 전체 리팩터 요구. follow-up으로 뺄까요?" | | **AI 제안 자체가 의심스러움** | 리뷰어의 suggested fix가 새 버그를 유발할 가능성 | "제안대로 하면 X 테스트가 깨질 것 같은데, 다른 방법으로 해결할까요?" | | **대적자 불일치** `(adv)` | Phase 1.5 대적자(Gemini/Codex)가 Claude 분류와 다른 의견 | "Gemini는 #3을 valid로 보지만 Claude는 false-positive로 분류. 어느 쪽?" |

**원칙:**

  • 질문 없으면 이 섹션 생략.
  • 각 질문은 **해당 이슈 번호에 연결** (`Q1 → #2`, `Q2 → #2, #5` 처럼).
  • 단답/선택지 형태 선호 — 긴 서술 답변 요구 금지. 가능한 경우 A/B 옵션 제시.
  • 대적자 발 질문은 `(adv)` 태그 + 출처(Gemini/Codex) 명시. 두 대적자 모두 반대면 default를 대적자 쪽으로.
  • Phase 2 진행 중 **새로운 의문**이 생기면 그 이슈만 단독으로 stop-and-ask (기존 규칙 유지).

1-8. 리포트 포맷 (사용자에게 출력)

## PR #{N} AI 리뷰 Triage

Total: X comments from Y bots → Z unique issues after dedup

| # | Severity | Validity | Scope | Action | File:Line | Sources | Rationale |
|---|----------|----------|-------|--------|-----------|---------|-----------|
| 1 | Critical | valid | in-scope | fix-now | src/a.ts:42 | coderabbit, gemini | null deref on optional field |
| 2 | Warning  | needs-investigation | in-scope | ask-user | src/b.ts:10 | claude[bot] | async race — verify manually |
| 3 | Nit      | false-positive | in-scope | skip | src/c.ts:5 | coderabbit | style handled by prettier |
| 4 | Warning  | valid | out-of-scope | follow-up-issue | src/legacy.ts:200 | coderabbit | pre-existing, not touched by this PR |
| + | plus 3 similar nits summarized |

## Questions for you (선택 사항 — 질문 없으면 생략)

- **Q1 → #2 (의도성)**: 현재 `doWork()`는 에러를 throw 하지 않고 `null`을 반환. 리뷰어는 throw를 요구.
  - (A) 의도된 silent fail이다 → skip, 답글로 "intentional" 설명
  - (B) 의도 아니었다, throw로 바꿔야 함 → fix-now로 승격
- **Q2 → #5 (봇 상충)**: CodeRabbit은 `useMemo` 추가 권장, Gemini는 불필요하다고 평가. 어느 쪽?
  - (A) CodeRabbit (useMemo 추가)
  - (B) Gemini (그대로 유지)
- **Q3 → #4 (범위)**: `src/legacy.ts`는 이 PR에서 한 줄만 수정. 리뷰어는 파일 전체 리팩터 요구.
  - (A) 이 PR 스코프 밖 → follow-up 이슈 (권장)
  - (B) 이번에 같이 수정

## 다음 단계 제안
- fix-now: #1 (1건, 질문 답변 후 추가될 수 있음)
- ask-user: #2, #5 — 위 Q1, Q2 답변 필요
- follow-up-issue: #4 — 위 Q3 확정 후
- skip: #3, nits

위 질문에 답변 주시면 분류를 확정하고 Phase 2로 진행합니다. 테이블 자체를 수정하고 싶은 항목(승격/강등/제외)도 번호로 알려주세요.
Read more
Ships withclaude-code-history-viewer

The unified history viewer for AI coding assistants. Browse, search, and analyze conversations from Claude Code, Gemini CLI, Antigravity, Codex CLI, Cline, Cursor, Aider, OpenCode, ForgeCode, and CodeBuddy Code — as a desktop app or headless server.

Get the whole plugin