pr-create
PR 作成手順を自動化するためのガイド。依頼を受けたとき、または 参照しているTODOファイル の「PR 作成」以外が完了したタイミングでタイトル・本文整形、テンプレ適用、MCP での PR 作成を行う。
When & Why to Use This Skill
This Claude skill automates the end-to-end GitHub Pull Request (PR) creation process, ensuring high-quality submissions with minimal manual effort. It streamlines the developer workflow by automatically formatting titles according to Conventional Commits, applying repository-specific templates, and replacing placeholders with actual context. By leveraging MCP (Model Context Protocol) for direct GitHub integration, it handles the entire submission process and even provides fallback CLI commands for troubleshooting, significantly improving consistency and productivity in software development cycles.
Use Cases
- Scenario 1: Automatically generating a standardized Pull Request immediately after completing a task or updating a TODO file, ensuring the development momentum is maintained.
- Scenario 2: Enforcing organizational standards for PR titles and descriptions, such as 'feat: RM-XXX' prefixes, to ensure better traceability and cleaner git history.
- Scenario 3: Reducing manual errors by automatically filling out complex PR templates and ensuring no placeholders (like #<number> or file paths) are left unreplaced before submission.
- Scenario 4: Providing a 'one-liner' CLI command for team members to quickly re-run or modify a PR creation attempt if the initial automated process encounters environment-specific issues.
| name | pr-create |
|---|---|
| description | PR 作成手順を自動化するためのガイド。依頼を受けたとき、または 参照しているTODOファイル の「PR 作成」以外が完了したタイミングでタイトル・本文整形、テンプレ適用、MCP での PR 作成を行う。 |
目的
- Conventional Commits 形式のタイトルと所定テンプレを満たす PR を作成する。
- プレースホルダを埋め忘れずに create_pull_request を実行し、再実行手順も残す。
前提
- ブランチは作業内容に合致している(例: feat|fix|chore|docs/)。
- コミットは完了し、
git statusがクリーン。 .github/pull_request_template.mdが最新。
手順
- テンプレ確認
.github/pull_request_template.mdを読み、各項目とプレースホルダを把握する。
- タイトル決定
- 形式:
type: RM-XXX <slug>(例:fix: RM-074 readme badges) - type は Conventional Commits(例: feat / fix / chore / docs / refactor / ci)。
- 形式:
- 本文作成
- テンプレに沿って記入し、
## 関連リンク等の#<番号>やdocs/todo/...のプレースホルダを必ず実値に置換する。 /tmp/pr_body.mdなど書き込み可能なパスに本文を保存する。
- テンプレに沿って記入し、
- PR 作成(GitHub MCP)
create_pull_requestを使い、titleに決定したタイトル、bodyに/tmp/pr_body.mdの内容文字列を渡す。- 失敗した場合はエラーメッセージを確認し、再実行手順を用意する。
- 再実行ワンライナー共有(失敗時)
- 例:
gh pr create --title "<title>" --body-file /tmp/pr_body.md --fillなど、CLI で他の人が再実行できる一行コマンドを示す。
- 例:
- 完了確認
- PR URL を控え、必要なら ToDo や共有先に記録する。
チェックリスト
- タイトルが
type: RM-XXX <slug>形式か - テンプレ必須項目を全て埋めたか
-
#<番号>やdocs/todo/...のプレースホルダが残っていないか -
/tmp/pr_body.mdなど一時ファイルに本文を書き出したか -
create_pull_requestへタイトル・本文を正しく渡したか - 失敗時の再実行ワンライナーを共有したか