Use when CodeRabbit AI has posted review comments on a PR - interactively classify feedback by severity, discuss recommendations with user, apply agreed changes, and ensure mandatory commit and PR comment workflow with verification
Processes CodeRabbit AI review comments interactively, classifies by severity, discusses changes with user, applies approved fixes, and verifies PR resolution.
/plugin marketplace add ether-moon/skill-set/plugin install skill-set@skill-setInteractive processing of CodeRabbit AI review comments through user conversation: collect and classify feedback, discuss CRITICAL/MAJOR items for immediate action, analyze MINOR items with recommendations, and complete workflow with verified git commits and PR comments.
Core principle: Interactive severity-based workflow with user conversation (collect → discuss → apply together → verify completion).
Use when:
Don't use when:
| Phase | Mode | Key Actions |
|---|---|---|
| Collection | Auto | Pre-check → Discover PR → Collect 200 comments → Filter & Classify |
| Discussion | Interactive | Present items → Get user decisions → Analyze MINOR with rationale |
| Application | Auto | Apply agreed changes → Commit & Push |
| Verification | Auto | Post PR comment → Verify @coderabbitai resolve tag |
@coderabbitai resolve commandIMPORTANT: Detect and use user's preferred language for all communication.
Detection priority (check in order):
git log --oneline -5 to see commit message languageApply detected language to:
Always keep in English:
Language variable usage in templates:
[In user's language] ← This marker means content should be in detected language
Example detection:
# User writes in Korean → Use Korean
# User writes in English → Use English
# User writes in Spanish → Use Spanish
# No clear signal → Use English (default)
3. **Discover PR**: Find current PR from branch
```bash
BRANCH=$(git branch --show-current)
gh pr list --head "$BRANCH" --json number,title,url
Collect Comments with Pagination (up to 200 comments):
Method 1: GraphQL with Pagination (Recommended)
get_all_comments() {
local pr_number=$1
local owner=$2
local repo=$3
local cursor=""
local has_next=true
local all_comments="[]"
while [ "$has_next" = "true" ]; do
local query='query($owner:String!, $repo:String!, $number:Int!, $cursor:String) {
repository(owner:$owner, name:$repo) {
pullRequest(number:$number) {
comments(first:100, after:$cursor) {
pageInfo { hasNextPage endCursor }
nodes {
id
author { login }
body
createdAt
replies(first:10) {
nodes { author { login } body createdAt }
}
}
}
}
}
}'
local result=$(gh api graphql -f query="$query" \
-F owner="$owner" -F repo="$repo" -F number="$pr_number" \
${cursor:+-F cursor="$cursor"})
local page_comments=$(echo "$result" | jq '.data.repository.pullRequest.comments.nodes')
all_comments=$(echo "$all_comments" | jq ". + $page_comments")
has_next=$(echo "$result" | jq -r '.data.repository.pullRequest.comments.pageInfo.hasNextPage')
cursor=$(echo "$result" | jq -r '.data.repository.pullRequest.comments.pageInfo.endCursor')
[ "$has_next" = "false" ] && break
[ $(echo "$all_comments" | jq 'length') -ge 200 ] && break
done
echo "$all_comments" | jq 'sort_by(.createdAt) | reverse | .[:200]'
}
Method 2: REST API with Pagination (Alternative)
get_all_comments_rest() {
local pr_number=$1
local page=1
local per_page=100
local all_comments="[]"
while [ $page -le 2 ]; do # Max 2 pages = 200 comments
local result=$(gh api "repos/$OWNER/$REPO/issues/$pr_number/comments?per_page=$per_page&page=$page")
[ "$(echo "$result" | jq 'length')" -eq 0 ] && break
all_comments=$(echo "$all_comments" | jq ". + $result")
((page++))
done
echo "$all_comments" | jq 'sort_by(.created_at) | reverse | .[:200]'
}
Filter: Process only unresolved CodeRabbit comments
Classify: Assign severity to each actionable item
Step 2.1 - Present Summary and CRITICAL/MAJOR Items:
[In user's language]
Found feedback: 23 items total
- CRITICAL: 2 items (security vulnerability 1, data loss risk 1)
- MAJOR: 5 items (performance issues 3, significant bugs 2)
- MINOR: 16 items (code quality improvements)
## Items Requiring Immediate Attention (CRITICAL/MAJOR 7 items)
### CRITICAL
1. `auth/login.ts:45` - SQL Injection vulnerability
- Issue: User input directly in query
- Suggestion: Use prepared statements
- Risk: ⚠️ High (security)
2. `data/sync.ts:89` - Data loss risk
- Issue: Sequential deletes without transaction
- Suggestion: Add transaction wrapper
- Risk: ⚠️ High (data integrity)
### MAJOR
3. `api/users.ts:123` - N+1 query problem
- Issue: Individual queries in loop
- Suggestion: Use eager loading for batch retrieval
- Impact: Performance (currently 101 queries for 100 items)
4. `cache/redis.ts:56` - Memory leak
- Issue: Missing connection close
- Suggestion: Add close() in finally block
- Impact: Resource exhaustion
[...more items]
How would you like to proceed?
- [1] Apply all (recommended - CRITICAL/MAJOR are mandatory fixes)
- [2] Review individually (confirm each item)
- [3] See details first
- [4] Start with MINOR analysis
Step 2.2 - Individual Selection Mode (Option 2):
[In user's language]
Reviewing each item individually.
[1/7] CRITICAL: `auth/login.ts:45` - SQL Injection vulnerability
Current code:
```typescript
const user = await db.query(
`SELECT * FROM users WHERE email = '${email}'`
);
Suggested change:
const user = await db.query(
'SELECT * FROM users WHERE email = $1',
[email]
);
CodeRabbit Analysis:
Severity: ⚠️ CRITICAL (immediate fix required)
Apply this change? [Y/n/skip]
Y
✅ Added to apply list
[2/7] CRITICAL: data/sync.ts:89 - Data loss risk
[...]
**Step 2.3 - MINOR Analysis & Recommendations:**
[In user's language]
✅ CRITICAL/MAJOR selection complete (7 items)
Now analyzing 16 MINOR recommendations. Reviewing each item to provide application recommendations.
[Analyzing...]
Items with clear improvement benefits.
utils/format.ts:34 - Variable name clarification (data → formattedUserData)
api/response.ts:67 - Error handling improvement
models/user.ts:123 - Remove type assertion
as User 강제 캐스팅services/notification.ts:45 - Extract magic number to constant
setTimeout(() => ..., 5000)const RETRY_DELAY_MS = 5000프로젝트 스타일이나 향후 확장성에 따라 결정할 사항들입니다.
components/Button.tsx:89 - Function extraction suggestion
hooks/useAuth.ts:34 - Extract custom hook
api/middleware.ts:78 - Detailed error messages
[... 더 많은 선택 applied / apply 항목]
applied / apply하지 않는 것이 더 좋은 항목들입니다.
config/db.ts:12 - Add comments suggestion
maxConnections, timeoutMs)utils/array.ts:56 - Lodash 사용 제안
tests/user.test.ts:123 - Add test cases 제안
즉시 applied / apply recommended: CRITICAL 2items + MAJOR 5items + MINOR applied / applyrecommended 4items = 11items Consider in future: MINOR 선택applied / apply 9items applied / apply 안 함: MINOR Unnecessary 3items
How would you like to proceed?
[사용자 선택 대기]
**Step 2.4 - Individual Selection for MINOR (Option 3 or 4):**
3
개별 선택 모드로 진행하겠습니다. 먼저 CRITICAL/MAJOR부터 확인합니다. (강력 recommended)
[CRITICAL/MAJOR 7items 개별 확인... 위의 2.2 과정]
이제 MINOR applied / apply recommended 항목을 확인하시겠습니까? [Y/n]
Y
[recommended 1/4] utils/format.ts:34 - 변수명 명확화
현재 코드:
function formatUser(raw: any) {
const data = {
name: raw.userName,
email: raw.userEmail
};
return data;
}
제안 변경:
function formatUser(raw: any) {
const formattedUserData = {
name: raw.userName,
email: raw.userEmail
};
return formattedUserData;
}
analysis / analyzing:
applied / apply하시겠습니까? [Y/n/skip/detail]
Y
✅ applied / apply 목록에 추가
[recommended 2/4] api/response.ts:67 - Error handling improvement
[...]
**Step 2.5 - Final Confirmation:**
✅ applied / apply 예정: 11items
🔄 skipped - Consider in future: 9items
❌ skipped - Unnecessary: 3items
Proceed as planned?
[사용자 선택 대기]
### Phase 3: Application & Completion (Automatic with Verification)
**Step 3.1 - Apply Changes:**
changes을 applied / apply하겠습니다.
[1/11] CRITICAL: auth/login.ts:45 - SQL Injection 수정 ✅ complete / completed
[2/11] CRITICAL: data/sync.ts:89 - 트랜잭션 추가 ✅ complete / completed
[3/11] MAJOR: api/users.ts:123 - N+1 쿼리 해결 ✅ complete / completed
[...]
[11/11] MINOR: services/notification.ts:45 - 상수화 ✅ complete / completed
✅ 모든 changes applied / apply complete / completed (11/11)
**Step 3.2 - Commit & Push:**
changes을 commit하고 push합니다.
commit 메시지: "fix: Apply CodeRabbit feedback
Applied 11 items (2 critical, 5 major, 4 minor recommended)"
[실행] git add . ✅ Staged 6 files
[실행] git commit -m "..." ✅ Commit created: a1b2c3d
[실행] git push ✅ Pushed to origin/coderabbit-review-skill
모든 changes이 commit되고 push되었습니다.
**Step 3.3 - Generate & Review PR Comment:**
PR에 post할 코멘트를 작성했습니다.
@coderabbitai resolve
CRITICAL (2items)
auth/login.ts:45 - SQL Injection 취약점 수정 (Prepared statement applied / apply)data/sync.ts:89 - 트랜잭션 추가로 데이터 손실 위험 제거MAJOR (5items)
api/users.ts:123 - N+1 쿼리 해결 (eager loading으로 101→1 쿼리 감소)cache/redis.ts:56 - 메모리 누수 수정 (finally 블록 추가)services/payment.ts:234 - 결제 실패 시 롤백 로직 추가api/search.ts:89 - 인덱스 누락 경고 해결 (복합 인덱스 추가)workers/job.ts:156 - 무한 루프 위험 제거 (최대 재시도 횟수 설정)MINOR - applied / apply recommended (4items)
utils/format.ts:34 - 변수명 명확화 (data → formattedUserData)api/response.ts:67 - 에러 로깅 추가models/user.ts:123 - 타입 가드 사용으로 안정성 향상services/notification.ts:45 - Extract magic number to constantConsider in future 항목 (9items)
components/Button.tsx:89 - Function extraction suggestion (현재 복잡도 적정)hooks/useAuth.ts:34 - Extract custom hook (반복 3회, 4회부터 고려)api/middleware.ts:78 - Detailed error messages (보안 정책 review 필요)utils/validator.ts:45 - 정규식 성능 최적화 (현재 사용량에서 영향 미미)components/Modal.tsx:123 - 접근성 속성 추가 (다음 스프린트 일괄 applied / apply 예정)services/cache.ts:67 - 캐시 무효화 전략 개선 (아키텍처 논의 후 결정)api/pagination.ts:34 - 커서 기반 페이지네이션 (현재 offset 방식 충분)tests/integration/api.test.ts:89 - 테스트 격리 개선 (리팩토링 시 함께 진행)docs/api.md:12 - API 문서 업데이트 (다음 릴리스 전 일괄 작업)Unnecessary (3items)
config/db.ts:12 - Excessive comments 추가 (코드가 충분히 자명함)utils/array.ts:56 - Lodash 사용 제안 (Unnecessary dependency, 네이티브로 충분)tests/user.test.ts:123 - 극단적 엣지 케이스 테스트 (실용성 낮음)이 코멘트를 PR에 post하시겠습니까?
[사용자 선택 대기]
**Step 3.4 - Edit Mode (Option 2):**
2
코멘트를 어떻게 수정하시겠습니까?
1
applied / apply 항목 중 수정할 항목의 번호나 파일명을 입력하세요: (예: "1", "auth/login.ts:45", 또는 "done"으로 complete / completed)
api/users.ts:123
현재 설명: "N+1 쿼리 해결 (eager loading으로 101→1 쿼리 감소)"
새 설명을 입력하세요: (빈 줄 입력 시 현재 유지)
N+1 쿼리 해결 (includes를 사용한 eager loading으로 성능 개선)
✅ 업데이트 complete / completed
다음 항목? (번호/파일명 또는 "done")
done
수정된 코멘트를 확인하시겠습니까? [Y/n]
Y
[수정된 코멘트 전체 다시 표시]
post하시겠습니까? [Y/n/edit]
Y
**Step 3.5 - Post & Verify:**
PR 코멘트를 post하고 검증합니다.
[실행] gh pr comment 123 --body "..." ✅ 코멘트 post 성공
[대기] GitHub API 동기화 중... (2초)
[검증 1/3] 최신 코멘트 조회 중... ✅ 코멘트 확인
[검증 2/3] @coderabbitai resolve 태그 존재 확인... ✅ 태그 확인
[검증 3/3] 코멘트 내용 무결성 확인... ✅ 모든 섹션 포함 확인
✅ 모든 단계 complete / completed! 🎉
processing 내용:
Consider in future 항목 9items은 적절한 시점에 review하시면 됩니다.
## The Iron Law: PR Comment is MANDATORY
**PR comment with @coderabbitai resolve is NOT optional.**
### Triple Verification System
1. **Create Dedicated TodoWrite Item:**
2. **Post Comment:**
```bash
gh pr comment "$PR_NUMBER" --body "$(cat <<'COMMENT_EOF'
@coderabbitai resolve
## CodeRabbit 피드백 processing complete / completed
[내용...]
COMMENT_EOF
)"
Immediate Verification (3 Checks):
# Check 1: Command succeeded
if [ $? -ne 0 ]; then
echo "❌ CRITICAL: Comment post failed"
# Retry logic
fi
# Wait for API sync
sleep 2
# Check 2: Comment exists
LAST_COMMENT=$(gh pr view "$PR_NUMBER" --json comments --jq '.comments[-1].body')
# Check 3: Contains resolve tag
if ! echo "$LAST_COMMENT" | grep -q "@coderabbitai resolve"; then
echo "❌ CRITICAL: PR comment missing @coderabbitai resolve tag"
# Retry logic
else
echo "✅ VERIFIED: PR comment posted with @coderabbitai resolve"
fi
Retry Logic:
post_pr_comment_with_verification() {
local pr_number=$1
local comment_body=$2
local max_attempts=3
local attempt=1
while [ $attempt -le $max_attempts ]; do
echo "[Attempt $attempt/$max_attempts] Posting PR comment..."
if gh pr comment "$pr_number" --body "$comment_body"; then
sleep 2
local last_comment=$(gh pr view "$pr_number" --json comments --jq '.comments[-1].body')
if echo "$last_comment" | grep -q "@coderabbitai resolve"; then
echo "✅ SUCCESS: PR comment verified"
return 0
fi
fi
echo "⚠️ Attempt $attempt failed, retrying..."
((attempt++))
sleep 3
done
echo "❌ CRITICAL FAILURE: Failed after $max_attempts attempts"
return 1
}
Before marking workflow complete, verify ALL:
gh pr comment command executedNo shortcuts. No assumptions. Verify every time.
STOP immediately if you think:
ALL OF THESE ARE FAILURES - VERIFY THE COMMENT
Problem: Missing comments when PR has 100+ comments Fix: Use GraphQL/REST pagination to collect up to 200 comments
Problem: User doesn't understand why suggestions are categorized as recommended/optional/unnecessary Fix: Include 1-2 line rationale for each MINOR item classification
Problem: Assuming comment was posted without verification Fix: Always run triple-verification (command success + API sync + tag check)
Problem: Applying changes user didn't explicitly approve Fix: Present summary, get user decision, then apply only agreed items
Problem: Stopping workflow when single item fails Fix: Skip failed item with explanation, continue with others, complete Phase 3
Before this skill:
After this skill:
You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.