create-pr
GitHubのプルリクエスト(PR)を作成する際に使用します。変更のコミット、プッシュ、PR作成を含む完全なワークフローを日本語で実行します。「PRを作って」「プルリクエストを作成」「pull requestを作成」などのリクエストで自動的に起動します。
When & Why to Use This Skill
This Claude skill automates the end-to-end GitHub Pull Request (PR) workflow, including change verification, explicit file staging, standardized committing, and PR creation. It enhances developer productivity by enforcing project-specific pre-commit checks (tests/linting) and ensuring consistent documentation through structured templates, all while supporting natural language commands in Japanese.
Use Cases
- Streamlining Git Workflows: Automate the repetitive process of staging specific files, writing standardized commit messages, and pushing branches to remote repositories with a single command.
- Automated Quality Assurance: Ensure code quality by automatically running tests and linters defined in the project's CLAUDE.md before allowing a Pull Request to be created.
- Standardized PR Documentation: Automatically generate professional PR titles and descriptions based on repository templates, ensuring clear communication and better project tracking.
- Japanese Language Development Support: Enable developers to manage complex GitHub operations and PR lifecycles using Japanese natural language prompts, reducing the friction of CLI context switching.
| name | create-pr |
|---|---|
| description | GitHubのプルリクエスト(PR)作成を自動化。変更のコミット、プッシュ、PR作成を実行。「PRを作って」「プルリクエスト作成」「pull request」などの依頼で起動。 |
| model | claude-haiku-4-5-20251001 |
| user-invocable | true |
| context | fork |
Pull Request作成スキル
このスキルは、GitHubのプルリクエスト作成に必要な一連のワークフローを自動化します。
IMPORTANT: このスキルを使用する際は、特に指定が無い限り日本語でユーザーとコミュニケーションを取ってください。
ワークフロー
1. 変更内容の確認
現在の状態を確認します:
git status # 変更されたファイルを確認
git diff # 変更内容の差分を確認
2. 事前準備とチェック
コミット前に必要なチェックを実行します:
- リポジトリルートの
CLAUDE.mdを確認し、プロジェクト固有の要件を確認 - テスト、リンター、ビルドステップが記載されている場合は実行
- エラーや失敗がある場合は、先に解決してから進める
3. 変更のステージングとコミット
重要:ファイルのステージングは必ず明示的なパスで行います:
# ❌ 絶対に使用しない
git add .
git add -A
# ✅ 正しい方法
git add path/to/file1.txt path/to/file2.txt path/to/file3.txt
コミットメッセージは以下の形式で作成します:
git commit -m "$(cat <<'EOF'
<変更の簡潔な説明>
<詳細な説明(必要に応じて)>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
4. リモートへのプッシュ
現在のブランチをoriginにプッシュします:
git push -u origin <branch-name>
リモートにブランチが存在しない場合は自動的に作成されます。
5. プルリクエストの作成
PRテンプレート(リポジトリルートの.github/PULL_REQUEST_TEMPLATE.md)が存在する場合はReadツールで読み込んで基礎とし、存在しない場合は以下の構造で作成:
## 概要
<変更の簡潔な説明を1-3個の箇条書きで>
## 変更内容
<主な変更点のリスト>
## テスト
<変更がどのようにテストされたか(該当する場合)>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
PRを作成:
gh pr create --title "<PRのタイトル>" --body "$(cat <<'EOF'
<PR本文の内容>
EOF
)"
作成後、PR URLをユーザーに返します。
重要な注意事項
- 準備ステップをスキップしない:CLAUDE.mdに記載された要件は必ず実行
- テストやチェックが失敗したら進まない:失敗を解決してから次に進む
- 明示的なファイルパスでステージング:
git add .やgit add -Aは絶対に使用しない - 日本語でコミュニケーション:特に指定が無い限り、ユーザーとのやり取りは日本語で行う
- 不明な点があれば確認:どのステップでも不明な点があれば、ユーザーに確認を取る
エラーハンドリング
- コマンドが失敗した場合は、特に指定が無い限り日本語でエラーメッセージをユーザーに説明
- 次のステップに進む前に、問題を解決するための提案を提示
- 必要に応じて、ユーザーに追加の情報や確認を求める