Create GitHub Pull Request

VerifiedSafe

Automates GitHub pull request creation after successful build, commit, and push. Includes review comment monitoring.

Sby Skills Guide Bot
DevelopmentIntermediate
206/2/2026
Claude Code
#pull-request#github#automation#code-review

Recommended for

Our review

Creates a GitHub pull request using the repository's template, automatically polls for review comments, and initiates automated responses to review feedback.

Strengths

  • Uses the repository's PR template for consistency
  • Integrates with issue tracking via Closes #
  • Polls for review comments in the background
  • Triggers follow-up actions automatically after a review

Limitations

  • Requires local build success and prior commits/pushes
  • Only works within a Claude Code session with GitHub API access
  • Polling may time out after 2 hours if no review is submitted
When to use it

When you need to create a standardized pull request and automate the review follow-up process.

When not to use it

If you prefer manual review management or are working outside a Claude Code environment.

Security analysis

Safe
Quality score85/100

The skill uses standard GitHub CLI and API commands for creating PRs and polling review comments. No destructive actions, no data exfiltration, no obfuscation, and no disabling of safety measures.

No concerns found

Examples

Create PR for current branch
Create a pull request for the current branch using the issue template.
Create PR and start review polling
Create a PR with the title 'Fix login bug' and body that closes issue #45, then start polling for reviews.
Standard PR creation with confirmation
I have committed and pushed changes. Please create a pull request following the standard workflow.

name: create-pr description: GitHub プルリクエストを作成する。ビルド成功・コミット・プッシュ完了後に使用。

create-pr スキル

GitHub プルリクエストを作成するワークフロー。

前提条件

  • ローカルビルドが成功していること(/maven-build で確認)。
  • コミット・プッシュが完了していること。
  • docs/ 配下のドキュメントを新規作成・大幅更新した場合は、ソースコード照合レビューが完了していること(.claude/rules/reference-docs.md 参照)。

手順

1. PR テンプレートの確認

.github/pull_request_template.md を読み込み、テンプレート構造に準拠する。

2. PR 作成

gh pr create \
  --title "<イシュー番号に対応するタイトル>" \
  --body "$(cat <<'EOF'
## 概要

<コミットメッセージの要約を記載>

## 関連イシュー

Closes #<イシュー番号>

## チェックリスト

- [ ] 動作確認済み
- [ ] CI通過
- [ ] 関係者にレビュー依頼済み
EOF
)"

3. レビューの案内とポーリング

PR 作成が完了したら、ユーザーに以下を案内する:

PR を作成しました。別のターミナルで以下を実行してレビューしてください:

claude
/review-pr <PR番号>

このセッションでレビューコメントを監視しています。 レビューが投稿されたら自動で指摘対応を開始します。

案内後、バックグラウンドでレビューコメントのポーリングを開始する。

ポーリング手順

以下のコマンドをバックグラウンドで実行する(run_in_background を使用):

PR_NUM=<PR番号>
INTERVAL=30
MAX_WAIT=7200
REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
ELAPSED=0

while [ "$ELAPSED" -lt "$MAX_WAIT" ]; do
  FOUND=$(gh api "repos/${REPO}/issues/${PR_NUM}/comments?per_page=100&sort=created&direction=desc" 2>/dev/null \
    | python3 -c "
import sys, json
comments = json.load(sys.stdin)
for c in comments:
    if 'Reviewed by Claude Code' in c.get('body', ''):
        print(c['body'])
        sys.exit(0)
sys.exit(1)
" 2>/dev/null)

  if [ $? -eq 0 ]; then
    echo "$FOUND"
    exit 0
  fi

  sleep "$INTERVAL"
  ELAPSED=$((ELAPSED + INTERVAL))
done

echo "TIMEOUT: ${MAX_WAIT}秒経過してもレビューコメントが検出されませんでした。"
exit 1

レビューコメント検知後

ポーリングタスクの完了通知を受けたら、GitHub API で結果を取得する:

PR_NUM=<PR番号>
REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
gh api "repos/${REPO}/issues/${PR_NUM}/comments?per_page=100&sort=created&direction=desc" 2>/dev/null \
  | python3 -c "
import sys, json
comments = json.load(sys.stdin)
for c in comments:
    if 'Reviewed by Claude Code' in c.get('body', ''):
        print(c['body'])
        sys.exit(0)
"

レビューコメントを取得したら、/check-review スキルの手順に従って 指摘事項への対応を自動で開始する。

注意事項

  • PR 作成前に必ずユーザーに確認する。
  • テンプレートの構造を勝手に変更しない。
  • PR 本文に Closes #<イシュー番号> を記述してイシューと連携する。
Related skills