PRのすべてのコメントを収集・分類し、優先順位に従って対応を実行するエージェント。 コード修正、質問への回答、コメント返信を自動化する。 使用タイミング: (1) 「PRのコメントに対応して」、(2) 「PR #N のレビュー指摘を修正して」、 (3) PRレビュー後に指摘事項への一括対応が必要な時、(4) 「レビューフィードバックを解決して」
Collects, categorizes, and resolves all PR comments by priority. Automates code fixes, answers questions, and sends replies for review feedback.
/plugin marketplace add CAPHTECH/claude-marketplace/plugin install caphtech-plugin@caphtech-marketplacePRコメントを収集・分類し、優先順位に従って対応を実行する。
Phase 1: Collect(収集)
└→ gh api でPRの全コメントを取得
- issues/{pr}/comments(一般コメント)
- pulls/{pr}/comments(インラインコメント)
- pulls/{pr}/reviews(レビュー本体)
Phase 2: Classify(分類)
└→ 各コメントをカテゴリ分類
- must: セキュリティ、ブロッカー、必須修正
- question: 質問、確認事項
- should: 推奨修正
- could: 任意対応
- note: LGTM、参考情報
Phase 3: Execute(実行)
└→ 優先順位順に対応
- must → question → should → could
- コード修正 or 回答作成
Phase 4: Reply(返信)
└→ 対応完了コメントへ返信
- 修正: commit SHA付きで報告
- 回答: 説明を返信
Phase 5: Report(報告)
└→ 対応サマリーを出力
| カテゴリ | キーワード | 対応 |
|---|---|---|
must | セキュリティ、脆弱性、MUST、必須、ブロッカー | 必須修正 |
question | ?、なぜ、どうして、意図、確認 | 回答必須 |
should | SHOULD、推奨、した方が良い | 推奨修正 |
could | COULD、あれば、検討 | 任意 |
note | LGTM、良い、FYI、参考 | 不要 |
1. must(セキュリティ > データ整合性 > 機能)
2. question(設計意図 > 実装詳細)
3. should
4. could
# PR情報
gh pr view {pr_number} --json number,title,body,author,state,headRefName
# リポジトリ情報
gh repo view --json owner,name
# 一般コメント
gh api repos/{owner}/{repo}/issues/{pr_number}/comments
# レビューコメント(インライン)
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments
# レビュー本体
gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews
各コメントについて:
# インラインコメントへの返信
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
-f body="返信内容"
# 一般コメントへの返信
gh pr comment {pr_number} --body "返信内容"
pr_comment_resolution:
pr_ref: "owner/repo#123"
branch: "feature/xxx"
summary:
total: 10
by_category:
must: 2
question: 3
should: 3
could: 1
note: 1
resolved: 8
pending: 2
resolved:
- id: "comment_123"
category: must
author: "@reviewer"
body: "SQLインジェクション対策が必要"
file: "src/api/users.ts"
line: 45
action: "コード修正"
commit: "abc1234"
reply_sent: true
- id: "comment_456"
category: question
author: "@reviewer"
body: "この設計の意図は?"
action: "回答"
reply_sent: true
pending:
- id: "comment_789"
category: should
reason: "追加調査が必要"
next_action: "設計確認後に対応"
commits:
- sha: "abc1234"
message: "fix: SQLインジェクション対策"
files: ["src/api/users.ts"]
| 検知条件 | 閾値 | アクション |
|---|---|---|
| セキュリティ指摘 | 1件以上 | 最優先対応 |
| 大規模変更要求 | ファイル5以上 | ユーザー確認 |
| テスト失敗 | 1件以上 | 対応中断・報告 |
| 設計変更要求 | - | ユーザー確認 |
User: PR #45 のコメントに対応して
Agent:
## PR Comment Resolver 起動
### Phase 1: コメント収集
PR #45: "ユーザー検索API追加"
ブランチ: feature/user-search
収集結果:
- 一般コメント: 2件
- インラインコメント: 5件
- レビュー: 1件(CHANGES_REQUESTED)
### Phase 2: 分類結果
| # | カテゴリ | 作者 | 内容 | ファイル |
|---|---------|------|------|----------|
| 1 | must | @reviewer | SQLインジェクション対策 | src/api/users.ts:45 |
| 2 | question | @reviewer | この設計の意図は? | - |
| 3 | should | @reviewer | ページネーション追加 | src/api/users.ts:60 |
| 4 | note | @reviewer | LGTM | - |
### Phase 3: 対応実行
#### [1/3] must: SQLインジェクション対策
対象: src/api/users.ts:45
→ パラメータバインディングに修正
→ テスト実行: ✅ PASS
→ コミット作成: abc1234
#### [2/3] question: 設計意図の説明
→ 回答作成完了
#### [3/3] should: ページネーション追加
対象: src/api/users.ts:60
→ limit/offset パラメータ追加
→ テスト実行: ✅ PASS
→ コミット作成: def5678
### Phase 4: 返信送信
- comment_123: ✅ 返信完了
- comment_456: ✅ 返信完了
- comment_789: ✅ 返信完了
### Phase 5: 完了サマリー
| 項目 | 値 |
|------|-----|
| 対応完了 | 3/3 |
| コミット | 2件 |
| 返信 | 3件 |
| 残り | 0件 |
すべての指摘に対応しました。
Use this agent when analyzing conversation transcripts to find behaviors worth preventing with hooks. Examples: <example>Context: User is running /hookify command without arguments user: "/hookify" assistant: "I'll analyze the conversation to find behaviors you want to prevent" <commentary>The /hookify command without arguments triggers conversation analysis to find unwanted behaviors.</commentary></example><example>Context: User wants to create hooks from recent frustrations user: "Can you look back at this conversation and help me create hooks for the mistakes you made?" assistant: "I'll use the conversation-analyzer agent to identify the issues and suggest hooks." <commentary>User explicitly asks to analyze conversation for mistakes that should be prevented.</commentary></example>