with one click
review-response
PRのレビューコメントに対して、説明・コード修正・返信・リゾルブを行います
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
PRのレビューコメントに対して、説明・コード修正・返信・リゾルブを行います
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | review-response |
| description | PRのレビューコメントに対して、説明・コード修正・返信・リゾルブを行います |
このスキルにより、GitHub PR のレビューコメントへの対応を順番に行うことができます。
gh) または curl によるGitHub API へのアクセスが可能であることこのプロジェクトでは XDG_CONFIG_HOME=/workspaces/fit-beat が設定されているため、
gh コマンドはデフォルトで /workspaces/fit-beat/gh を設定ディレクトリとして参照し、
~/.config/gh にマウントされた認証情報を読み込めません。
必ず以下のいずれかの方法で gh を使用してください。
# 認証確認
GH_CONFIG_DIR=~/.config/gh gh auth status
# コマンド実行例
GH_CONFIG_DIR=~/.config/gh gh pr view <PR番号>
GH_CONFIG_DIR=~/.config/gh gh pr comment <PR番号> --body "コメント"
gh が使えない場合は git credential fill でトークンを取得して curl で操作します。
# トークン取得
TOKEN=$(echo "protocol=https
host=github.com" | git credential fill 2>/dev/null | grep password | cut -d= -f2)
# レビューコメントへの返信(REST API)
curl -s -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-X POST "https://api.github.com/repos/<owner>/<repo>/pulls/<PR番号>/comments/<comment_id>/replies" \
-d '{"body":"返信内容"}'
# スレッドのリゾルブ(GraphQL API)
curl -s -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-X POST https://api.github.com/graphql \
-d '{"query":"mutation { resolveReviewThread(input: { threadId: \"<thread_id>\" }) { thread { isResolved } } }"}'
リゾルブには GraphQL の threadId (例: PRRT_kwDO...) が必要です。
databaseId (数値) とは異なるので注意してください。
TOKEN=$(echo "protocol=https
host=github.com" | git credential fill 2>/dev/null | grep password | cut -d= -f2)
# 未リゾルブのスレッド一覧(threadId と commentのdatabaseId を対応表示)
curl -s -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-X POST https://api.github.com/graphql \
-d '{"query":"{ repository(owner: \"<owner>\", name: \"<repo>\") { pullRequest(number: <PR番号>) { reviewThreads(first: 30) { nodes { id isResolved comments(first: 1) { nodes { databaseId } } } } } } }"}' \
| python3 -c "
import json,sys
data=json.load(sys.stdin)
for n in data['data']['repository']['pullRequest']['reviewThreads']['nodes']:
if not n['isResolved']:
print(n['id'], n['comments']['nodes'][0]['databaseId'])
"
ユーザーから対象PRが明示されていない場合は、必ずPR番号を確認してから開始します。
「対応するPRの番号を教えてください。」
PRの全レビューコメントを取得し、ユーザーに一覧で提示します。
github-mcp-server-pull_request_read ツール(method: get_review_comments)を使用します。
提示フォーマット(未リゾルブのみ):
## レビューコメント一覧
1. **[ファイル名:行番号]** - コメントの概要
2. **[ファイル名:行番号]** - コメントの概要
...
未リゾルブのコメントのうち最も先頭にあるものを取り上げ、以下を説明します:
ユーザーの判断に基づいて以下のいずれかを実行します:
bun check:write → bun typecheck → テスト実行修正した場合は変更内容をユーザーに説明し、確認を求めます。
# コミット(修正した場合)
git add <変更ファイル>
git commit -m "fix: 修正内容の説明
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
git push
# コメントへの返信
TOKEN=$(echo "protocol=https
host=github.com" | git credential fill 2>/dev/null | grep password | cut -d= -f2)
curl -s -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-X POST "https://api.github.com/repos/<owner>/<repo>/pulls/<PR番号>/comments/<comment_id>/replies" \
-d '{"body":"返信内容"}'
# スレッドのリゾルブ
curl -s -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-X POST https://api.github.com/graphql \
-d '{"query":"mutation { resolveReviewThread(input: { threadId: \"<thread_id>\" }) { thread { isResolved } } }"}'
返信文のガイドライン:
全ての未リゾルブコメントに対応完了したら、ユーザーに完了を報告します。
| 種別 | 対応方針 |
|---|---|
| バグ・ロジックエラー | 必ず修正する |
| アクセシビリティの問題 | 修正する |
| 提案コードがある場合 | 内容を確認の上、適用するか判断をユーザーに仰ぐ |
| コードスタイル・可読性の改善 | ユーザーに判断を仰ぐ |
| 誤検知(コードはすでに正しい) | 現状維持で返信・リゾルブ |
| 設計上の懸念(変更不要な指摘) | 意図を説明して返信・リゾルブ |
src/components/shadcn 配下はレビュー対象外