mcpField
C
create-pr

create-pr

github.com/davila7開発33.1k314 回インストール今日更新
リポジトリ

create-pr について

Sentryのエンジニアリング慣行に沿ってGitHubのプルリクエストを作成するスキルです。ブランチ確認、変更分析、説明文の作成、PR作成、レビュアー依頼を、認証済みのGitHub CLIで進めます。

主な機能

  1. 01ブランチ状態とコミットの確認
  2. 02提出予定の差分のレビュー
  3. 03PR説明文の構成
  4. 04ghによるPR作成
  5. 05レビュアーの依頼

活用シーン

  1. 01機能追加や修正のPR準備
  2. 02変更内容と理由の説明
  3. 03PRで関連課題を参照
  4. 04既知のレビュアーの指定

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/davila7/claude-code-templates --skill create-pr

インストール後、Claude Code で/create-prを入力して読み込まれたか確認します。

詳細

Create Pull Request

Sentry のエンジニアリングプラクティスに従ってプルリクエストを作成します。

必要条件: GitHub CLI (gh) が認証済みで利用可能であること。

プロセス

ステップ 1: ブランチの状態を確認
# Check current branch and status
git status
git log main..HEAD --oneline

以下を確認してください:

  • すべての変更がコミットされていること
  • ブランチがリモートと最新の状態であること
  • 必要に応じて変更が main にリベースされていること
ステップ 2: 変更内容を分析

PR に含まれる内容を確認します:

# See all commits that will be in the PR
git log main..HEAD

# See the full diff
git diff main...HEAD

説明を書く前に、すべての変更の範囲と目的を把握してください。

ステップ 3: PR の説明を作成

以下の構成に従ってください:

<brief description of what the PR does>

<why these changes are being made - the motivation>

<alternative approaches considered, if any>

<any additional context reviewers need>

含めないもの:

  • 「テスト計画」セクション
  • テスト手順のチェックボックスリスト
  • diff の冗長な要約

含めるもの:

  • 何を、なぜ行ったのかの明確な説明
  • 関連する Issue やチケットへのリンク
  • コードからは分かりにくい背景情報
  • 特に注意深くレビューが必要な箇所に関する補足
ステップ 4: PR を作成
gh pr create --title "<type>(<scope>): <description>" --body "$(cat <<'EOF'
<description body here>
EOF
)"

タイトルの形式 はコミットの規約に従います:

  • feat(scope): Add new feature
  • fix(scope): Fix the bug
  • ref: Refactor something
ステップ 5: レビュアーを追加(分かっている場合)
# Request review from specific people
gh pr edit --add-reviewer username1,username2

# Or request from a team
gh pr edit --add-reviewer @getsentry/team-name

明確な責任範囲を保つため、レビュアーは 1~3 名に制限してください。

PR 説明の例

機能追加 PR
Add Slack thread replies for alert notifications

When an alert is updated or resolved, we now post a reply to the original
Slack thread instead of creating a new message. This keeps related
notifications grouped and reduces channel noise.

Previously considered posting edits to the original message, but threading
better preserves the timeline of events and works when the original message
is older than Slack's edit window.

Refs SENTRY-1234
バグ修正 PR
Handle null response in user API endpoint

The user endpoint could return null for soft-deleted accounts, causing
dashboard crashes when accessing user properties. This adds a null check
and returns a proper 404 response.

Found while investigating SENTRY-5678.

Fixes SENTRY-5678
リファクタリング PR
Extract validation logic to shared module

Moves duplicate validation code from the alerts, issues, and projects
endpoints into a shared validator class. No behavior change.

This prepares for adding new validation rules in SENTRY-9999 without
duplicating logic across endpoints.

Issue の参照

PR の本文で Issue を参照します:

構文効果
Fixes #1234マージ時に GitHub Issue をクローズ
Fixes SENTRY-1234Sentry Issue をクローズ
Refs GH-1234クローズせずにリンク
Refs LINEAR-ABC-123Linear Issue をリンク

ガイドライン

  • 1 つの PR につき 1 つの機能/修正 - 無関係な変更をまとめないでください
  • レビューしやすい PR にする - 小さい PR ほど、より早く、より質の高いレビューを受けられます
  • 理由を説明する - コードは何をしたかを示し、説明文はなぜそうしたかを説明します
  • WIP は早めに明示する - 早期のフィードバックを得るためにドラフト PR を使用してください

参考資料

コメント