mcpField
G
github-pr

github-pr

github.com/gentleman-programming開発661203 回インストール31 週間前に更新
リポジトリ

github-pr について

github-prは、GitHub CLIでPull Requestを準備・作成するスキルです。規約に沿ったタイトル、構造化された説明、アトミックコミット、レビュー関連のオプションを扱います。

主な機能

  1. 01規約に沿ったPRタイトル形式
  2. 02構造化されたPR説明テンプレート
  3. 03アトミックコミットの指針
  4. 04gh pr createコマンド例
  5. 05レビュアー、ラベル、ドラフトの指定
  6. 06曖昧なタイトルや大規模PRを避ける指針

活用シーン

  1. 01明確なPRタイトルと説明の作成
  2. 02ghでのドラフトPR作成
  3. 03変更をアトミックコミットに整理
  4. 04PRへのレビュアーやラベルの追加

インストール

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

$npx skills add https://github.com/gentleman-programming/gentleman-skills --skill github-pr

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

詳細

使用する場面

  • 新しいプルリクエストを作成するとき
  • PR のタイトルと説明を書くとき
  • レビュー用のコミットを準備するとき
  • gh pr create コマンドを使用するとき

重要なパターン

PR のタイトル = Conventional Commit
<type>(<scope>): <short description>

feat     New feature
fix      Bug fix  
docs     Documentation
refactor Code refactoring
test     Adding tests
chore    Maintenance
PR の説明の構成
## Summary
- 1-3 bullet points explaining WHAT and WHY

## Changes
- List main changes

## Testing
- [ ] Tests added/updated
- [ ] Manual testing done

Closes #123
アトミックコミット
# Good: One thing per commit
git commit -m "feat(user): add User model"
git commit -m "feat(user): add UserService"
git commit -m "test(user): add UserService tests"

# Bad: Everything in one commit
git commit -m "add user feature"

コード例

基本的な PR の作成
gh pr create \
  --title "feat(auth): add OAuth2 login" \
  --body "## Summary
- Add Google OAuth2 authentication

## Changes
- Added AuthProvider component
- Created useAuth hook

Closes #42"
HEREDOC を使った PR(複雑な説明)
gh pr create --title "feat(dashboard): add analytics" --body "$(cat <<'EOF'
## Summary
- Add real-time analytics dashboard

## Changes
- Created AnalyticsProvider
- Added LineChart, BarChart components

## Testing
- [x] Unit tests for components
- [x] Manual testing complete

## Screenshots
![Dashboard](url)

Closes #123
EOF
)"
ドラフト PR
gh pr create --draft \
  --title "wip: refactor auth" \
  --body "Work in progress"
レビュアーとラベルを指定した PR
gh pr create \
  --title "feat(api): add rate limiting" \
  --body "Adds rate limiting to API" \
  --reviewer "user1,user2" \
  --label "enhancement,api"

コマンド

# Create PR
gh pr create --title "type(scope): desc" --body "..."

# Create with web editor
gh pr create --web

# View PR status
gh pr status

# View diff
gh pr diff

# Check CI status
gh pr checks

# Merge with squash
gh pr merge --squash

# Add reviewer
gh pr edit --add-reviewer username

避けるべきパターン

避ける:曖昧なタイトル
# Bad
gh pr create --title "fix bug"
gh pr create --title "update"

# Good
gh pr create --title "fix(auth): prevent session timeout"
避ける:巨大な PR
# Bad: 50 files, 2000+ lines in one PR

# Good: Split into logical PRs
# PR 1: feat(models): add User model
# PR 2: feat(api): add user endpoints
# PR 3: feat(ui): add user pages
避ける:説明が空の PR
# Bad
--body "Added feature"

# Good
--body "## Summary
- What you did and why

## Changes  
- Specific changes

Closes #123"

クイックリファレンス

タスクコマンド
PR を作成gh pr create -t "type: desc" -b "body"
ドラフト PRgh pr create --draft
ウェブエディターgh pr create --web
レビュアーを追加--reviewer user1,user2
ラベルを追加--label bug,high-priority
Issue をリンク本文に Closes #123 と記載
ステータスを表示gh pr status
スカッシュマージgh pr merge --squash

リソース

コメント